Top | ![]() |
![]() |
![]() |
![]() |
GBoxed ╰── VisuDataLoaderIter GObject ╰── ToolDbgObj ╰── ToolFileFormat ╰── VisuDataLoader
gboolean (*VisuDataLoaderFunc) (VisuDataLoader *self
,const gchar *filename
,VisuData *dataObj
,guint iSet
,GCancellable *cancel
,GError **error
);
Prototype of function to load filanema
and populate dataObj
accordingly.
self |
a VisuDataLoader object. |
|
filename |
a path to the file to load. |
|
dataObj |
the VisuData object to populate. |
|
iSet |
an integer specifying the set to load, if any. |
|
cancel |
a GCancellable object. |
[allow-none] |
error |
an error location. |
[allow-none] |
TRUE if filename
matches the format defined by self
,
even if some parsing errors may occur.
Since: 3.8
VisuDataLoader * visu_data_loader_new (const gchar *descr
,const gchar **patterns
,gboolean restricted
,VisuDataLoaderFunc func
,guint priority
);
Creates a new VisuDataLoader with the given description.
descr |
a string describing the object, translated and in UTF8. |
|
patterns |
the patterns used to identify files of this type. |
[array zero-terminated=1] |
restricted |
a boolean. |
|
func |
a loading method. |
[scope call] |
priority |
a integer. |
Since: 3.8
gint visu_data_loader_comparePriority (const VisuDataLoader *a
,const VisuDataLoader *b
);
Compare the priority of a
and b
.
Since: 3.8
gboolean visu_data_loader_load (VisuDataLoader *loader
,const gchar *filename
,VisuData *dataObj
,guint iSet
,GCancellable *cancel
,GError **error
);
Try to load filename
as a file format corresponding to
loader
. error
is not set if filename
is not of this format,
simply FALSE
is returned.
loader |
a VisuDataLoader object. |
|
filename |
a filename. |
|
dataObj |
a VisuData object to be populated. |
|
iSet |
an integer. |
|
cancel |
a cancellation object. |
[allow-none] |
error |
an error location. |
Since: 3.8
void visu_data_loader_setStatus (VisuDataLoader *loader
,const gchar *status
);
Change the current status of loader
. This can be used to notify
changes when visu_data_loader_load()
is taking long time.
Since: 3.8
VisuDataLoaderIter * visu_data_loader_iter_new ();
Creates a newly allocated iterator. This iterator can be used to
accumulate nodes when parsing a file. When parsing is finished, use
visu_data_loader_iter_allocate()
to allocate enough memory in a
VisuNodeArray to store the parsed data.
a newly allocated VisuDataLoaderIter
object. Use visu_data_loader_iter_unref()
when no longer needed.
[transfer full]
Since: 3.8
void visu_data_loader_iter_addNode (VisuDataLoaderIter *iter
,const VisuElement *element
);
Register an additional node of type element
.
Since: 3.8
guint visu_data_loader_iter_allocate (VisuDataLoaderIter *iter
,VisuNodeArray *array
);
Call visu_node_array_allocate()
on array
with the proper
VisuElement list and number of nodes as registered in iter
.
Since: 3.8
void
visu_data_loader_iter_unref (VisuDataLoaderIter *iter
);
Decrement the reference counter of iter
. When counter reaches 0,
the memory occupied by iter
is freed.
Since: 3.8
VisuDataLoaderIter *
visu_data_loader_iter_ref (VisuDataLoaderIter *iter
);
Increment the reference counter on iter
.
Since: 3.8