Panda3D
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__() [1/2]

__init__ ( const StreamReader  copy)

The copy constructor does not copy ownership of the stream.

◆ __init__() [2/2]

__init__ ( Istream  in,
bool  owns_stream 
)

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

◆ extractBytes()

str extractBytes ( size_t  size)

◆ getBeFloat32()

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.

◆ getBeFloat64()

PNFloat64 getBeFloat64 ( )

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

◆ getBeInt16()

PNInt16 getBeInt16 ( )

Extracts a signed big-endian 16-bit integer.

◆ getBeInt32()

PNInt32 getBeInt32 ( )

Extracts a signed big-endian 32-bit integer.

◆ getBeInt64()

PNInt64 getBeInt64 ( )

Extracts a signed big-endian 64-bit integer.

◆ getBeUint16()

PNUint16 getBeUint16 ( )

Extracts an unsigned big-endian 16-bit integer.

◆ getBeUint32()

PNUint32 getBeUint32 ( )

Extracts an unsigned big-endian 32-bit integer.

◆ getBeUint64()

PNUint64 getBeUint64 ( )

Extracts an unsigned big-endian 64-bit integer.

◆ getBool()

bool getBool ( )

Extracts a boolean value.

◆ getFixedString()

str getFixedString ( size_t  size)

◆ getFloat32()

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.

◆ getFloat64()

PNFloat64 getFloat64 ( )

Extracts a 64-bit floating-point number.

◆ getInt16()

PNInt16 getInt16 ( )

Extracts a signed 16-bit integer.

◆ getInt32()

PNInt32 getInt32 ( )

Extracts a signed 32-bit integer.

◆ getInt64()

PNInt64 getInt64 ( )

Extracts a signed 64-bit integer.

◆ getInt8()

PNInt8 getInt8 ( )

Extracts a signed 8-bit integer.

◆ getIstream()

Istream getIstream ( )

Returns the stream in use.

◆ getString()

str getString ( )

◆ getString32()

str getString32 ( )

◆ getUint16()

PNUint16 getUint16 ( )

Extracts an unsigned 16-bit integer.

◆ getUint32()

PNUint32 getUint32 ( )

Extracts an unsigned 32-bit integer.

◆ getUint64()

PNUint64 getUint64 ( )

Extracts an unsigned 64-bit integer.

◆ getUint8()

PNUint8 getUint8 ( )

Extracts an unsigned 8-bit integer.

◆ getZString()

str getZString ( )

◆ operator=()

StreamReader operator= ( const StreamReader  copy)

◆ readline()

str readline ( )

◆ readlines()

object readlines ( )

◆ skipBytes()

skipBytes ( size_t  size)