MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / FormatString

Function FormatString

src/strings.cpp:261–265  ·  view source on GitHub ↗

* Parse most format codes within a string and write the result to a buffer. * This is a wrapper for a span of StringParameter which creates the StringParameters state and forwards to the regular call. * @param builder The string builder to write the final string to. * @param str Pointer to string to format. * @param params The span of parameters to pass. * @param case_index The current case i

Source from the content-addressed store, hash-verified

259 * @param dry_run True when the args' type data is not yet initialized.
260 */
261static void FormatString(StringBuilder &builder, std::string_view str, std::span<StringParameter> params, uint case_index = 0, bool game_script = false, bool dry_run = false)
262{
263 StringParameters tmp_params{params};
264 FormatString(builder, str, tmp_params, case_index, game_script, dry_run);
265}
266
267struct LanguagePack : public LanguagePackHeader {
268 char data[]; // list of strings

Callers 5

GetStringWithArgsFunction · 0.85
FormatYmdStringFunction · 0.85
FormatMonthAndYearFunction · 0.85
FormatTinyOrISODateFunction · 0.85
FormatGenericCurrencyFunction · 0.85

Calls 15

IsColourSafeFunction · 0.85
DecodeEncodedStringFunction · 0.85
GetStringPtrFunction · 0.85
ParseStringChoiceFunction · 0.85
DeterminePluralFormFunction · 0.85
SkipStringChoiceFunction · 0.85
GetStringTabFunction · 0.85
GetStringWithArgsFunction · 0.85
FormatCommaNumberFunction · 0.85
PowerOfTenFunction · 0.85
GetDecimalSeparatorFunction · 0.85

Tested by

no test coverage detected