Panda3D
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. More...
 
void clear_data ()
 Empties the buffer. More...
 
std::string get_data ()
 
size_t get_data_size ()
 Returns the number of characters available to be read from the data stream. More...
 
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. More...
 

Public Attributes

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

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()

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

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

Definition at line 26 of file stringStream.I.

References set_data.

Member Function Documentation

◆ clear_data()

void StringStream::clear_data ( )
inline

Empties the buffer.

Definition at line 34 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 42 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 75 of file stringStream.I.

Member Data Documentation

◆ get_data

std::string StringStream::get_data
inline

Returns the contents of the data stream as a string.

Definition at line 42 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 42 of file stringStream.h.

Referenced by StringStream().


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