Panda3D
Public Types | Public Member Functions

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 ios_base ios_base

List of all members.

Public Types

enum  openmode
enum  openmode
enum  seekdir { beg = 0, cur = 1, end = 2 }
enum  seekdir { beg = 0, cur = 1, end = 2 }

Public Member Functions

 StringStream ()
 StringStream (string source)
 This version of the constructor preloads the buffer with the indicated data.
bool bad ()
bool bad ()
 clear ()
 clear ()
 clearData ()
 Empties the buffer.
bool eof ()
bool eof ()
bool fail ()
bool fail ()
 flush ()
int get ()
string getData ()
 Returns the contents of the data stream as a string.
unsigned int getDataSize ()
 Returns the number of characters available to be read from the data stream.
bool good ()
bool good ()
 put (char c)
 seekg (long int off, seekdir dir)
 seekg (unsigned long int pos)
 seekp (unsigned long int pos)
 seekp (long int off, seekdir dir)
 setData (string data)
 Replaces the contents of the data stream.
 swapData (vectorunsigned char data)
 Swaps the indicated buffer for the contents of the internal buffer.
unsigned long int tellg ()
unsigned long int tellp ()

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 Enumeration Documentation

enum openmode [inherited]
enum openmode [inherited]
enum seekdir [inherited]
Enumerator:
beg 
cur 
end 
enum seekdir [inherited]
Enumerator:
beg 
cur 
end 

Constructor & Destructor Documentation

StringStream ( string  source)

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


Member Function Documentation

bool bad ( ) [inherited]
bool bad ( ) [inherited]
clear ( ) [inherited]
clear ( ) [inherited]
clearData ( )

Empties the buffer.

bool eof ( ) [inherited]
bool eof ( ) [inherited]
bool fail ( ) [inherited]
bool fail ( ) [inherited]
flush ( ) [inherited]

Reimplemented from ostream.

Reimplemented in SocketStream.

int get ( ) [inherited]
string getData ( )

Returns the contents of the data stream as a string.

unsigned int getDataSize ( )

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

bool good ( ) [inherited]
bool good ( ) [inherited]
put ( char  c) [inherited]
seekg ( long int  off,
seekdir  dir 
) [inherited]
seekg ( unsigned long int  pos) [inherited]
seekp ( long int  off,
seekdir  dir 
) [inherited]
seekp ( unsigned long int  pos) [inherited]
setData ( string  data)

Replaces the contents of the data stream.

This implicitly reseeks to 0.

swapData ( vectorunsigned char  data)

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

unsigned long int tellg ( ) [inherited]
unsigned long int tellp ( ) [inherited]
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties