#include <Fl_XmlNode.h>
Inheritance diagram for Fl_XmlNode:
Public Types | |
enum | NodeTypes { DOM_DOCUMENT = 1, DOM_ELEMENT, DOM_PI, DOM_TEXT, DOM_CDATA_SECTION, DOM_COMMENT } |
Node type enumeration. More... | |
Public Methods | |
virtual | ~Fl_XmlNode () |
Destroys node and all it's children. | |
virtual void | clear () |
Deletes all children. | |
Fl_XmlNode * | parent () const |
Returns parent node of this node. More... | |
Fl_XmlDoc * | document () const |
Returns document context associated with this node. | |
int | type () const |
Returns type of node. | |
bool | is_document () const |
Returns true node is document type. | |
bool | is_element () const |
Returns true node is element type. | |
bool | is_leaf () const |
Returns true node is element type, but has no children. | |
bool | is_pi () const |
Returns true node is processing instruction (PI) type. | |
bool | is_comment () const |
Returns true node is comment type. | |
bool | is_text () const |
Returns true node is text type. | |
bool | is_cdata_section () const |
Returns true node is cdata-section type. | |
const Fl_String & | name () const |
Returns the node name. More... | |
void | name (const Fl_String &name) |
Set new name for node. | |
void | name (const char *name) |
Set new name for node. | |
Fl_String & | value () |
Returns the value of the node. More... | |
void | value (const Fl_String &new_value) |
Set new value to node. More... | |
void | value (const char *new_value) |
Set new value to node. More... | |
void | text (Fl_String &ret) |
Returns cdatas combined from children. More... | |
Fl_XmlNode * | child (const char *name, bool recursive=true) const |
Returns the first occurence of child with the given name. More... | |
Fl_XmlNode_List | nodes (const char *name) |
Returns list of all subnodes with give name. More... | |
Fl_XmlNode * | clone_node (bool deep=false) |
Creates a deepcopy of the node. More... | |
Fl_XmlNode * | remove_child (Fl_XmlNode *old_child) |
Removes the child node indicated by 'old_child' from the list of children, and returns it. More... | |
Fl_XmlNode * | replace_child (Fl_XmlNode *new_child, Fl_XmlNode *old_child) |
Replaces the child node 'old_child' with 'new_child' in the list of children, and returns the 'old_child' node. More... | |
Fl_XmlNode * | append_child (Fl_XmlNode *new_child) |
Adds the node 'new_child' to the end of the list of children of this node. More... | |
Fl_XmlNode * | insert_before (Fl_XmlNode *new_child, Fl_XmlNode *ref_child) |
Inserts the node 'new_child' before the existing child node 'ref_child'. More... | |
const Fl_XmlNode_List & | child_nodes () const |
Returns list of child nodes. | |
unsigned | children () const |
Returns number of child nodes. | |
bool | has_child_nodes () const |
Returns true, if node has children. | |
Fl_XmlNode * | child (int index) const |
Return child for given index, NULL if out of range. | |
const Fl_XmlAttributes & | attributes () const |
bool | has_attributes () const |
Returns true, if node has any attributes. | |
bool | has_attribute (const char *attr) const |
Returns true, if given attribute is found. More... | |
Fl_String & | get_attribute (const char *attr) const |
Returns attribute value for given attribute. More... | |
void | set_attribute (const char *attr, const char *value) |
Set new value to attribute 'attr'. More... | |
void | set_attribute (const char *attr, const Fl_String &value) |
Set new value to attribute 'attr'. More... | |
virtual void | save (Fl_Buffer &buffer, int indent=0) |
Saves node to buffer. More... | |
Protected Attributes | |
Fl_String | m_name |
Fl_String | m_value |
Fl_XmlAttributes | m_attributes |
uchar | m_nodetype |
Fl_XmlDoc * | m_document |
Fl_XmlNode * | m_parent |
Fl_XmlNode_List | m_child_nodes |
Friends | |
class | Fl_XmlParser |
class | Fl_XmlDoc |
Definition at line 67 of file Fl_XmlNode.h.
|
Node type enumeration.
Definition at line 71 of file Fl_XmlNode.h. |
|
Adds the node 'new_child' to the end of the list of children of this node. If the 'new_child' is already in the tree, it is first removed. |
|
Returns the first occurence of child with the given name. Recursive is true, it will search throught children.
|
|
Creates a deepcopy of the node. If deep is true, then the cloning is done recursively which means that all the node's children are deep copied too. If deep is false only the node itself is copied and the copy will have no child nodes. |
|
Returns attribute value for given attribute. If not found, empty string is returned. HTML tags can have empty attributes, for those you should use has_attribute() method.
Definition at line 272 of file Fl_XmlNode.h. References Fl_XmlAttributes::get_attribute(). |
|
Returns true, if given attribute is found.
Definition at line 264 of file Fl_XmlNode.h. References Fl_XmlAttributes::has_attribute(). |
|
Inserts the node 'new_child' before the existing child node 'ref_child'. If 'ref_child' is null, insert 'new_child' at the end of the list of children. If the 'new_child' is already in the tree, it is first removed. Returns the node being inserted. |
|
Returns the node name. The meaning of the value depends on the node type:
Definition at line 133 of file Fl_XmlNode.h. |
|
Returns list of all subnodes with give name.
|
|
Returns parent node of this node. For Fl_XmlDocument this returns NULL. Definition at line 94 of file Fl_XmlNode.h. |
|
Removes the child node indicated by 'old_child' from the list of children, and returns it.
|
|
Replaces the child node 'old_child' with 'new_child' in the list of children, and returns the 'old_child' node. If the 'new_child' is already in the tree, it is first removed. |
|
Saves node to buffer.
|
|
Set new value to attribute 'attr'. If attribute is not found, it's added to map.
Definition at line 288 of file Fl_XmlNode.h. References Fl_XmlAttributes::set_attribute(). |
|
Set new value to attribute 'attr'. If attribute is not found, it's added to map.
Definition at line 280 of file Fl_XmlNode.h. References Fl_XmlAttributes::set_attribute(). |
|
Returns cdatas combined from children. e.g. "Some <tag>text</tag> here" becomes: "Some text here"
|
|
Set new value to node.
Definition at line 165 of file Fl_XmlNode.h. |
|
Set new value to node.
Definition at line 158 of file Fl_XmlNode.h. |
|
Returns the value of the node. The meaning of the value depends on the node type:
Definition at line 151 of file Fl_XmlNode.h. |