summaryrefslogtreecommitdiff
path: root/src/lib/SW602StreamIterator.h
blob: 7ad39f1a61148b8c53f0784ed1dbf2528e48cc6e (plain)
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
39
40
41
42
43
44
45
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
 * This file is part of the libsw602 project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

#ifndef INCLUDED_SW602_STREAMITERATOR_H
#define INCLUDED_SW602_STREAMITERATOR_H

#include <boost/iterator/iterator_facade.hpp>

#include <librevenge-stream/librevenge-stream.h>

namespace libsw602
{

class SW602StreamIterator : public boost::iterator_facade<SW602StreamIterator, const char, boost::forward_traversal_tag>
{
  friend class boost::iterator_core_access;

public:
  SW602StreamIterator();
  explicit SW602StreamIterator(librevenge::RVNGInputStream &input);

private:
  reference dereference() const;
  bool equal(const SW602StreamIterator &other) const;
  void increment();

  void read();

private:
  librevenge::RVNGInputStream *m_input;
  long m_pos;
  char m_current;
};

}

#endif

/* vim:set shiftwidth=2 softtabstop=2 expandtab: */