Panda3D
Public Member Functions

StreamReader Class Reference

A class to read sequential binary data directly from an istream. More...

List of all members.

Public Member Functions

 StreamReader (StreamReader const copy)
 The copy constructor does not copy ownership of the stream.
 StreamReader (istream in, bool owns_stream)
 If owns_stream is true, the stream pointer will be deleted when the StreamReader destructs.
string extractBytes (unsigned int size)
float getBeFloat32 ()
 Extracts a 32-bit single-precision big-endian floating-point number.
double getBeFloat64 ()
 Extracts a 64-bit big-endian floating-point number.
short int getBeInt16 ()
 Extracts a signed big-endian 16-bit integer.
int getBeInt32 ()
 Extracts a signed big-endian 32-bit integer.
long int getBeInt64 ()
 Extracts a signed big-endian 64-bit integer.
unsigned short int getBeUint16 ()
 Extracts an unsigned big-endian 16-bit integer.
unsigned int getBeUint32 ()
 Extracts an unsigned big-endian 32-bit integer.
unsigned long int getBeUint64 ()
 Extracts an unsigned big-endian 64-bit integer.
bool getBool ()
 Extracts a boolean value.
string getFixedString (unsigned int size)
float getFloat32 ()
 Extracts a 32-bit single-precision floating-point number.
double getFloat64 ()
 Extracts a 64-bit floating-point number.
short int getInt16 ()
 Extracts a signed 16-bit integer.
int getInt32 ()
 Extracts a signed 32-bit integer.
long int getInt64 ()
 Extracts a signed 64-bit integer.
signed char getInt8 ()
 Extracts a signed 8-bit integer.
istream getIstream ()
 Returns the stream in use.
string getString ()
string getString32 ()
unsigned short int getUint16 ()
 Extracts an unsigned 16-bit integer.
unsigned int getUint32 ()
 Extracts an unsigned 32-bit integer.
unsigned long int getUint64 ()
 Extracts an unsigned 64-bit integer.
unsigned char getUint8 ()
 Extracts an unsigned 8-bit integer.
string getZString ()
StreamReader operator= (StreamReader const copy)
 The copy constructor does not copy ownership of the stream.
string readline ()
 skipBytes (unsigned int size)

Detailed Description

A class to read sequential binary data directly from an istream.

Its interface is similar to DatagramIterator by design; see also StreamWriter.


Constructor & Destructor Documentation

StreamReader ( StreamReader const  copy)

The copy constructor does not copy ownership of the stream.

StreamReader ( istream  in,
bool  owns_stream 
)

If owns_stream is true, the stream pointer will be deleted when the StreamReader destructs.


Member Function Documentation

string extractBytes ( unsigned int  size)
float getBeFloat32 ( )

Extracts a 32-bit single-precision big-endian floating-point number.

Since this kind of float is not necessarily portable across different architectures, special care is required.

double getBeFloat64 ( )

Extracts a 64-bit big-endian floating-point number.

short int getBeInt16 ( )

Extracts a signed big-endian 16-bit integer.

int getBeInt32 ( )

Extracts a signed big-endian 32-bit integer.

long int getBeInt64 ( )

Extracts a signed big-endian 64-bit integer.

unsigned short int getBeUint16 ( )

Extracts an unsigned big-endian 16-bit integer.

unsigned int getBeUint32 ( )

Extracts an unsigned big-endian 32-bit integer.

unsigned long int getBeUint64 ( )

Extracts an unsigned big-endian 64-bit integer.

bool getBool ( )

Extracts a boolean value.

string getFixedString ( unsigned int  size)
float getFloat32 ( )

Extracts a 32-bit single-precision floating-point number.

Since this kind of float is not necessarily portable across different architectures, special care is required.

double getFloat64 ( )

Extracts a 64-bit floating-point number.

short int getInt16 ( )

Extracts a signed 16-bit integer.

int getInt32 ( )

Extracts a signed 32-bit integer.

long int getInt64 ( )

Extracts a signed 64-bit integer.

signed char getInt8 ( )

Extracts a signed 8-bit integer.

istream getIstream ( )

Returns the stream in use.

string getString ( )
string getString32 ( )
unsigned short int getUint16 ( )

Extracts an unsigned 16-bit integer.

unsigned int getUint32 ( )

Extracts an unsigned 32-bit integer.

unsigned long int getUint64 ( )

Extracts an unsigned 64-bit integer.

unsigned char getUint8 ( )

Extracts an unsigned 8-bit integer.

string getZString ( )
StreamReader operator= ( StreamReader const  copy)

The copy constructor does not copy ownership of the stream.

string readline ( )
skipBytes ( unsigned int  size)
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties