Used by StringStream to implement an stream that reads from and/or writes to a memory buffer, whose contents can be appended to or extracted at any time by application code. More...
#include "stringStreamBuf.h"
Public Member Functions | |
void | clear () |
Empties the buffer. More... | |
const pvector< unsigned char > & | get_data () const |
Returns a reference to the contents of the internal buffer, without any of the iostream buffer. More... | |
size_t | read_chars (char *start, size_t length) |
Attempts to extract the indicated number of characters from the current file position. More... | |
void | swap_data (pvector< unsigned char > &data) |
Swaps the indicated buffer for the contents of the internal buffer. More... | |
void | write_chars (const char *start, size_t length) |
Appends the indicated stream of characters to the current file position. More... | |
Used by StringStream to implement an stream that reads from and/or writes to a memory buffer, whose contents can be appended to or extracted at any time by application code.
Definition at line 28 of file stringStreamBuf.h.
void StringStreamBuf::clear | ( | ) |
Empties the buffer.
Definition at line 66 of file stringStreamBuf.cxx.
Referenced by StringStream::clear_data(), and StringStream::set_data().
|
inline |
Returns a reference to the contents of the internal buffer, without any of the iostream buffer.
Definition at line 35 of file stringStreamBuf.I.
Referenced by StringStream::get_data(), and StringStream::get_data_size().
size_t StringStreamBuf::read_chars | ( | char * | start, |
size_t | length | ||
) |
Attempts to extract the indicated number of characters from the current file position.
Returns the number of characters extracted.
Definition at line 83 of file stringStreamBuf.cxx.
|
inline |
Swaps the indicated buffer for the contents of the internal buffer.
Does not affect the ppos or gpos, or the iostream buffer.
Definition at line 24 of file stringStreamBuf.I.
Referenced by StringStream::set_data(), and StringStream::swap_data().
void StringStreamBuf::write_chars | ( | const char * | start, |
size_t | length | ||
) |
Appends the indicated stream of characters to the current file position.
Definition at line 108 of file stringStreamBuf.cxx.