pugi::xpath_node_set Class Reference

Collaboration diagram for pugi::xpath_node_set:

Collaboration graph
[legend]
List of all members.

Detailed Description

Not necessarily ordered constant collection of XPath nodes.


Public Types

typedef const xpath_nodeconst_iterator
 Constant iterator type.
enum  type_t { type_unsorted, type_sorted, type_sorted_reverse }
 Collection type. More...

Public Member Functions

 xpath_node_set ()
 Default ctor Constructs empty set.
 ~xpath_node_set ()
 Dtor.
 xpath_node_set (const xpath_node_set &ns)
 Copy ctor.
xpath_node_setoperator= (const xpath_node_set &ns)
 Assignment operator.
type_t type () const
 Get collection type.
size_t size () const
 Get collection size.
xpath_node operator[] (size_t index) const
 Get element with the specified index.
const_iterator begin () const
 Get begin constant iterator for collection.
const_iterator end () const
 Get end iterator for collection.
void sort (bool reverse=false)
 Sort the collection in ascending/descending order by document order.
xpath_node first () const
 Get first node in the collection by document order.
bool empty () const
 Return true if collection is empty.

Friends

class xpath_ast_node


Member Enumeration Documentation

enum pugi::xpath_node_set::type_t
 

Collection type.

Enumerator:
type_unsorted  Not ordered.
type_sorted  Sorted by document order (ascending).
type_sorted_reverse  Sorted by document order (descending).


Constructor & Destructor Documentation

pugi::xpath_node_set::xpath_node_set const xpath_node_set ns  ) 
 

Copy ctor.

Parameters:
ns - set to copy


Member Function Documentation

xpath_node_set& pugi::xpath_node_set::operator= const xpath_node_set ns  ) 
 

Assignment operator.

Parameters:
ns - set to assign
Returns:
self

type_t pugi::xpath_node_set::type  )  const
 

Get collection type.

Returns:
collection type

size_t pugi::xpath_node_set::size  )  const
 

Get collection size.

Returns:
collection size

xpath_node pugi::xpath_node_set::operator[] size_t  index  )  const
 

Get element with the specified index.

Parameters:
index - requested index
Returns:
element

const_iterator pugi::xpath_node_set::begin  )  const
 

Get begin constant iterator for collection.

Returns:
begin constant iterator

const_iterator pugi::xpath_node_set::end  )  const
 

Get end iterator for collection.

Returns:
end iterator

void pugi::xpath_node_set::sort bool  reverse = false  ) 
 

Sort the collection in ascending/descending order by document order.

Parameters:
reverse - whether to sort in ascending (false) or descending (true) order

xpath_node pugi::xpath_node_set::first  )  const
 

Get first node in the collection by document order.

Returns:
first node by document order
Note:
set.first() is not equal to set[0], since operator[] does not take document order into account

bool pugi::xpath_node_set::empty  )  const
 

Return true if collection is empty.

Returns:
true if collection is empty, false otherwise


Generated on Tue May 25 23:22:42 2010 for pugixml by  doxygen 1.4.6-NO