33 #ifndef __H__UTIL__BINARY_STREAM__
34 #define __H__UTIL__BINARY_STREAM__
70 void resize(
size_t newSize);
93 virtual int_type
overflow(int_type c = traits_type::eof());
A special version of a std::streambuf, writes data directly into a buffer that is accessible at any t...
Definition: binary_stream.h:58
virtual int_type underflow()
Definition: binary_stream.cpp:131
char_type * buffer()
returns a pointer to the front of the buffer or NULL if the buffer is empty.
Definition: binary_stream.h:76
void write_jump(size_t jumpSize)
advances the write-pointer by jumpSize bytes
Definition: binary_stream.cpp:104
BinaryStreamBuffer()
Definition: binary_stream.cpp:40
size_t get_read_pos() const
returns the read-position
Definition: binary_stream.cpp:114
void resize(size_t newSize)
resizes the data-buffer but does not alter read and write positions.
Definition: binary_stream.cpp:75
void clear()
clears the data and resets the read and write positions.
Definition: binary_stream.cpp:45
char_type * end()
returns pointer to the first entry behind the buffer.
Definition: binary_stream.h:99
const char_type * buffer() const
Definition: binary_stream.h:78
const char_type * end() const
Definition: binary_stream.h:100
std::vector< unsigned char > m_dataBuf
Definition: binary_stream.h:103
virtual int_type overflow(int_type c=traits_type::eof())
Definition: binary_stream.cpp:119
size_t size() const
returns the size of the buffer in bytes.
Definition: binary_stream.cpp:50
void read_jump(size_t jumpSize)
advances the read-pointer by jumpSize bytes
Definition: binary_stream.cpp:109
void reserve(size_t newSize)
Similar to resize, however, doesn't alter the read-area.
Definition: binary_stream.cpp:57
void reset()
set read- and write-positions to the start of the buffer.
Definition: binary_stream.cpp:96
a specialzation of std::iostream, that uses a
Definition: binary_stream.h:109
void * buffer()
Definition: binary_stream.h:123
BinaryStream(size_t newSize)
Definition: binary_stream.h:112
BinaryStream()
Definition: binary_stream.h:111
size_t read_pos() const
Definition: binary_stream.h:135
bool can_read_more()
returns true if there is more data left to read.
Definition: binary_stream.h:142
size_t size() const
Definition: binary_stream.h:126
void write_jump(size_t jumpSize)
Definition: binary_stream.h:129
void read_jump(size_t jumpSize)
Definition: binary_stream.h:132
void resize(size_t newSize)
Definition: binary_stream.h:117
void reset()
Definition: binary_stream.h:120
void clear()
Definition: binary_stream.h:114
BinaryStreamBuffer m_streamBuf
Definition: binary_stream.h:145
T * GetDataPtr(std::vector< T > &v)
Returns a pointer to the array which is managed by the std::vector.
Definition: vector_util.h:51
Definition: smart_pointer.h:814