summaryrefslogtreecommitdiff
path: root/src/domhelpers.h
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2004-07-24 22:32:14 +0000
committerStef Walter <stef@memberwebs.com>2004-07-24 22:32:14 +0000
commita70bc0519f2705257efca1c8a714a44c941534fb (patch)
treef43dd57982917760b8d12534e5a3c9520da8f024 /src/domhelpers.h
parent07e7c437647e45b6f06b30a8dc02b663fd6a782c (diff)
- Bug fixes to new fixup scheme
Diffstat (limited to 'src/domhelpers.h')
-rw-r--r--src/domhelpers.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/domhelpers.h b/src/domhelpers.h
index d125f80..fd386f8 100644
--- a/src/domhelpers.h
+++ b/src/domhelpers.h
@@ -113,11 +113,11 @@ class ElementIterator
{
public:
ElementIterator()
- { m_current = NULL; }
+ { m_flags = AFTER_LAST; }
ElementIterator(const DOM::Element& top)
- { m_top = top; m_current = top; next(); }
+ { m_top = top; m_flags = BEFORE_FIRST; next(); }
ElementIterator(const ElementIterator& x)
- { m_top = x.m_top; m_current = x.m_current; }
+ { m_top = x.m_top; m_current = x.m_current; m_flags = x.m_flags; }
const DOM::Element& operator*() const
{ return m_current; }
@@ -144,14 +144,21 @@ protected:
// Data
protected:
+ enum
+ {
+ ITERATING,
+ BEFORE_FIRST,
+ AFTER_LAST
+ };
+
DOM::Element m_top;
DOM::Element m_current;
- bool m_done;
+ int m_flags;
};
// friend functions
inline bool operator==(const ElementIterator& x, const ElementIterator& y)
- { return y.m_current == x.m_current && y.m_top == x.m_top; }
+ { return y.m_current == x.m_current && y.m_flags == x.m_flags; }
inline bool operator!=(const ElementIterator& x, const ElementIterator& y)
{ return (!(x == y)); }