OpenTTD
|
Public Member Functions | |
StringParameters (uint64 *data, uint num_param, WChar *type) | |
Create a new StringParameters instance. More... | |
template<size_t Tnum_param> | |
StringParameters (int64(&data)[Tnum_param]) | |
Create a new StringParameters instance. More... | |
StringParameters (StringParameters &parent, uint size) | |
Create a new StringParameters instance that can reference part of the data of the given partent instance. | |
void | ClearTypeInformation () |
Reset the type array. More... | |
int64 | GetInt64 (WChar type=0) |
Read an int64 from the argument array. More... | |
int32 | GetInt32 (WChar type=0) |
Read an int32 from the argument array. More... | |
void | ShiftParameters (uint amount) |
Shift all data in the data array by the given amount to make room for some extra parameters. | |
uint64 * | GetDataPointer () const |
Get a pointer to the current element in the data array. More... | |
uint | GetDataLeft () const |
Return the amount of elements which can still be read. More... | |
uint64 * | GetPointerToOffset (uint offset) const |
Get a pointer to a specific element in the data array. More... | |
bool | HasTypeInformation () const |
Does this instance store information about the type of the parameters. More... | |
WChar | GetTypeAtOffset (uint offset) const |
Get the type of a specific element. More... | |
void | SetParam (uint n, uint64 v) |
uint64 | GetParam (uint n) const |
Data Fields | |
uint | offset |
Current offset in the data/type arrays. | |
uint | num_param |
Length of the data array. | |
Private Attributes | |
StringParameters * | parent |
If not NULL, this instance references data from this parent instance. | |
uint64 * | data |
Array with the actual data. | |
WChar * | type |
Array with type information about the data. Can be NULL when no type information is needed. See StringControlCode. | |
Definition at line 62 of file strings_func.h.
|
inline |
Create a new StringParameters instance.
Definition at line 72 of file strings_func.h.
|
inline |
Create a new StringParameters instance.
Definition at line 82 of file strings_func.h.
void StringParameters::ClearTypeInformation | ( | ) |
Reset the type array.
Definition at line 63 of file strings.cpp.
|
inline |
Return the amount of elements which can still be read.
Definition at line 136 of file strings_func.h.
References offset.
|
inline |
Get a pointer to the current element in the data array.
Definition at line 130 of file strings_func.h.
References offset.
|
inline |
Read an int32 from the argument array.
Definition at line 122 of file strings_func.h.
References GetInt64(), and ShiftParameters().
int64 StringParameters::GetInt64 | ( | WChar | type = 0 | ) |
Read an int64 from the argument array.
The offset is increased so the next time GetInt64 is called the next value is read.
Definition at line 74 of file strings.cpp.
References DEBUG, num_param, and offset.
Referenced by GetInt32().
|
inline |
Get a pointer to a specific element in the data array.
Definition at line 142 of file strings_func.h.
|
inline |
Get the type of a specific element.
Definition at line 155 of file strings_func.h.
|
inline |
Does this instance store information about the type of the parameters.
Definition at line 149 of file strings_func.h.
Referenced by FormatString().