File: link_iterator.hpp

package info (click to toggle)
videolink 1.2.5-1
  • links: PTS
  • area: contrib
  • in suites: lenny
  • size: 392 kB
  • ctags: 526
  • sloc: cpp: 3,316; ansic: 884; makefile: 127
file content (38 lines) | stat: -rw-r--r-- 907 bytes parent folder | download | duplicates (2)
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
34
35
36
37
38
// Copyright 2005 Ben Hutchings <ben@decadent.org.uk>.
// See the file "COPYING" for licence details.

#ifndef INC_LINK_ITERATOR_HPP
#define INC_LINK_ITERATOR_HPP

#include <iterator>

#include "wchar_t_short.h"
#include <nsCOMPtr.h>
#include <nsIDOMHTMLCollection.h>
#include <nsIDOMNode.h>
#include "wchar_t_default.h"

class nsIDOMDocument;

class link_iterator
    : public std::iterator<std::input_iterator_tag, nsCOMPtr<nsIDOMNode>,
			   void, void, void>
{
public:
    link_iterator();
    explicit link_iterator(nsIDOMDocument * document);

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

private:
    nsCOMPtr<nsIDOMHTMLCollection> collection_;
    unsigned int index_, length_;
};

#endif // !INC_LINK_ITERATOR_HPP