]> git.decadent.org.uk Git - videolink.git/blob - child_iterator.hpp
Added workaround for XULRunner 1.9's requirement of 16-bit wchar_t. Changing the...
[videolink.git] / child_iterator.hpp
1 // Copyright 2005 Ben Hutchings <ben@decadent.org.uk>.
2 // See the file "COPYING" for licence details.
3
4 #ifndef INC_CHILD_ITERATOR_HPP
5 #define INC_CHILD_ITERATOR_HPP
6
7 #include <iterator>
8
9 #include "wchar_t_short.h"
10 #include <nsCOMPtr.h>
11 #include <nsIDOMNode.h>
12 #include "wchar_t_default.h"
13
14 class child_iterator
15     : public std::iterator<std::input_iterator_tag, nsCOMPtr<nsIDOMNode>,
16                            void, void, void>
17 {
18 public:
19     child_iterator();
20     explicit child_iterator(nsIDOMNode * node);
21     ~child_iterator();
22
23     already_AddRefed<nsIDOMNode> operator*() const;
24     child_iterator & operator++();
25     bool operator==(const child_iterator &) const;
26     bool operator!=(const child_iterator & other) const
27         {
28             return !(*this == other);
29         }
30
31 private:
32     nsIDOMNode * node_;
33 };
34
35 #endif // !INC_CHILD_ITERATOR_HPP