#include <messageout.hpp>
Definition at line 32 of file messageout.hpp.
Public Member Functions | |
| MessageOut () | |
| Constructor. | |
| MessageOut (short id) | |
| Constructor that takes a message ID. | |
| ~MessageOut () | |
| Destructor. | |
| void | writeByte (char value) |
| Writes a byte. | |
| void | writeShort (short value) |
| Writes a short. | |
| void | writeLong (long value) |
| Writes a long. | |
| void | writeCoordinates (int x, int y) |
| Writes a 3-byte block containing tile-based coordinates. | |
| void | writeString (const std::string &string, int length=-1) |
| Writes a string. | |
| char * | getData () const |
| Returns the content of the message. | |
| unsigned int | getLength () const |
| Returns the length of the data. | |
Private Member Functions | |
| void | expand (size_t size) |
| Ensures the capacity of the data buffer is large enough to hold the given amount of bytes. | |
Private Attributes | |
| char * | mData |
| Data building up. | |
| unsigned int | mPos |
| Position in the data. | |
| unsigned int | mDataSize |
| Allocated datasize. | |
|
|
Constructor.
Definition at line 37 of file messageout.cpp. |
|
|
Constructor that takes a message ID.
Definition at line 44 of file messageout.cpp. |
|
|
Destructor.
Definition at line 53 of file messageout.cpp. |
|
|
Ensures the capacity of the data buffer is large enough to hold the given amount of bytes.
Definition at line 59 of file messageout.cpp. |
|
|
Returns the content of the message.
Definition at line 75 of file messageout.hpp. |
|
|
Returns the length of the data.
Definition at line 81 of file messageout.hpp. |
|
|
Writes a byte.
Definition at line 74 of file messageout.cpp. |
|
||||||||||||
|
Writes a 3-byte block containing tile-based coordinates.
Definition at line 99 of file messageout.cpp. |
|
|
Writes a long.
Definition at line 91 of file messageout.cpp. |
|
|
Writes a short.
Definition at line 82 of file messageout.cpp. |
|
||||||||||||
|
Writes a string. If a fixed length is not given (-1), it is stored as a short at the start of the string. Definition at line 110 of file messageout.cpp. |
|
|
Data building up.
Definition at line 91 of file messageout.hpp. |
|
|
Allocated datasize.
Definition at line 93 of file messageout.hpp. |
|
|
Position in the data.
Definition at line 92 of file messageout.hpp. |
1.3.9.1