Top |
const gchar * | lm_message_node_get_value () |
void | lm_message_node_set_value () |
LmMessageNode * | lm_message_node_add_child () |
void | lm_message_node_set_attributes () |
const gchar * | lm_message_node_get_attribute () |
void | lm_message_node_set_attribute () |
LmMessageNode * | lm_message_node_get_child () |
LmMessageNode * | lm_message_node_find_child () |
gboolean | lm_message_node_get_raw_mode () |
void | lm_message_node_set_raw_mode () |
LmMessageNode * | lm_message_node_ref () |
void | lm_message_node_unref () |
gchar * | lm_message_node_to_string () |
const gchar *
lm_message_node_get_value (LmMessageNode *node
);
Retrieves the value of node
.
void lm_message_node_set_value (LmMessageNode *node
,const gchar *value
);
Sets the value of node
. If a previous value is set it will be freed.
LmMessageNode * lm_message_node_add_child (LmMessageNode *node
,const gchar *name
,const gchar *value
);
Add a child node with name
and value set to value
.
void lm_message_node_set_attributes (LmMessageNode *node
,const gchar *name
,...
);
Sets a list of attributes. The arguments should be names and corresponding
value and needs to be ended with NULL
.
const gchar * lm_message_node_get_attribute (LmMessageNode *node
,const gchar *name
);
Fetches the attribute name
from node
.
void lm_message_node_set_attribute (LmMessageNode *node
,const gchar *name
,const gchar *value
);
Sets the attribute name
to value
.
LmMessageNode * lm_message_node_get_child (LmMessageNode *node
,const gchar *child_name
);
Fetches the child child_name
from node
. If child is not found as an
immediate child of node
NULL
is returned.
LmMessageNode * lm_message_node_find_child (LmMessageNode *node
,const gchar *child_name
);
Locates a child among all children of node
. The entire tree will be search
until a child with name child_name
is located.
gboolean
lm_message_node_get_raw_mode (LmMessageNode *node
);
Checks if the nodes value should be sent as raw mode.
void lm_message_node_set_raw_mode (LmMessageNode *node
,gboolean raw_mode
);
Set raw_mode
to TRUE
if you don't want to escape the value. You need to make sure the value is valid XML yourself.
LmMessageNode *
lm_message_node_ref (LmMessageNode *node
);
Adds a reference to node
.
void
lm_message_node_unref (LmMessageNode *node
);
Removes a reference from node
. When no more references are present the
node is freed. When freed lm_message_node_unref()
will be called on all
children. If caller needs to keep references to the children a call to
lm_message_node_ref()
needs to be done before the call to
lm_message_unref()
.
gchar *
lm_message_node_to_string (LmMessageNode *node
);
Returns an XML string representing the node. This is what is sent over the wire. This is used internally Loudmouth and is external for debugging purposes.
struct LmMessageNode { gchar *name; gchar *value; gboolean raw_mode; LmMessageNode *next; LmMessageNode *prev; LmMessageNode *parent; LmMessageNode *children; };
A struct representing a node in a message.
the name of the node |
||
value of the node, can be NULL |
||
if true, don't escape the content of the message. The content must be valid XML. |
||
LmMessageNode * |
next sibling |
|
LmMessageNode * |
previous sibling |
|
LmMessageNode * |
node parent |
|
LmMessageNode * |
pointing to first child |