Panda3D
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Friends | List of all members
StringStream Class Reference

A bi-directional stream object that reads and writes data to an internal buffer, which can be retrieved and/or set as a string in Python 2 or a bytes object in Python 3. More...

#include "stringStream.h"

Inheritance diagram for StringStream:

Public Member Functions

 StringStream (const std::string &source)
 This version of the constructor preloads the buffer with the indicated data.
 
void clear_data ()
 Empties the buffer.
 
std::string get_data ()
 
size_t get_data_size ()
 Returns the number of characters available to be read from the data stream.
 
void set_data (const std::string &data)
 
void set_data (const unsigned char *data, size_t size)
 
void swap_data (vector_uchar &data)
 Swaps the indicated buffer for the contents of the internal buffer.
 

Public Attributes

 get_data
 Returns the contents of the data stream as a string.
 
 set_data
 Replaces the contents of the data stream.
 

Friends

class Extension< StringStream >
 

Detailed Description

A bi-directional stream object that reads and writes data to an internal buffer, which can be retrieved and/or set as a string in Python 2 or a bytes object in Python 3.

Definition at line 27 of file stringStream.h.

Constructor & Destructor Documentation

◆ StringStream() [1/2]

StringStream::StringStream ( const std::string & source)
inline

This version of the constructor preloads the buffer with the indicated data.

Definition at line 25 of file stringStream.I.

References set_data.

◆ StringStream() [2/2]

StringStream::StringStream ( )
inline

Definition at line 17 of file stringStream.I.

Member Function Documentation

◆ clear_data()

void StringStream::clear_data ( )
inline

Empties the buffer.

Definition at line 33 of file stringStream.I.

References StringStreamBuf::clear().

◆ get_data_size()

size_t StringStream::get_data_size ( )
inline

Returns the number of characters available to be read from the data stream.

Definition at line 41 of file stringStream.I.

References StringStreamBuf::get_data().

◆ swap_data()

void StringStream::swap_data ( vector_uchar & data)
inline

Swaps the indicated buffer for the contents of the internal buffer.

Definition at line 74 of file stringStream.I.

References StringStreamBuf::swap_data().

Friends And Related Symbol Documentation

◆ Extension< StringStream >

friend class Extension< StringStream >
friend

Definition at line 57 of file stringStream.h.

Member Data Documentation

◆ get_data

std::string StringStream::get_data
inline

Returns the contents of the data stream as a string.

Definition at line 45 of file stringStream.h.

◆ set_data

void StringStream::set_data
inline

Replaces the contents of the data stream.

This implicitly reseeks to 0.

Definition at line 45 of file stringStream.h.

Referenced by StringStream().


The documentation for this class was generated from the following files: