Panda3D
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties
Public Member Functions | List of all members
StreamReader Class Reference

A class to read sequential binary data directly from an istream. Its interface is similar to DatagramIterator by design; see also StreamWriter. More...

Public Member Functions

 __init__ (const StreamReader copy)
 The copy constructor does not copy ownership of the stream. More...
 
 __init__ (Istream in, bool owns_stream)
 If owns_stream is true, the stream pointer will be deleted when the StreamReader destructs. More...
 
str extractBytes (size_t 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. More...
 
PNFloat64 getBeFloat64 ()
 Extracts a 64-bit big-endian floating-point number. More...
 
PNInt16 getBeInt16 ()
 Extracts a signed big-endian 16-bit integer. More...
 
PNInt32 getBeInt32 ()
 Extracts a signed big-endian 32-bit integer. More...
 
PNInt64 getBeInt64 ()
 Extracts a signed big-endian 64-bit integer. More...
 
PNUint16 getBeUint16 ()
 Extracts an unsigned big-endian 16-bit integer. More...
 
PNUint32 getBeUint32 ()
 Extracts an unsigned big-endian 32-bit integer. More...
 
PNUint64 getBeUint64 ()
 Extracts an unsigned big-endian 64-bit integer. More...
 
bool getBool ()
 Extracts a boolean value. More...
 
str getFixedString (size_t 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. More...
 
PNFloat64 getFloat64 ()
 Extracts a 64-bit floating-point number. More...
 
PNInt16 getInt16 ()
 Extracts a signed 16-bit integer. More...
 
PNInt32 getInt32 ()
 Extracts a signed 32-bit integer. More...
 
PNInt64 getInt64 ()
 Extracts a signed 64-bit integer. More...
 
PNInt8 getInt8 ()
 Extracts a signed 8-bit integer. More...
 
Istream getIstream ()
 Returns the stream in use. More...
 
str getString ()
 
str getString32 ()
 
PNUint16 getUint16 ()
 Extracts an unsigned 16-bit integer. More...
 
PNUint32 getUint32 ()
 Extracts an unsigned 32-bit integer. More...
 
PNUint64 getUint64 ()
 Extracts an unsigned 64-bit integer. More...
 
PNUint8 getUint8 ()
 Extracts an unsigned 8-bit integer. More...
 
str getZString ()
 
StreamReader operator= (const StreamReader copy)
 
str readline ()
 
object readlines ()
 
 skipBytes (size_t 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.

Member Function Documentation

__init__ ( const StreamReader  copy)

The copy constructor does not copy ownership of the stream.

__init__ ( Istream  in,
bool  owns_stream 
)

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

str extractBytes ( size_t  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.

PNFloat64 getBeFloat64 ( )

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

PNInt16 getBeInt16 ( )

Extracts a signed big-endian 16-bit integer.

PNInt32 getBeInt32 ( )

Extracts a signed big-endian 32-bit integer.

PNInt64 getBeInt64 ( )

Extracts a signed big-endian 64-bit integer.

PNUint16 getBeUint16 ( )

Extracts an unsigned big-endian 16-bit integer.

PNUint32 getBeUint32 ( )

Extracts an unsigned big-endian 32-bit integer.

PNUint64 getBeUint64 ( )

Extracts an unsigned big-endian 64-bit integer.

bool getBool ( )

Extracts a boolean value.

str getFixedString ( size_t  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.

PNFloat64 getFloat64 ( )

Extracts a 64-bit floating-point number.

PNInt16 getInt16 ( )

Extracts a signed 16-bit integer.

PNInt32 getInt32 ( )

Extracts a signed 32-bit integer.

PNInt64 getInt64 ( )

Extracts a signed 64-bit integer.

PNInt8 getInt8 ( )

Extracts a signed 8-bit integer.

Istream getIstream ( )

Returns the stream in use.

str getString ( )
str getString32 ( )
PNUint16 getUint16 ( )

Extracts an unsigned 16-bit integer.

PNUint32 getUint32 ( )

Extracts an unsigned 32-bit integer.

PNUint64 getUint64 ( )

Extracts an unsigned 64-bit integer.

PNUint8 getUint8 ( )

Extracts an unsigned 8-bit integer.

str getZString ( )
StreamReader operator= ( const StreamReader  copy)
str readline ( )
object readlines ( )
skipBytes ( size_t  size)