1
// =======================================================================
3
// Filename: citerator.hpp
8
// Created: 25.03.2010 21:46:26
12
// Author: Dominik 'domachine' Burgdörfer (-), dominik.burgdoerfer@googlemail.com
15
// =======================================================================
24
// #define DBG(msg) std::cerr << __FILE__ << ":"
25
// << __LINE__ << ": "
26
// << msg << std::endl;
34
* @brief This class provides an interface
35
* to read files and having access to the previous
36
* read and the following character.
41
* @brief Constructs default CIterator.
46
* @brief Constructs a CIterator that operates on <i>stream</i>
48
CIterator(std::istream& stream);
51
* @brief Move the file pointer forward.
53
CIterator& moveForward();
56
* @brief Returns the current char in the
57
* middle of the buffer.
62
* @brief Returns the char which will be
63
* the next under the file pointer.
68
* @brief Returns the char before the
74
* @brief Delegates the good() method
75
* of the underlaying std::istream.
80
* @brief Delegates the eof() method
81
* of the underlaying std::istream.
86
* @brief Returns the current position
87
* of the file pointer.
89
long position() const;
92
* @brief Rewinds the underlaying std::istream.
97
* @brief Sets the underlaying stream.
99
void setStream(std::istream& stream);
102
* @brief Returns the underlaying stream
104
std::istream& stream();
108
void updateCache(char ch);
111
std::istream* mStream;
118
#endif // ----- #ifndef CITERATOR_INC -----