summaryrefslogtreecommitdiff
path: root/src/pugixml.hpp
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-07-06 20:44:54 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-07-06 20:44:54 +0000
commitaac7a252bfcecc30edf374dc51ca54c8be7a9159 (patch)
tree6ebc16945a5b9fa2e363db0ebef5b1e7a5d8ea2f /src/pugixml.hpp
parent0128d31fb5200985c0d7cf890c6c47b8ff83522d (diff)
Iterator fixes: added assertions, fixed past-the-end iterator behavior wrt to iterator invalidation and comparisons
git-svn-id: http://pugixml.googlecode.com/svn/trunk@566 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'src/pugixml.hpp')
-rw-r--r--src/pugixml.hpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/pugixml.hpp b/src/pugixml.hpp
index a1254b6..00a273a 100644
--- a/src/pugixml.hpp
+++ b/src/pugixml.hpp
@@ -775,6 +775,7 @@ namespace pugi
*/
class PUGIXML_CLASS xml_node
{
+ friend class xml_attribute_iterator;
friend class xml_node_iterator;
protected:
@@ -1525,14 +1526,11 @@ namespace pugi
friend class xml_node;
private:
- xml_node _prev;
xml_node _wrap;
+ xml_node _parent;
/// \internal Initializing constructor
- explicit xml_node_iterator(xml_node_struct* ref);
-
- /// \internal Initializing constructor (for past-the-end)
- xml_node_iterator(xml_node_struct* ref, xml_node_struct* prev);
+ xml_node_iterator(xml_node_struct* ref, xml_node_struct* parent);
public:
/**
@@ -1627,14 +1625,11 @@ namespace pugi
friend class xml_node;
private:
- xml_attribute _prev;
xml_attribute _wrap;
+ xml_node _parent;
/// \internal Initializing constructor
- explicit xml_attribute_iterator(xml_attribute_struct* ref);
-
- /// \internal Initializing constructor (for past-the-end)
- xml_attribute_iterator(xml_attribute_struct* ref, xml_attribute_struct* prev);
+ xml_attribute_iterator(xml_attribute_struct* ref, xml_node_struct* parent);
public:
/**
@@ -1657,9 +1652,10 @@ namespace pugi
/**
* Initializing constructor
*
- * \param node - node that iterator will point at
+ * \param attr - attribute that iterator will point at
+ * \param parent - parent node of the attribute
*/
- xml_attribute_iterator(const xml_attribute& node);
+ xml_attribute_iterator(const xml_attribute& attr, const xml_node& parent);
/**
* Check if this iterator is equal to \a rhs