~ubuntu-branches/ubuntu/feisty/videolink/feisty

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2005 Ben Hutchings <ben@decadent.org.uk>.
// See the file "COPYING" for licence details.

#ifndef INC_CHILD_ITERATOR_HPP
#define INC_CHILD_ITERATOR_HPP

#include <iterator>

#include <nsCOMPtr.h>
#include <nsIDOMNode.h>

class child_iterator
    : public std::iterator<std::input_iterator_tag, nsCOMPtr<nsIDOMNode>,
			   void, void, void>
{
public:
    child_iterator();
    explicit child_iterator(nsIDOMNode * node);
    ~child_iterator();

    already_AddRefed<nsIDOMNode> operator*() const;
    child_iterator & operator++();
    bool operator==(const child_iterator &) const;
    bool operator!=(const child_iterator & other) const
	{
	    return !(*this == other);
	}

private:
    nsIDOMNode * node_;
};

#endif // !INC_CHILD_ITERATOR_HPP