1#ifndef LINE_NUMBER_STREAM_DEFINED
2#define LINE_NUMBER_STREAM_DEFINED
18 std::string
const &source_,
19 int const tabWidth_ = 2)
38 int character(
stream->get());
Wrapper for an input stream providing tracking of the current line and the current column during stre...
Definition LineNumberStream.hpp:11
int column
Definition LineNumberStream.hpp:68
std::string getSource()
Returns the source name of the underlying stream, usually its file name.
Definition LineNumberStream.hpp:57
int line
Definition LineNumberStream.hpp:68
~LineNumberStream()
Destroys this stream and delete the underlying stream.
Definition LineNumberStream.hpp:28
int getLine()
Returns the line of the next character to be read.
Definition LineNumberStream.hpp:61
int getColumn()
Returns the column of the next character to be read.
Definition LineNumberStream.hpp:65
int peek()
Peeks one character from the underlying stream.
Definition LineNumberStream.hpp:32
std::string source
Definition LineNumberStream.hpp:70
std::istream * getStream()
Returns the underlying std::istream.
Definition LineNumberStream.hpp:52
LineNumberStream(std::istream *stream_, std::string const &source_, int const tabWidth_=2)
Creates a wrapper for the given stream. The wrapper takes ownership of the given pointer.
Definition LineNumberStream.hpp:17
int get()
Reads and returns one character from the underlying stream while keeping track of the line and column...
Definition LineNumberStream.hpp:37
int tabWidth
Definition LineNumberStream.hpp:68
std::istream * stream
Definition LineNumberStream.hpp:69
Definition Algorithm.hpp:10