20 #ifndef BUFFERED_ISTREAM_HPP_INCLUDED
21 #define BUFFERED_ISTREAM_HPP_INCLUDED
158 if(
UNLIKELY(buffer_offset_ >= buffer_size_)) {
165 if(
UNLIKELY(stream_.rdbuf()->sgetc() == EOF)) {
169 buffer_size_ = stream_.readsome(buffer_,
sizeof(buffer_));
unsigned buffer_offset_
The offset of the current character in the buffer.
std::istream & stream_
The input to read from.
void fill_buffer()
Fills the buffer.
int peek()
Gets a character from the buffer.
Helper class for buffering a std::istream.
bool eof() const
Is the end of input reached?
char buffer_[1024]
Buffer to store the data read from std::istream.
buffered_istream(std::istream &in)
unsigned buffer_size_
The size of buffer_.
Templates and utility-routines for strings and numbers.
std::istream & stream()
Returns the owned stream.
bool eof_
Is the end of input reached?