30 #ifndef __CLAW_BUFFERED_ISTREAM_HPP__
31 #define __CLAW_BUFFERED_ISTREAM_HPP__
41 template<
typename Stream >
46 typedef Stream stream_type;
57 bool read(
char* buf,
unsigned int n );
59 void move(
unsigned int n );
63 operator bool()
const;
67 stream_type& m_stream;
80 unsigned int m_buffer_size;
87 #endif // __CLAW_BUFFERED_ISTREAM_HPP__
unsigned int remaining() const
Tell how many bytes are ready in the buffer.
char get_next()
Get the next value in the buffer and move one byte forward.
~buffered_istream()
Destructor.
buffered_istream(stream_type &f)
Constructor.
This class is made to help reading istreams with a buffer.
void close()
Closes this buffer (not the stream).
const char * get_buffer() const
Get the input buffer.
Implementation of the claw::buffered_istream class.
void move(unsigned int n)
Move some bytes forward.
bool read(char *buf, unsigned int n)
Read a range of data.
bool read_more(unsigned int n)
Increase the number of ready bytes to a given number.