Panda3D
Public Member Functions | 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. More...

Inheritance diagram for StringStream:
Iostream Istream Ostream Ios Ios IosBase IosBase

Public Member Functions

 __init__ ()
 
 __init__ (str source)
 This version of the constructor preloads the buffer with the indicated data. More...
 
 clearData ()
 Empties the buffer. More...
 
str getData ()
 Returns the contents of the data stream as a string. More...
 
size_t getDataSize ()
 Returns the number of characters available to be read from the data stream. More...
 
 setData (str data)
 Replaces the contents of the data stream. This implicitly reseeks to 0. More...
 
 swapData (VectorUnsignedChar data)
 Swaps the indicated buffer for the contents of the internal buffer. More...
 
- Public Member Functions inherited from Iostream
 flush ()
 
- Public Member Functions inherited from Istream
int get ()
 
 seekg (Ios::Streamoff off, IosBase::Seekdir dir)
 
 seekg (Ios::Streampos pos)
 
Ios::Streampos tellg ()
 
- Public Member Functions inherited from Ios
bool bad ()
 
 clear ()
 
bool eof ()
 
bool fail ()
 
bool good ()
 
- Public Member Functions inherited from Ostream
 flush ()
 
 put (char c)
 
 seekp (Ios::Streamoff off, IosBase::Seekdir dir)
 
 seekp (Ios::Streampos pos)
 
Ios::Streampos tellp ()
 

Additional Inherited Members

- Public Types inherited from IosBase
enum  Openmode
 
enum  Seekdir { beg = 0, cur = 1, end = 2 }
 

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.

Member Function Documentation

◆ __init__() [1/2]

__init__ ( )

◆ __init__() [2/2]

__init__ ( str  source)

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

◆ clearData()

clearData ( )

Empties the buffer.

◆ getData()

str getData ( )

Returns the contents of the data stream as a string.

◆ getDataSize()

size_t getDataSize ( )

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

◆ setData()

setData ( str  data)

Replaces the contents of the data stream. This implicitly reseeks to 0.

◆ swapData()

swapData ( VectorUnsignedChar  data)

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