![]() |
![]() |
![]() |
cpg-network Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties |
#define CPG_IMPORT_CONST (obj) #define CPG_IMPORT_ERROR enum CpgImportError; struct CpgImport; struct CpgImportClass; GQuark cpg_import_error_quark (void
); CpgImport * cpg_import_new (CpgNetwork *network
,CpgGroup *parent
,const gchar *id
,GFile *file
,GError **error
); CpgImport * cpg_import_new_from_path (CpgNetwork *network
,CpgGroup *parent
,const gchar *id
,const gchar *path
,GError **error
); gboolean cpg_import_load (CpgImport *self
,CpgNetwork *network
,CpgGroup *parent
,GError **error
); GFile * cpg_import_get_file (CpgImport *self
); gchar * cpg_import_get_path (CpgImport *self
); gboolean cpg_import_imports_object (CpgImport *self
,CpgObject *object
); const gchar * const * cpg_import_get_search_path (); void cpg_import_set_search_path (gchar **path
); void cpg_import_append_search_path (const gchar *path
); void cpg_import_prepend_search_path (const gchar *path
); CpgImportPrivate;
GEnum +----CpgImportError
GObject +----CpgObject +----CpgGroup +----CpgImport +----CpgImportAlias
CpgImport implements CpgUsable, CpgAnnotatable, CpgLayoutable, CpgTaggable and CpgModifiable.
The CpgImport object can be used to import templates and objects from an external network file.
#define CPG_IMPORT_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CPG_TYPE_IMPORT, CpgImport const))
CpgImport * cpg_import_new (CpgNetwork *network
,CpgGroup *parent
,const gchar *id
,GFile *file
,GError **error
);
Import objects from an external file. The import object will automatically be added to the parent group. If the import is done in the normal object tree of the network, templates that are defined in the imported file will be automatically imported in the networks' templates.
|
A CpgNetwork |
|
A CpgGroup. [allow-none] |
|
The import object id |
|
The file to import |
|
A GError |
Returns : |
A CpgImport or NULL if the import failed. |
CpgImport * cpg_import_new_from_path (CpgNetwork *network
,CpgGroup *parent
,const gchar *id
,const gchar *path
,GError **error
);
Convenience function to create a new import for a path. See cpg_import_new for more information. Note that the specified path should be an absolute path. The search directories are not used to resolve the full path.
|
A CpgNetwork |
|
A CpgGroup. [allow-none] |
|
The import object id |
|
The import file path |
|
A GError |
Returns : |
A CpgImport |
gboolean cpg_import_load (CpgImport *self
,CpgNetwork *network
,CpgGroup *parent
,GError **error
);
Perform the actual import. This function is called by cpg_import_new and should never have to be used manually. It's provided for use in bindings.
|
A CpgImport |
|
A CpgNetwork |
|
A CpgGroup. [allow-none] |
|
A GError |
Returns : |
TRUE if the import was successful, FALSE otherwise. |
GFile * cpg_import_get_file (CpgImport *self
);
Get the file that was imported.
|
A CpgImport |
Returns : |
A GFile. [transfer full][allow-none] |
gchar * cpg_import_get_path (CpgImport *self
);
Get the path that was imported.
|
A CpgImport |
Returns : |
the path. [transfer full][allow-none] |
gboolean cpg_import_imports_object (CpgImport *self
,CpgObject *object
);
const gchar * const * cpg_import_get_search_path ();
Get the search directories used to resolve import file names.
Returns : |
a NULL terminated list of strings. [array zero-terminated=1][transfer none]
|
void cpg_import_set_search_path (gchar **path
);
Set the search directories used to resolve import file names. path
should
be a NULL
terminated list of strings.
|
The search directories. [array zero-terminated=1] |
void cpg_import_append_search_path (const gchar *path
);
Append a search directory path to the list of paths to be searched when resolving an import file.
|
A directory path |
void cpg_import_prepend_search_path (const gchar *path
);
Prepend a search directory path to the list of paths to be searched when resolving an import file.
|
A directory path |