Node | |
NameNode -- The base class of the Config4GNU node type hierarchy. DescriptionThe Node type is the base type of all nodes in Config4GNU. A node
represents an element of configuration. It may be a specific section of
a configuration file, or it may be an entire configuration. In fact, it
may represent all of the configuration on a given computer. A configuration node exists as part of a tree of nodes. Each node can
have zero or more children nodes. Nodes also have parent nodes, unless
it is a root node. A root node is the starting point of a configuration
tree. Some nodes refer to just a part of a configuration file.
Other nodes refer to a whole file, and delegate the parts of the file
to child nodes.
For example,
the XMLFileNode reads in an XML document from an external "parser,"
then creates child nodes to refer to the sections of the XML document.
ComputerNode is an example of this type of node, for it reads in the
config4gnu.xml file and creates nodes for the
elements it finds within. Each node has zero or more properties associated with it. See Property
for more information. DetailsNODE()#define NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), node_get_type(), Node)) |
Casts an object to type Node, warning if it's not of type Node. NODE_CLASS()#define NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), node_get_type(), NodeClass)) |
Casts a class to type NodeClass. IS_NODE()#define IS_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), node_get_type())) |
Returns TRUE if the given object is of type Node, FALSE otherwise.
(Object can be subclass of Node.) IS_NODE_CLASS()#define IS_NODE_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), node_get_type())) |
Returns TRUE if the given class is a NodeClass, FALSE otherwise. NODE_GET_CLASS()#define NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), node_get_type(), NodeClass)) |
Given an object, return the NodeClass structure. node_get_type ()GType node_get_type (void); |
Registers the Node type if necessary. node_get_name ()const gchar* node_get_name (Node *me); |
Access the name for a given node. By itself, the Node class does
not implement this function. The XMLNode behavior is to return the
value of the sectionname attribute. node_get_children ()GList* node_get_children (Node *me); |
Access the children for a given node. By itself, the Node class
does not implement this function. The XMLNode behavior is to parse
all of the child entities in the XML, creating new nodes for each
non-property element it finds. node_get_properties ()GList* node_get_properties (Node *me); |
Access the properties for a given node. By itself, the Node class
does not implement this function. The XMLNode behavior is to parse
all of the child entities in the XML, creating new properties for
each property element it finds. node_apply ()void node_apply (Node *me); |
Applies user's changes to the underlying data store. For instance,
a XMLFileNode will output the changed XML document to the program
that writes the configuration. node_add_property ()Property* node_add_property (Node *me,
const char *name,
const char *value); |
Creates a new property and adds it to the current node. node_remove_property ()Removes the specified property from the current node. node_find_node ()Node* node_find_node (Node *me,
char *path); |
Returns a Node pointer for a node relative to the current node,
described by a path. node_find_property ()Returns a pointer to a Property, given a path. The resulting
Property is not referenced, so be sure to use g_object_ref() if you
plan on maintaining a pointer to it.
For nodepath, see node_find_node().
The first property that matches with a case-sensitive comparison is
returned. node_new ()Node* node_new (const char *node_type,
const char *uri); |
Creates a new instance of Node corresponding to the given type and
uri. node_get_display_name()#define node_get_display_name(node) node_get_name(node) |
A synonym for node_get_name(). Properties- "name" (gchararray : Read)
The name of the node.
| |
|
|