Node set class. A node set is an unordered collection of node. More...
#include <node_set.h>
Node set class. A node set is an unordered collection of node.
TinyXPath::node_set::node_set | ( | ) | [inline] |
constructor : creates an empty set
References op_attrib, u_nb_node, and vpp_node_set.
TinyXPath::node_set::node_set | ( | const node_set & | ns2 | ) |
copy constructor
Copy constructor.
TinyXPath::node_set::~node_set | ( | ) | [inline] |
destructor
References op_attrib, u_nb_node, and vpp_node_set.
Assignation operator. Allows one to write expressions like ns_1 = ns_2;.
References op_attrib, u_nb_node, and vpp_node_set.
void TinyXPath::node_set::v_add_base_in_set | ( | const TiXmlBase * | XBp_member, | |
bool | o_attrib | |||
) |
Adds a new node in the node set.
XBp_member | Base to add (node or attribute) | |
o_attrib | true if the base is an attribute, false if it's a node |
References o_exist_in_set(), op_attrib, u_nb_node, and vpp_node_set.
Referenced by v_add_attrib_in_set(), v_add_attrib_in_set_if_name_or_star(), v_add_node_in_set(), and v_add_node_in_set_if_name_or_star().
void TinyXPath::node_set::v_add_attrib_in_set | ( | const TiXmlAttribute * | XAp_attrib | ) | [inline] |
Adds an attribute in the node set.
References v_add_base_in_set().
Referenced by v_copy_selected_node_recursive().
void TinyXPath::node_set::v_add_node_in_set | ( | const TiXmlNode * | XNp_node | ) | [inline] |
Adds a node in the node set.
References v_add_base_in_set().
Referenced by v_copy_node_children(), v_copy_selected_node_recursive(), and v_copy_selected_node_recursive_no_attrib().
bool TinyXPath::node_set::o_exist_in_set | ( | const TiXmlBase * | XBp_member | ) |
Checks if a node exist in the node set.
XBp_member | Check if a base exist in the node set |
References u_nb_node, and vpp_node_set.
Referenced by v_add_base_in_set().
void TinyXPath::node_set::v_add_all_foll_node | ( | const TiXmlNode * | XNp_node, | |
const TiXmlString & | S_name | |||
) |
Populate the node set with all following nodes.
Exerpt :
the following axis contains all nodes in the same document as the context node that are after the context node in document order, excluding any descendants and excluding attribute nodes and namespace nodes
XNp_node | base node | |
S_name | lookup name (or "*") |
References TiXmlNode::ELEMENT, v_add_node_in_set_if_name_or_star(), and v_copy_node_children().
void TinyXPath::node_set::v_add_all_prec_node | ( | const TiXmlNode * | XNp_node, | |
const TiXmlString & | S_name | |||
) |
Populate the node set with all preceding nodes.
Exerpt :
the preceding axis contains all nodes in the same document as the context node that are before the context node in document order, excluding any ancestors and excluding attribute nodes and namespace nodes
XNp_node | base node | |
S_name | lookup name (or "*") |
References TiXmlNode::ELEMENT, v_add_node_in_set_if_name_or_star(), and v_copy_node_children().
void TinyXPath::node_set::v_add_node_in_set_if_name_or_star | ( | const TiXmlNode * | XNp_node, | |
const TiXmlString & | S_name | |||
) | [inline] |
Add a new node, if the name is "*" or if the name is the same as the node.
References v_add_base_in_set().
Referenced by v_add_all_foll_node(), and v_add_all_prec_node().
void TinyXPath::node_set::v_add_attrib_in_set_if_name_or_star | ( | const TiXmlAttribute * | XAp_attrib, | |
const TiXmlString & | S_name | |||
) | [inline] |
Add a new attrib, if the name is "*" or if the name is the same as the node.
References Name, and v_add_base_in_set().
unsigned TinyXPath::node_set::u_get_nb_node_in_set | ( | ) | const [inline] |
Get nb of nodes in the node set.
References u_nb_node.
Referenced by ReadXmlField(), and TinyXPath::xpath_processor::v_execute_step().
const TiXmlBase* TinyXPath::node_set::XBp_get_base_in_set | ( | unsigned | u_which | ) | [inline] |
Get a node or an attribute.
References u_nb_node, and vpp_node_set.
Referenced by ReadXmlField().
const TiXmlNode* TinyXPath::node_set::XNp_get_node_in_set | ( | unsigned | u_which | ) | [inline] |
Get a node.
References o_is_attrib(), u_nb_node, and vpp_node_set.
Referenced by ReadXmlField(), S_get_value(), and v_dump().
const TiXmlAttribute* TinyXPath::node_set::XAp_get_attribute_in_set | ( | unsigned | u_which | ) | [inline] |
Get an attribute.
References o_is_attrib(), u_nb_node, and vpp_node_set.
Referenced by ReadXmlField(), S_get_value(), and v_dump().
bool TinyXPath::node_set::o_is_attrib | ( | unsigned | u_which | ) | [inline] |
Check if a node is an attribute or another node. This is needed because TinyXML has a weird exception for attributes not being children of TiXmlNode
References op_attrib, and u_nb_node.
Referenced by ReadXmlField(), S_get_value(), XAp_get_attribute_in_set(), and XNp_get_node_in_set().
TiXmlString TinyXPath::node_set::S_get_value | ( | unsigned | u_which | ) | [inline] |
Get a node value. The value is the name for an element, and the attribute value for an attribute.
References o_is_attrib(), TIXML_STRING, XAp_get_attribute_in_set(), and XNp_get_node_in_set().
Referenced by d_get_value(), and i_get_value().
int TinyXPath::node_set::i_get_value | ( | unsigned | u_which | ) | [inline] |
Get the integer value of a node.
References S_get_value().
double TinyXPath::node_set::d_get_value | ( | unsigned | u_which | ) | [inline] |
void TinyXPath::node_set::v_copy_node_children | ( | const TiXmlNode * | XNp_root | ) |
Copy all element children of a node to the node_set.
XNp_root | The father of the nodes to be copied |
Referenced by v_add_all_foll_node(), and v_add_all_prec_node().
void TinyXPath::node_set::v_copy_node_children | ( | const TiXmlNode * | XNp_root, | |
const char * | cp_lookup | |||
) |
Copy all element children of a node to the node_set, if their name matches a given name.
XNp_root | The father of the nodes to be copied | |
cp_lookup | Lookup name (or NULL) |
References v_add_node_in_set().
void TinyXPath::node_set::v_copy_selected_node_recursive | ( | const TiXmlNode * | XNp_root | ) |
Copy all nodes in the tree to the node_set.
XNp_root | The node to be copied |
Referenced by v_copy_selected_node_recursive().
void TinyXPath::node_set::v_copy_selected_node_recursive | ( | const TiXmlNode * | XNp_root, | |
const char * | cp_lookup | |||
) |
Copy all nodes in the tree to the node_set.
XNp_root | The node to be copied | |
cp_lookup | Lookup name (or NULL) |
References TiXmlNode::ELEMENT, v_add_attrib_in_set(), v_add_node_in_set(), and v_copy_selected_node_recursive().
void TinyXPath::node_set::v_copy_selected_node_recursive_no_attrib | ( | const TiXmlNode * | XNp_root, | |
const char * | cp_lookup | |||
) |
Copy all nodes in the tree to the node_set, excluding attributes.
XNp_root | Node whole children are to be copied | |
cp_lookup | Lookup name or NULL |
References v_add_node_in_set().
TiXmlString TinyXPath::node_set::S_get_string_value | ( | ) | const |
Return the string value aka concatenation of all text items.
References op_attrib, TIXML_STRING, u_nb_node, and vpp_node_set.
void TinyXPath::node_set::v_dump | ( | ) |
Debug function to print the content of a node set to stdout.
References Name, op_attrib, u_nb_node, XAp_get_attribute_in_set(), and XNp_get_node_in_set().
void TinyXPath::node_set::v_document_sort | ( | ) |
Sort the node set according to the document order.
The document order must have been recorded already in the tiny xml user's value
There's still a problem with the attributes. They aren't covered by the GetUserData / SetUserData yet. If two attributes come from the same element, we have to compute on the fly their relative position
References TinyXPath::i_compare_ptr_and_flag(), op_attrib, u_nb_node, and vpp_node_set.
unsigned TinyXPath::node_set::u_nb_node [protected] |
Nb of nodes in the set.
Referenced by node_set(), o_exist_in_set(), o_is_attrib(), operator=(), S_get_string_value(), u_get_nb_node_in_set(), v_add_base_in_set(), v_document_sort(), v_dump(), XAp_get_attribute_in_set(), XBp_get_base_in_set(), XNp_get_node_in_set(), and ~node_set().
const void** TinyXPath::node_set::vpp_node_set [protected] |
List of node pointers to the.
Referenced by node_set(), o_exist_in_set(), operator=(), S_get_string_value(), v_add_base_in_set(), v_document_sort(), XAp_get_attribute_in_set(), XBp_get_base_in_set(), XNp_get_node_in_set(), and ~node_set().
bool* TinyXPath::node_set::op_attrib [protected] |
Attributes flag list.
Referenced by node_set(), o_is_attrib(), operator=(), S_get_string_value(), v_add_base_in_set(), v_document_sort(), v_dump(), and ~node_set().