]> git.decadent.org.uk Git - videolink.git/blob - link_iterator.hpp
Renamed various types to fit lower_case_with_underscores convention.
[videolink.git] / link_iterator.hpp
1 // Copyright 2005 Ben Hutchings <ben@decadentplace.org.uk>.
2 // See the file "COPYING" for licence details.
3
4 #ifndef INC_LINK_ITERATOR_HPP
5 #define INC_LINK_ITERATOR_HPP
6
7 #include <iterator>
8
9 #include <nsCOMPtr.h>
10 #include <nsIDOMHTMLCollection.h>
11 #include <nsIDOMNode.h>
12
13 class nsIDOMDocument;
14
15 class link_iterator
16     : public std::iterator<std::input_iterator_tag, nsCOMPtr<nsIDOMNode>,
17                            void, void, void>
18 {
19 public:
20     link_iterator();
21     explicit link_iterator(nsIDOMDocument * document);
22
23     already_AddRefed<nsIDOMNode> operator*() const;
24     link_iterator & operator++();
25     bool operator==(const link_iterator &) const;
26     bool operator!=(const link_iterator & other) const
27         {
28             return !(*this == other);
29         }
30
31 private:
32     nsCOMPtr<nsIDOMHTMLCollection> collection_;
33     unsigned int index_, length_;
34 };
35
36 #endif // !INC_LINK_ITERATOR_HPP