![]() |
![]() |
![]() |
GNOME Data Access 4 manual | ![]() |
---|---|---|---|---|
GdaTree; GdaTree* gda_tree_new (void); void gda_tree_add_manager (GdaTree *tree, GdaTreeManager *manager); void gda_tree_clean (GdaTree *tree); gboolean gda_tree_update_all (GdaTree *tree, GError **error); gboolean gda_tree_update_part (GdaTree *tree, GdaTreeNode *node, GError **error); GSList* gda_tree_get_nodes_in_path (GdaTree *tree, const gchar *tree_path, gboolean use_names); GdaTreeNode* gda_tree_get_node (GdaTree *tree, const gchar *tree_path, gboolean use_names); void gda_tree_set_attribute (GdaTree *tree, const gchar *attribute, const GValue *value, GDestroyNotify destroy); void gda_tree_dump (GdaTree *tree, GdaTreeNode *node, FILE *stream);
The GdaTree is the top level object representing hierarchically structured data. From this object it is also possible (depending on the tree managers it uses), to clean (remove all the nodes) the whole tree, or to request a complete or partial update of the nodes.
It is also possible to set attributes to the tree itself (as it is possible to do for tree nodes), or to dump the whole or part of a tree in an indented and easy to read fashion.
GdaTree* gda_tree_new (void);
Creates a new GdaTree object
Returns : |
a new GdaTree object |
Since 4.2
void gda_tree_add_manager (GdaTree *tree, GdaTreeManager *manager);
Sets manager
as a top GdaTreeManager object, which will be responsible for creating top level nodes in tree
.
|
a GdaTree object |
|
a GdaTreeManager object |
Since 4.2
void gda_tree_clean (GdaTree *tree);
Removes any node in tree
|
a GdaTree object |
Since 4.2
gboolean gda_tree_update_all (GdaTree *tree, GError **error);
Requests that tree
be populated with nodes. If an error occurs, then tree
's contents is left
unchanged, and otherwise tree
's previous contents is completely replaced by the new one.
|
a GdaTree object |
|
a place to store errors, or NULL
|
Returns : |
TRUE if no error occurred. |
Since 4.2
gboolean gda_tree_update_part (GdaTree *tree, GdaTreeNode *node, GError **error);
Requests that tree
be populated with nodes, starting from node
|
a GdaTree object |
|
a GdaTreeNode node in tree
|
|
a place to store errors, or NULL
|
Returns : |
TRUE if no error occurred. |
Since 4.2
GSList* gda_tree_get_nodes_in_path (GdaTree *tree, const gchar *tree_path, gboolean use_names);
|
|
|
|
|
|
Returns : |
GdaTreeNode* gda_tree_get_node (GdaTree *tree, const gchar *tree_path, gboolean use_names);
Locates a GdaTreeNode using the tree_path
path.
|
a GdaTree object |
|
full path to the required nodes (if use_names is TRUE , then it must start with '/')
|
|
if TRUE , then tree_path will be interpreted as a unix style path, and if FALSE ,
then tree_path will be interpreted similarly to the GtkTreePath's string representation.
|
Returns : |
the requested GdaTreeNode pointer, or NULL if not found
|
Since 4.2
void gda_tree_set_attribute (GdaTree *tree, const gchar *attribute, const GValue *value, GDestroyNotify destroy);
Sets an attribute to tree
, which will be accessible to any node in it.
|
a GdaTree object |
|
attribute name |
|
a GValue, or NULL
|
|
a function to be called when attribute is not needed anymore, or NULL
|
Since 4.2
void gda_tree_dump (GdaTree *tree, GdaTreeNode *node, FILE *stream);
Dumps the contents of tree
to stream
, using a hierarchical view.
|
a GdaTree |
|
a GdaTreeNode to start the dump from, or NULL for a full dump
|
|
a stream to send the dump to, or NULL for STDOUT
|
Since 4.2