OpenTTD Source  12.0-beta2
StringParameters Class Reference

Public Member Functions

 StringParameters (uint64 *data, uint num_param, WChar *type)
 Create a new StringParameters instance.
 
template<size_t Tnum_param>
 StringParameters (int64(&data)[Tnum_param])
 Create a new StringParameters instance.
 
 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.
 
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...
 
uint64 * GetDataPointer () const
 Get a pointer to the current element in the data array.
 
uint GetDataLeft () const
 Return the amount of elements which can still be read.
 
uint64 * GetPointerToOffset (uint offset) const
 Get a pointer to a specific element in the data array.
 
bool HasTypeInformation () const
 Does this instance store information about the type of the parameters.
 
WChar GetTypeAtOffset (uint offset) const
 Get the type of a specific element.
 
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

StringParametersparent
 If not nullptr, this instance references data from this parent instance.
 
uint64 * data
 Array with the actual data.
 
WChartype
 Array with type information about the data. Can be nullptr when no type information is needed. See StringControlCode.
 

Detailed Description

Definition at line 60 of file strings_func.h.

Member Function Documentation

◆ GetInt32()

int32 StringParameters::GetInt32 ( WChar  type = 0)
inline

Read an int32 from the argument array.

See also
GetInt64.

Definition at line 120 of file strings_func.h.

References GetInt64().

◆ GetInt64()

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 70 of file strings.cpp.

References data, Debug, num_param, offset, and type.

Referenced by GetInt32().


The documentation for this class was generated from the following files: