C4 Engine Terathon Software C4 Engine API Documentation

• Message Manager

API Links
Developer Links

class Decompressor

Defined in:  C4Messages.h
Decompresses data for a message.
Definition

class Decompressor

Member Functions
Decompressor::GetSize Returns the total size of the compressed data.
Decompressor::Read Reads arbitrary data from the internal buffer.
Constructor

Decompressor(char *ptr);

Decompressor objects should be constructed only by the Message Manager.
Description
A Decompressor object is passed to the Message::Decompress function after the Message Manager receives a message. The message object should use the >> operator or the Decompressor::Read function to read its data from the Decompressor object's internal buffer. Data read by the >> operator is always converted from big endian order to the native endian of the local machine so that messages can be sent between machines having different native endians.
Overloaded Operators
Decompressor& operator >>(char& x); Reads a single 8-bit character from the internal buffer.
Decompressor& operator >>(unsigned char& x); Reads a single 8-bit unsigned character from the internal buffer.
Decompressor& operator >>(short& x); Reads a single 16-bit integer from the internal buffer.
Decompressor& operator >>(unsigned short& x); Reads a single 16-bit unsigned integer from the internal buffer.
Decompressor& operator >>(long& x); Reads a single 32-bit integer from the internal buffer.
Decompressor& operator >>(unsigned long& x); Reads a single 32-bit unsigned integer from the internal buffer.
Decompressor& operator >>(long64& x); Reads a single 64-bit integer from the internal buffer.
Decompressor& operator >>(ulong64& x); Reads a single 64-bit unsigned integer from the internal buffer.
Decompressor& operator >>(float& x); Reads a single 32-bit floating-point value from the internal buffer.
Decompressor& operator >>(Vector2D& v); Reads two 32-bit floating-point values from the internal buffer and stores them in the vector v.
Decompressor& operator >>(Vector3D& v); Reads three 32-bit floating-point values from the internal buffer and stores them in the vector v.
Decompressor& operator >>(Vector4D& v); Reads four 32-bit floating-point values from the internal buffer and stores them in the vector v.
Decompressor& operator >>(Quaternion& q); Reads four 32-bit floating-point values from the internal buffer and stores them in the quaternion q.
Decompressor& operator >>(ColorRGB& c); Reads three 32-bit floating-point values from the internal buffer and stores them in the color c.
Decompressor& operator >>(ColorRGBA& c); Reads four 32-bit floating-point values from the internal buffer and stores them in the color c.
template <long len> Decompressor& operator >>(String<len>& text); Reads a null-terminated text string from the internal buffer.
See Also

Message::Decompress

Compressor