Midgard2 Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy |
#include <midgard/midgard.h> struct MidgardSchema; struct MidgardSchemaClass; void midgard_schema_init (MidgardSchema *self
,const gchar *path
); gboolean midgard_schema_read_dir (MidgardSchema *self
,const gchar *dirname
); gboolean midgard_schema_type_exists (MidgardSchema *self
,const gchar *classname
); void midgard_schema_read_file (MidgardSchema *self
,const gchar *filename
);
void midgard_schema_init (MidgardSchema *self
,const gchar *path
);
Reads xml file which defines very basic and common classes. By default it's `/usr/local/share/midgard/MidgardObjects.xml` file.
|
MidgardSchema instance |
|
full path to a xml file with common classes |
gboolean midgard_schema_read_dir (MidgardSchema *self
,const gchar *dirname
);
This function expects 'schema' subdirectory at least.
'views' subdirectory is optional, and if missed, won't be read.
midgard_schema_read_file()
is invoked for every valid xml MgdSchema file
found in 'schema' subdirectory found in given directory.
You can also use explicit NULL instead of directory path. In such case, MIDGARD_ENV_GLOBAL_SHAREDIR environment variable is checked. If it's not set, directory path is determined using prefix set for compile and build time.
|
MidgardSchema instance |
|
a directory with 'schema' and 'views' subdirectories. |
Returns : |
TRUE if files has been read, FALSE otherwise |
gboolean midgard_schema_type_exists (MidgardSchema *self
,const gchar *classname
);
|
MidgardSchema instance |
|
GObjectClass derived class name |
Returns : |
TRUE if class is registered as MidgardObjectClass derived, FALSE otherwise |
void midgard_schema_read_file (MidgardSchema *self
,const gchar *filename
);
Reads file at given path and initialize all MidgardObjectClass derived classes defined in this file. Also reads all files which are included in this file. Such files are read and parsed when given file is already parsed and all classes defined in given file are already registered in GType system.
|
MidgardSchema instance |
|
full path to a file |