tbx
0.7.6
|
Base class for objects, gadgets and menu items from ressources. More...
#include <resbase.h>
Public Member Functions | |
ResBase (const ResBase &other) | |
Copy constructor. More... | |
virtual | ~ResBase () |
Destructor. | |
ResBase & | operator= (const ResBase &other) |
Assignment. More... | |
Protected Member Functions | |
ResBase (ResImpl *impl) | |
Create from internal resource implementation. More... | |
virtual void | make_writeable ()=0 |
Make object writeable, call before any change. | |
const char * | string (int offset) const |
Return a string at the given offset. More... | |
void | string (int offset, const char *value) |
Set a string at the given offset. More... | |
void | string (int offset, std::string value) |
Set a string at the given offset. More... | |
void | string_with_length (int offset, const char *value, int length=-1) |
Assign a string where the length is at offset+4. More... | |
void | string_with_length (int offset, const std::string &value, int length=-1) |
Assign a string where the length is at offset+4. More... | |
const char * | message (int offset) const |
Get the message string at the given offset. More... | |
void | message (int offset, const char *value) |
Set a message at the given offset. More... | |
void | message (int offset, std::string value) |
Set a message at the given offset. More... | |
void | message_with_length (int offset, const char *value, int length=-1) |
Assign a message where the length is at offset+4. More... | |
void | message_with_length (int offset, const std::string &value, int length=-1) |
Assign a message where the length is at offset+4. More... | |
int | int_value (int offset) const |
Get an integer value. More... | |
void | int_value (int offset, int value) |
Set a number at the specified offset. More... | |
unsigned int | uint_value (int offset) const |
Get an unsigned integer value. More... | |
void | uint_value (int offset, unsigned int value) |
Set an unsigned number at the specified offset. More... | |
unsigned char | byte_value (int offset) const |
Get a byte value. More... | |
void | byte_value (int offset, unsigned char value) |
Set an unsigned byte (8 bit value) at the specified offset. More... | |
unsigned short | ushort_value (int offset) const |
Get a unsigned short value. More... | |
void | ushort_value (int offset, unsigned short value) |
Set an unsigned short (16 bit value) at the specified offset. More... | |
bool | flag (int offset, int mask) const |
Check if any of the bits in a mask are set. More... | |
void | flag (int offset, int mask, bool on) |
Set/clear the bits in mask. More... | |
int | flag_value (int offset, int mask) const |
Get the bits for the given mask. More... | |
void | flag_value (int offset, int mask, int value) |
Set bits in given mask clearing others. More... | |
void | init_string (int offset, const char *value) |
Initialise a string in a constructor helper. More... | |
void | init_message (int offset, const char *value) |
Initialise a message in a constructor helper. More... | |
void | init_sprite_area_ref (int offset) |
Initialise a sprite area reference. More... | |
void | init_object_ref (int offset) |
Initialise an object reference. More... | |
Protected Attributes | |
ResImpl * | _impl |
Internal Resource implementation. | |
Base class for objects, gadgets and menu items from ressources.
|
inlineprotected |
Create from internal resource implementation.
impl | internal implementation class |
tbx::res::ResBase::ResBase | ( | const ResBase & | other | ) |
Copy constructor.
other | ResBase to copy |
|
inlineprotected |
Get a byte value.
offset | offset to retrieve value for |
|
protected |
Set an unsigned byte (8 bit value) at the specified offset.
offset | offset of the value in the object |
value | new value |
|
inlineprotected |
Check if any of the bits in a mask are set.
offset | offset to check bits at |
mask | bits to check |
|
protected |
Set/clear the bits in mask.
offset | offset of the value to change |
mask | bits to set on or off |
on | true to set mask bits to 1, false to set them to 0 |
|
inlineprotected |
Get the bits for the given mask.
offset | of value to check bits off |
mask | bits to check |
|
protected |
Set bits in given mask clearing others.
offset | of value to change |
mask | bits to change |
value | new value for bits in mask |
|
protected |
Initialise a message in a constructor helper.
offset | offset of the message in the object |
value | initial value for the message |
|
protected |
Initialise an object reference.
offset | offset of the object reference in the object |
|
protected |
Initialise a sprite area reference.
offset | offset of the sprite area reference in the object |
|
protected |
Initialise a string in a constructor helper.
offset | offset of string in the object |
value | initial value for the string |
|
inlineprotected |
Get an integer value.
offset | offset to retrieve value for |
|
protected |
Set a number at the specified offset.
offset | offset of the number in the object |
value | new value |
|
protected |
Get the message string at the given offset.
offset | offset of message in the object |
|
protected |
Set a message at the given offset.
offset | offset of message in the object |
value | new value for the message |
|
protected |
Set a message at the given offset.
offset | offset of message in the object |
value | new value for the message |
|
protected |
Assign a message where the length is at offset+4.
offset | offset into body of message |
value | new value for the message |
length | new length or -1 to use existing length. The length is always adjusted so it is big enough for the value. |
|
inlineprotected |
Assign a message where the length is at offset+4.
offset | offset into body of message |
value | new value for the message |
length | new length or -1 to use existing length. The length is always adjusted so it is big enough for the value. |
Assignment.
other | ResBase to copy |
|
protected |
Return a string at the given offset.
offset | offset of pointer to string in object |
|
protected |
Set a string at the given offset.
offset | offset of string in the object |
value | new value for the string |
|
protected |
Set a string at the given offset.
offset | offset of string in the object |
value | new value for the string |
|
protected |
Assign a string where the length is at offset+4.
offset | - offset into body of string |
value | - new value for the string |
length | - new length or -1 to use existing length. The length is always adjusted so it is big enough for the value. |
|
inlineprotected |
Assign a string where the length is at offset+4.
offset | - offset into body of string |
value | - new value for the string |
length | - new length or -1 to use existing length. The length is always adjusted so it is big enough for the value. |
|
inlineprotected |
Get an unsigned integer value.
offset | offset to retrieve value for |
|
protected |
Set an unsigned number at the specified offset.
offset | offset of the number in the object |
value | new value |
|
inlineprotected |
Get a unsigned short value.
offset | offset to retrieve value for |
|
protected |
Set an unsigned short (16 bit value) at the specified offset.
offset | offset of the value in the object |
value | new value |