#include <wagparser.h>
Public Types | |
| enum | WagPropertyCode { PC_GAMEDESC = 129 , PC_GAMEAUTHOR , PC_GAMEID , PC_INTVERSION , PC_GAMELAST , PC_GAMEVERSION , PC_GAMEABOUT , PC_GAMEEXEC , PC_RESDIR , PC_DEFSYNTAX , PC_INVOBJDESC = 144 , PC_VOCABWORDDESC = 160 , PC_PALETTE = 172 , PC_USERESNAMES = 180 , PC_LOGIC = 192 , PC_PICTURE = 208 , PC_SOUND = 224 , PC_VIEW = 240 , PC_UNDEFINED = 0x100 } |
| enum | WagPropertyType { PT_ID , PT_DESC , PT_SYNTAX , PT_CRC32 , PT_KEY , PT_INST0 , PT_INST1 , PT_INST2 , PT_MUTE0 , PT_MUTE1 , PT_MUTE2 , PT_MUTE3 , PT_TPQN , PT_ROOM , PT_VIS0 , PT_VIS1 , PT_VIS2 , PT_VIS3 , PT_ALL = 0xff , PT_UNDEFINED = 0x100 } |
Public Member Functions | |
| WagProperty () | |
| ~WagProperty () | |
| WagProperty (const WagProperty &other) | |
| WagProperty & | operator= (const WagProperty &other) |
| bool | read (Common::SeekableReadStream &stream) |
| void | clear () |
| bool | readOk () const |
| enum WagPropertyCode | getCode () const |
| enum WagPropertyType | getType () const |
| byte | getNumber () const |
| uint16 | getSize () const |
| const char * | getData () const |
| void | setPropCode (WagPropertyCode propCode) |
| void | setPropDataSize (Common::String str) |
Protected Member Functions | |
| void | setDefaults () |
| void | deleteData () |
| void | deepCopy (const WagProperty &other) |
Protected Attributes | |
| bool | _readOk |
| Was the property read ok from the source stream? | |
| enum WagPropertyCode | _propCode |
| Property code (Part of the property's header) | |
| enum WagPropertyType | _propType |
| Property type (Part of the property's header) | |
| byte | _propNum |
| Property number (Part of the property's header) | |
| uint16 | _propSize |
| Property's size (Part of the property's header) | |
| char * | _propData |
| The property's data (Plus a trailing zero for C-style string access) | |
WagProperty represents a single property from WinAGI's *.wag file. A property consists of a header and of data. The header consists of the following:
Property codes taken from WinAGI 1.1.21's source code file WinAGI/AGIObjects.bas.
| Agi::WagProperty::WagProperty | ( | ) |
Creates an empty WagProperty object. No property header or property data in it.
| Agi::WagProperty::~WagProperty | ( | ) |
Destructor. Releases allocated memory if any etc. The usual.
| Agi::WagProperty::WagProperty | ( | const WagProperty & | other | ) |
Copy constructor. Deep copies the variables.
| WagProperty & Agi::WagProperty::operator= | ( | const WagProperty & | other | ) |
Assignment operator. Deep copies the variables.
|
protected |
Sets the default values for member variables.
|
protected |
Delete's the property's data from memory if we have it, otherwise does nothing.
|
protected |
Deep copies the parameter object to this object.
| other | The object to be deep copied to this object. |
| bool Agi::WagProperty::read | ( | Common::SeekableReadStream & | stream | ) |
Read in a property (Header and data).
| void Agi::WagProperty::clear | ( | ) |
Clears the property. After this the property is empty. No header or data.
|
inline |
Was the property read ok from the source stream?
|
inline |
Return the property's code.
|
inline |
Return the property's type.
|
inline |
Return the property's number.
|
inline |
Return the property's data's length.
|
inline |
Return property's data. Constant access version. Can be used as a C-style string (i.e. this is guaranteed to have a trailing zero).
| void Agi::WagProperty::setPropCode | ( | WagPropertyCode | propCode | ) |
Set property's code
| propCode | the code value to set |
| void Agi::WagProperty::setPropDataSize | ( | Common::String | str | ) |
Set property's data and property's size
| str | the string that according to it these are set |