A fixed sized collection of nodes that an XPathQuery can work on. More...
#include <xpathnodeset.h>
Public Types | |
enum | CollectionType { TypeUnsorted, TypeSorted, TypeSortedReverse } |
The different ways a collection may or may not be ordered. More... | |
typedef const XPathNode * | const_iterator |
An iterator trait. Const iterator for XPathNodes. | |
Public Member Functions | |
XPathNodeSet () | |
Default constructor. Constructs empty set. | |
XPathNodeSet (const_iterator begin, const_iterator end, CollectionType Type=TypeUnsorted) | |
Constructs a set from iterator range. More... | |
XPathNodeSet (const XPathNodeSet &ns) | |
Copy constructor/assignment operator. More... | |
~XPathNodeSet () | |
Destructor. | |
const_iterator | begin () const |
Get Beginning iterator. More... | |
bool | Empty () const |
Check if collection is empty. More... | |
const_iterator | end () const |
Get Ending iterator. More... | |
XPathNode | first () const |
Get first node in the collection by document order. More... | |
XPathNodeSet & | operator= (const XPathNodeSet &ns) |
Assignment Operator. More... | |
const XPathNode & | operator[] (size_t index) const |
Indexing operator. More... | |
size_t | size () const |
Get collection size. More... | |
void | sort (bool reverse=false) |
Sort the collection in ascending/descending order by document order. More... | |
CollectionType | Type () const |
Get collection Type. More... | |
A fixed sized collection of nodes that an XPathQuery can work on.
Definition at line 72 of file xpathnodeset.h.
The different ways a collection may or may not be ordered.
Enumerator | |
---|---|
TypeUnsorted |
Not ordered. |
TypeSorted |
Sorted by document order (ascending) |
TypeSortedReverse |
Sorted by document order (descending) |
Definition at line 76 of file xpathnodeset.h.
Mezzanine::XML::XPathNodeSet::XPathNodeSet | ( | const_iterator | begin, |
const_iterator | end, | ||
CollectionType | Type = TypeUnsorted |
||
) |
Constructs a set from iterator range.
begin | A const XPathNode iterator at the beginning of the set of nodes. |
end | A const XPathNode iterator at the end of the set of nodes. |
Type | What XPathNodeSet::CollectionType is being used, this defaults to XPathNodeSet::TypeUnsorted |
Data is not checked for duplicates and is not sorted according to provided Type, so be careful.
Mezzanine::XML::XPathNodeSet::XPathNodeSet | ( | const XPathNodeSet & | ns) |
Copy constructor/assignment operator.
ns | The Target to copy. |
const_iterator Mezzanine::XML::XPathNodeSet::begin | ( | ) | const |
Get Beginning iterator.
bool Mezzanine::XML::XPathNodeSet::Empty | ( | ) | const |
Check if collection is empty.
const_iterator Mezzanine::XML::XPathNodeSet::end | ( | ) | const |
Get Ending iterator.
XPathNode Mezzanine::XML::XPathNodeSet::first | ( | ) | const |
Get first node in the collection by document order.
XPathNodeSet& Mezzanine::XML::XPathNodeSet::operator= | ( | const XPathNodeSet & | ns) |
Assignment Operator.
ns | The XPathNodeSet to copy. |
const XPathNode& Mezzanine::XML::XPathNodeSet::operator[] | ( | size_t | index) | const |
Indexing operator.
index | A size_t indicating which XPathNode you would like to retrieve |
size_t Mezzanine::XML::XPathNodeSet::size | ( | ) | const |
Get collection size.
void Mezzanine::XML::XPathNodeSet::sort | ( | bool | reverse = false ) |
Sort the collection in ascending/descending order by document order.
reverse | If true this sorts the collection in the opposite of document order. |
CollectionType Mezzanine::XML::XPathNodeSet::Type | ( | ) | const |
Get collection Type.