22 StringStream() : iostream(&_buf) {
32 StringStream(
const string &source) : iostream(&_buf) {
68 return string((
char *)&data[0], data.size());
84 pv.insert(pv.end(), (
const unsigned char *)&data[0], (
const unsigned char *)&data[0] + data.size());
void clear()
Empties the buffer.
void swap_data(pvector< unsigned char > &data)
Swaps the indicated buffer for the contents of the internal buffer.
void set_data(const string &data)
Replaces the contents of the data stream.
void clear_data()
Empties the buffer.
string get_data()
Returns the contents of the data stream as a string.
const pvector< unsigned char > & get_data() const
Returns a reference to the contents of the internal buffer, without any of the iostream buffer...
size_t get_data_size()
Returns the number of characters available to be read from the data stream.
void swap_data(pvector< unsigned char > &data)
Swaps the indicated buffer for the contents of the internal buffer.