|
OpenTTD Source 20260311-master-g511d3794ce
|
Public Member Functions | |
| StringParameters (StringParameters &parent, size_t size) | |
| Create a new StringParameters instance that can reference part of the data of the given parent instance. | |
| StringParameters (std::span< StringParameter > parameters={}) | |
| Create a new StringParameters instance with the given parameters. | |
| void | SetTypeOfNextParameter (char32_t type) |
| size_t | GetOffset () |
| Get the current offset, so it can be backed up for certain processing steps, or be used to offset the argument index within sub strings. | |
| void | SetOffset (size_t offset) |
Set the offset within the string from where to return the next result of GetInt64 or GetInt32. | |
| void | AdvanceOffset (size_t advance) |
Advance the offset within the string from where to return the next result of GetInt64 or GetInt32. | |
| uint64_t | GetNextParameter () |
| Get the next parameter from our parameters. | |
| template<typename T> | |
| T | GetNextParameter () |
| Get the next parameter from our parameters. | |
| std::string_view | GetNextParameterString () |
| Get the next string parameter from our parameters. | |
| StringParameters | GetRemainingParameters () |
| Get a new instance of StringParameters that is a "range" into the remaining existing parameters. | |
| StringParameters | GetRemainingParameters (size_t offset) |
| Get a new instance of StringParameters that is a "range" into the remaining existing parameters from the given offset. | |
| size_t | GetDataLeft () const |
| Return the amount of elements which can still be read. | |
| size_t | GetNumParameters () const |
| Return the number of parameters. | |
| char32_t | GetTypeAtOffset (size_t offset) const |
| Get the type of a specific element. | |
| void | SetParam (size_t n, const StringParameterData &v) |
| void | SetParam (size_t n, uint64_t v) |
| void | SetParam (size_t n, ConvertibleThroughBase auto v) |
| void | SetParam (size_t n, const std::string &str) |
| void | SetParam (size_t n, std::string &&str) |
| const StringParameterData & | GetParam (size_t n) const |
Protected Member Functions | |
| const StringParameter & | GetNextParameterReference () |
| Get the next parameter from our parameters. | |
Protected Attributes | |
| StringParameters * | parent = nullptr |
| If not nullptr, this instance references data from this parent instance. | |
| std::span< StringParameter > | parameters = {} |
| Array with the actual parameters. | |
| size_t | offset = 0 |
| Current offset in the parameters span. | |
| char32_t | next_type = 0 |
| The type of the next data that is retrieved. | |
Definition at line 18 of file strings_internal.h.
|
inline |
Create a new StringParameters instance that can reference part of the data of the given parent instance.
| parent | The parent we are a subset from. |
| size | The number of elements from the parent at its offset to take. |
Definition at line 35 of file strings_internal.h.
References offset, parameters, parent, and StringParameters().
Referenced by GetRemainingParameters(), GetRemainingParameters(), and StringParameters().
|
inline |
Create a new StringParameters instance with the given parameters.
| parameters | The actual parameters. |
Definition at line 44 of file strings_internal.h.
References parameters.
|
inline |
Advance the offset within the string from where to return the next result of GetInt64 or GetInt32.
| advance | The amount to advance the offset by. |
Definition at line 78 of file strings_internal.h.
References offset.
Referenced by FormatString().
|
inline |
Return the amount of elements which can still be read.
Definition at line 162 of file strings_internal.h.
Referenced by FormatString().
Get the next parameter from our parameters.
This updates the offset, so the next time this is called the next parameter will be read.
| T | The return type of the parameter. |
Definition at line 110 of file strings_internal.h.
References GetNextParameter(), and T.
|
inline |
Get the next parameter from our parameters.
This updates the offset, so the next time this is called the next parameter will be read.
Definition at line 90 of file strings_internal.h.
References GetNextParameterReference().
Referenced by FormatString(), GetNextParameter(), and GetStringWithArgs().
|
protected |
Get the next parameter from our parameters.
This updates the offset, so the next time this is called the next parameter will be read.
Definition at line 68 of file strings.cpp.
References next_type, offset, and parameters.
Referenced by GetNextParameter(), and GetNextParameterString().
|
inline |
Get the next string parameter from our parameters.
This updates the offset, so the next time this is called the next parameter will be read.
Definition at line 121 of file strings_internal.h.
References GetNextParameterReference().
Referenced by FormatString().
|
inline |
Return the number of parameters.
Definition at line 171 of file strings_internal.h.
Referenced by FormatString().
|
inline |
Get the current offset, so it can be backed up for certain processing steps, or be used to offset the argument index within sub strings.
Definition at line 53 of file strings_internal.h.
Referenced by FormatString().
|
inline |
Definition at line 216 of file strings_internal.h.
|
inline |
Get a new instance of StringParameters that is a "range" into the remaining existing parameters.
Upon destruction the offset in the parent is not updated. However, calls to SetParam do update the parameters.
The returned StringParameters must not outlive this StringParameters.
Definition at line 141 of file strings_internal.h.
References GetRemainingParameters(), and StringParameters().
Referenced by FormatString(), and GetRemainingParameters().
|
inline |
Get a new instance of StringParameters that is a "range" into the remaining existing parameters from the given offset.
Upon destruction the offset in the parent is not updated. However, calls to SetParam do update the parameters.
The returned StringParameters must not outlive this StringParameters.
| offset | The offset to get the remaining parameters for. |
Definition at line 153 of file strings_internal.h.
References offset, and StringParameters().
|
inline |
Get the type of a specific element.
| offset | The offset to get the type for. |
Definition at line 181 of file strings_internal.h.
References offset, and parameters.
Referenced by FormatString().
|
inline |
Set the offset within the string from where to return the next result of GetInt64 or GetInt32.
| offset | The offset. |
Definition at line 60 of file strings_internal.h.
References offset, and parameters.
Referenced by FormatString().
|
inline |
Definition at line 204 of file strings_internal.h.
|
inline |
Definition at line 187 of file strings_internal.h.
|
inline |
Definition at line 199 of file strings_internal.h.
|
inline |
Definition at line 210 of file strings_internal.h.
|
inline |
Definition at line 193 of file strings_internal.h.
|
inline |
Definition at line 46 of file strings_internal.h.
|
protected |
The type of the next data that is retrieved.
Definition at line 24 of file strings_internal.h.
Referenced by GetNextParameterReference().
|
protected |
Current offset in the parameters span.
Definition at line 23 of file strings_internal.h.
Referenced by AdvanceOffset(), GetNextParameterReference(), GetRemainingParameters(), GetTypeAtOffset(), SetOffset(), and StringParameters().
|
protected |
Array with the actual parameters.
Definition at line 21 of file strings_internal.h.
Referenced by GetNextParameterReference(), GetTypeAtOffset(), SetOffset(), StringParameters(), and StringParameters().
|
protected |
If not nullptr, this instance references data from this parent instance.
Definition at line 20 of file strings_internal.h.
Referenced by StringParameters().