]> git.decadent.org.uk Git - videolink.git/blob - childiterator.hpp
Added --help option and arranged to print usage information when this is used and...
[videolink.git] / childiterator.hpp
1 // Copyright 2005 Ben Hutchings <ben@decadentplace.org.uk>.
2 // See the file "COPYING" for licence details.
3
4 #ifndef INC_CHILDITERATOR_HPP
5 #define INC_CHILDITERATOR_HPP
6
7 #include <iterator>
8
9 #include <nsCOMPtr.h>
10 #include <nsIDOMNode.h>
11
12 class ChildIterator
13     : public std::iterator<std::input_iterator_tag, nsCOMPtr<nsIDOMNode>,
14                            void, void, void>
15 {
16 public:
17     ChildIterator();
18     explicit ChildIterator(nsIDOMNode * node);
19     ~ChildIterator();
20
21     already_AddRefed<nsIDOMNode> operator*() const;
22     ChildIterator & operator++();
23     bool operator==(const ChildIterator &) const;
24     bool operator!=(const ChildIterator & other) const
25         {
26             return !(*this == other);
27         }
28
29 private:
30     nsIDOMNode * node_;
31 };
32
33 #endif // !INC_CHILDITERATOR_HPP