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

Function GetEncodedStringIfValid

src/strings_func.h:134–138  ·  view source on GitHub ↗

* Encode a string with no parameters into an encoded string, if the string id is valid. * @note the return encoded string will be empty if the string id is not valid. * @param str String to encode. * @returns an EncodedString. */

Source from the content-addressed store, hash-verified

132 * @returns an EncodedString.
133 */
134static inline EncodedString GetEncodedStringIfValid(StringID str)
135{
136 if (str == INVALID_STRING_ID) return {};
137 return GetEncodedString(str);
138}
139
140/**
141 * Get an encoded string with parameters.

Callers 1

ShowErrorMessageFunction · 0.85

Calls 1

GetEncodedStringFunction · 0.70

Tested by

no test coverage detected