Panda3D
|
A class to retrieve the individual data elements previously stored in a Datagram. More...
Public Member Functions | |
DatagramIterator () | |
DatagramIterator (Datagram const datagram, unsigned int offset) | |
DatagramIterator (DatagramIterator const copy) | |
DatagramIterator (Datagram const datagram) | |
string | extractBytes (unsigned int size) |
Extracts the indicated number of bytes in the datagram and returns them as a string. | |
float | getBeFloat32 () |
Extracts a 32-bit big-endian single-precision floating-point number. | |
double | getBeFloat64 () |
Extracts a 64-bit big-endian floating-point number. | |
short int | getBeInt16 () |
Extracts a signed 16-bit big-endian integer. | |
int | getBeInt32 () |
Extracts a signed 32-bit big-endian integer. | |
long int | getBeInt64 () |
Extracts a signed 64-bit big-endian integer. | |
unsigned short int | getBeUint16 () |
Extracts an unsigned 16-bit big-endian integer. | |
unsigned int | getBeUint32 () |
Extracts an unsigned 32-bit big-endian integer. | |
unsigned long int | getBeUint64 () |
Extracts an unsigned 64-bit big-endian integer. | |
bool | getBool () |
Extracts a boolean value. | |
unsigned int | getCurrentIndex () |
Returns the current position within the datagram of the next piece of data to extract. | |
Datagram const | getDatagram () |
Return the datagram of this iterator. | |
string | getFixedString (unsigned int size) |
Extracts a fixed-length string. | |
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. | |
string | getRemainingBytes () |
Returns the remaining bytes in the datagram as a string, but does not extract them from the iterator. | |
int | getRemainingSize () |
Return the bytes left in the datagram. | |
string | getString () |
Extracts a variable-length string. | |
string | getString32 () |
Extracts a variable-length string with a 32-bit length field. | |
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 | getWstring () |
Extracts a variable-length wstring (with a 32-bit length field). | |
string | getZString () |
Extracts a variable-length string, as a NULL-terminated string. | |
DatagramIterator | operator= (DatagramIterator const copy) |
output (ostream out) | |
Write a string representation of this instance to <out>. | |
skipBytes (unsigned int size) | |
Skips over the indicated number of bytes in the datagram. | |
write (ostream out) | |
Write a string representation of this instance to <out>. | |
write (ostream out, unsigned int indent) | |
Write a string representation of this instance to <out>. |
A class to retrieve the individual data elements previously stored in a Datagram.
Elements may be retrieved one at a time; it is up to the caller to know the correct type and order of each element.
DatagramIterator | ( | ) |
DatagramIterator | ( | Datagram const | datagram, |
unsigned int | offset | ||
) |
DatagramIterator | ( | Datagram const | datagram | ) |
DatagramIterator | ( | DatagramIterator const | copy | ) |
string extractBytes | ( | unsigned int | size | ) |
Extracts the indicated number of bytes in the datagram and returns them as a string.
float getBeFloat32 | ( | ) |
Extracts a 32-bit big-endian single-precision 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 16-bit big-endian integer.
int getBeInt32 | ( | ) |
Extracts a signed 32-bit big-endian integer.
long int getBeInt64 | ( | ) |
Extracts a signed 64-bit big-endian integer.
unsigned short int getBeUint16 | ( | ) |
Extracts an unsigned 16-bit big-endian integer.
unsigned int getBeUint32 | ( | ) |
Extracts an unsigned 32-bit big-endian integer.
unsigned long int getBeUint64 | ( | ) |
Extracts an unsigned 64-bit big-endian integer.
bool getBool | ( | ) |
Extracts a boolean value.
unsigned int getCurrentIndex | ( | ) |
Returns the current position within the datagram of the next piece of data to extract.
Datagram const getDatagram | ( | ) |
Return the datagram of this iterator.
string getFixedString | ( | unsigned int | size | ) |
Extracts a fixed-length string.
However, if a zero byte occurs within the string, it marks the end of the string.
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.
string getRemainingBytes | ( | ) |
Returns the remaining bytes in the datagram as a string, but does not extract them from the iterator.
int getRemainingSize | ( | ) |
Return the bytes left in the datagram.
string getString | ( | ) |
Extracts a variable-length string.
string getString32 | ( | ) |
Extracts a variable-length string with a 32-bit length field.
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 getWstring | ( | ) |
Extracts a variable-length wstring (with a 32-bit length field).
string getZString | ( | ) |
Extracts a variable-length string, as a NULL-terminated string.
DatagramIterator operator= | ( | DatagramIterator const | copy | ) |
output | ( | ostream | out | ) |
Write a string representation of this instance to <out>.
skipBytes | ( | unsigned int | size | ) |
Skips over the indicated number of bytes in the datagram.
write | ( | ostream | out | ) |
Write a string representation of this instance to <out>.