Panda3D
|
A bi-directional stream object that reads and writes data to an internal buffer, which can be retrieved and/or set as a string. More...
#include "stringStream.h"
Public Member Functions | |
StringStream (const string &source) | |
This version of the constructor preloads the buffer with the indicated data. | |
void | clear_data () |
Empties the buffer. | |
string | get_data () |
Returns the contents of the data stream as a string. | |
size_t | get_data_size () |
Returns the number of characters available to be read from the data stream. | |
void | set_data (const string &data) |
Replaces the contents of the data stream. | |
void | swap_data (pvector< unsigned char > &data) |
Swaps the indicated buffer for the contents of the internal buffer. |
A bi-directional stream object that reads and writes data to an internal buffer, which can be retrieved and/or set as a string.
Definition at line 27 of file stringStream.h.
StringStream::StringStream | ( | const string & | source | ) | [inline] |
This version of the constructor preloads the buffer with the indicated data.
Definition at line 32 of file stringStream.I.
References set_data().
void StringStream::clear_data | ( | ) | [inline] |
Empties the buffer.
Definition at line 42 of file stringStream.I.
References StringStreamBuf::clear().
string StringStream::get_data | ( | ) | [inline] |
Returns the contents of the data stream as a string.
Definition at line 64 of file stringStream.I.
References StringStreamBuf::get_data().
size_t StringStream::get_data_size | ( | ) | [inline] |
Returns the number of characters available to be read from the data stream.
Definition at line 53 of file stringStream.I.
References StringStreamBuf::get_data().
void StringStream::set_data | ( | const string & | data | ) | [inline] |
Replaces the contents of the data stream.
This implicitly reseeks to 0.
Definition at line 80 of file stringStream.I.
References StringStreamBuf::clear(), and StringStreamBuf::swap_data().
Referenced by StringStream().
void StringStream::swap_data | ( | pvector< unsigned char > & | data | ) | [inline] |
Swaps the indicated buffer for the contents of the internal buffer.
Definition at line 96 of file stringStream.I.
References StringStreamBuf::swap_data().