Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

TinyXPath::node_set Class Reference

Node set class. A node set is an unordered collection of node. More...

#include <node_set.h>

List of all members.

Public Member Functions

 node_set ()
 constructor : creates an empty set

 node_set (const node_set &ns2)
 Copy constructor.

 ~node_set ()
 destructor

node_set & operator= (const node_set &ns2)
 Assignation operator. Allows one to write expressions like ns_1 = ns_2;.

void v_add_base_in_set (const TiXmlBase *XBp_member, bool o_attrib)
 Adds a new node in the node set.

void v_add_attrib_in_set (const TiXmlAttribute *XAp_attrib)
 Adds an attribute in the node set.

void v_add_node_in_set (const TiXmlNode *XNp_node)
 Adds a node in the node set.

bool o_exist_in_set (const TiXmlBase *XBp_member)
 Checks if a node exist in the node set.

void v_add_all_foll_node (const TiXmlNode *XNp_node, const TIXML_STRING &S_name)
 Populate the node set with all following nodes.

void v_add_all_prec_node (const TiXmlNode *XNp_node, const TIXML_STRING &S_name)
 Populate the node set with all preceding nodes.

void v_add_node_in_set_if_name_or_star (const TiXmlNode *XNp_node, const TIXML_STRING &S_name)
 Add a new node, if the name is "*" or if the name is the same as the node.

void v_add_attrib_in_set_if_name_or_star (const TiXmlAttribute *XAp_attrib, const TIXML_STRING &S_name)
 Add a new attrib, if the name is "*" or if the name is the same as the node.

unsigned u_get_nb_node_in_set () const
 Get nb of nodes in the node set.

const TiXmlBase * XBp_get_base_in_set (unsigned u_which)
 Get a node or an attribute.

const TiXmlNode * XNp_get_node_in_set (unsigned u_which)
 Get a node.

const TiXmlAttribute * XAp_get_attribute_in_set (unsigned u_which)
 Get an attribute.

bool o_is_attrib (unsigned u_which)
 Check if a node is an attribute or another node.

TIXML_STRING S_get_value (unsigned u_which)
 Get a node value. The value is the name for an element, and the attribute value for an attribute.

int i_get_value (unsigned u_which)
 Get the integer value of a node.

double d_get_value (unsigned u_which)
 Get the real value of a node.

void v_copy_node_children (const TiXmlNode *XNp_root)
 Copy all element children of a node to the node_set.

void 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.

void v_copy_selected_node_recursive (const TiXmlNode *XNp_root)
 Copy all nodes in the tree to the node_set.

void v_copy_selected_node_recursive (const TiXmlNode *XNp_root, const char *cp_lookup)
 Copy all nodes in the tree to the node_set.

void 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.

TIXML_STRING S_get_string_value () const
 Return the string value aka concatenation of all text items.

void v_dump ()
 Debug function to print the content of a node set to stdout.

void v_document_sort ()
 Sort the node set according to the document order.


Protected Attributes

unsigned u_nb_node
 Nb of nodes in the set.

const void ** vpp_node_set
 List of node pointers to the.

bool * op_attrib
 Attributes flag list.


Detailed Description

Node set class. A node set is an unordered collection of node.


Constructor & Destructor Documentation

TinyXPath::node_set::node_set (   )  [inline]
 

constructor : creates an empty set

TinyXPath::node_set::node_set (  const node_set &  ns2  ) 
 

Copy constructor.

TinyXPath::node_set::~node_set (   )  [inline]
 

destructor


Member Function Documentation

double TinyXPath::node_set::d_get_value (  unsigned  u_which  )  [inline]
 

Get the real value of a node.

int TinyXPath::node_set::i_get_value (  unsigned  u_which  )  [inline]
 

Get the integer value of a node.

bool TinyXPath::node_set::o_exist_in_set (  const TiXmlBase *  XBp_member  ) 
 

Checks if a node exist in the node set.

Parameters:
XBp_member  Check if a base exist in the node set

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

node_set & TinyXPath::node_set::operator= (  const node_set &  ns2  ) 
 

Assignation operator. Allows one to write expressions like ns_1 = ns_2;.

TIXML_STRING TinyXPath::node_set::S_get_string_value (   )  const
 

Return the string value aka concatenation of all text items.

TIXML_STRING 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.

unsigned TinyXPath::node_set::u_get_nb_node_in_set (   )  const [inline]
 

Get nb of nodes in the node set.

void TinyXPath::node_set::v_add_all_foll_node (  const TiXmlNode *  XNp_node,
const TIXML_STRING &  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

Parameters:
XNp_node  base node
S_name  lookup name (or "*")

void TinyXPath::node_set::v_add_all_prec_node (  const TiXmlNode *  XNp_node,
const TIXML_STRING &  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

Parameters:
XNp_node  base node
S_name  lookup name (or "*")

void TinyXPath::node_set::v_add_attrib_in_set (  const TiXmlAttribute *  XAp_attrib  )  [inline]
 

Adds an attribute in the node set.

void TinyXPath::node_set::v_add_attrib_in_set_if_name_or_star (  const TiXmlAttribute *  XAp_attrib,
const TIXML_STRING &  S_name
)  [inline]
 

Add a new attrib, if the name is "*" or if the name is the same as the node.

void TinyXPath::node_set::v_add_base_in_set (  const TiXmlBase *  XBp_member,
bool  o_attrib
) 
 

Adds a new node in the node set.

Parameters:
XBp_member  Base to add (node or attribute)
o_attrib  true if the base is an attribute, false if it's a node

void TinyXPath::node_set::v_add_node_in_set (  const TiXmlNode *  XNp_node  )  [inline]
 

Adds a node in the node set.

void TinyXPath::node_set::v_add_node_in_set_if_name_or_star (  const TiXmlNode *  XNp_node,
const TIXML_STRING &  S_name
)  [inline]
 

Add a new node, if the name is "*" or if the name is the same as the 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.

Parameters:
XNp_root  The father of the nodes to be copied
cp_lookup  Lookup name (or NULL)

void TinyXPath::node_set::v_copy_node_children (  const TiXmlNode *  XNp_root  ) 
 

Copy all element children of a node to the node_set.

Parameters:
XNp_root  The father of the nodes to be copied

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.

Parameters:
XNp_root  The node to be copied
cp_lookup  Lookup name (or NULL)

void TinyXPath::node_set::v_copy_selected_node_recursive (  const TiXmlNode *  XNp_root  ) 
 

Copy all nodes in the tree to the node_set.

Parameters:
XNp_root  The node to be copied

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.

Parameters:
XNp_root  Node whole children are to be copied
cp_lookup  Lookup name or NULL

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

void TinyXPath::node_set::v_dump (   ) 
 

Debug function to print the content of a node set to stdout.

const TiXmlAttribute* TinyXPath::node_set::XAp_get_attribute_in_set (  unsigned  u_which  )  [inline]
 

Get an attribute.

const TiXmlBase* TinyXPath::node_set::XBp_get_base_in_set (  unsigned  u_which  )  [inline]
 

Get a node or an attribute.

const TiXmlNode* TinyXPath::node_set::XNp_get_node_in_set (  unsigned  u_which  )  [inline]
 

Get a node.


Member Data Documentation

bool* TinyXPath::node_set::op_attrib [protected]
 

Attributes flag list.

unsigned TinyXPath::node_set::u_nb_node [protected]
 

Nb of nodes in the set.

const void** TinyXPath::node_set::vpp_node_set [protected]
 

List of node pointers to the.


The documentation for this class was generated from the following files:
Generated for TinyXPath by doxygen SourceForge Logo