#include <messagein.hpp>
Definition at line 34 of file messagein.hpp.
Public Member Functions | |
| MessageIn (const char *data, int length) | |
| Constructor. | |
| int | getId () |
| Returns the message ID. | |
| int | readByte () |
| Reads a byte. | |
| int | readShort () |
| Reads a short. | |
| int | readLong () |
| Reads a long. | |
| std::string | readString (int length=-1) |
| Reads a string. | |
| int | getUnreadLength () |
| Returns the length of unread data. | |
Private Attributes | |
| const char * | mData |
| Packet data. | |
| unsigned short | mLength |
| Length of data in bytes. | |
| unsigned short | mId |
| The message ID. | |
| unsigned short | mPos |
| Actual position in the packet. | |
|
||||||||||||
|
Constructor.
Definition at line 29 of file messagein.cpp. |
|
|
Returns the message ID.
Definition at line 42 of file messagein.hpp. |
|
|
Returns the length of unread data.
Definition at line 58 of file messagein.hpp. |
|
|
Reads a byte.
Definition at line 38 of file messagein.cpp. |
|
|
Reads a long.
Definition at line 62 of file messagein.cpp. |
|
|
Reads a short.
Definition at line 49 of file messagein.cpp. |
|
|
Reads a string. If a length is not given (-1), it is assumed that the length of the string is stored in a short at the start of the string. Definition at line 75 of file messagein.cpp. |
|
|
Packet data.
Definition at line 61 of file messagein.hpp. |
|
|
The message ID.
Definition at line 63 of file messagein.hpp. |
|
|
Length of data in bytes.
Definition at line 62 of file messagein.hpp. |
|
|
Actual position in the packet. From 0 to packet->length. A value bigger than packet->length means EOP was reached when reading it. Definition at line 69 of file messagein.hpp. |
1.3.9.1