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

Method ReadUtf8If

src/core/string_consumer.hpp:501–507  ·  view source on GitHub ↗

* Check whether the next UTF-8 char matches 'c', and skip it. */

Source from the content-addressed store, hash-verified

499 * Check whether the next UTF-8 char matches 'c', and skip it.
500 */
501 [[nodiscard]] bool ReadUtf8If(char32_t c)
502 {
503 auto [len, result] = this->PeekUtf8();
504 if (len == 0 || result != c) return false;
505 this->Skip(len);
506 return true;
507 }
508 /**
509 * If the next data matches the UTF-8 char 'c', then skip it.
510 */

Callers 5

ReplaceParamMethod · 0.80
FormatStringFunction · 0.80
TranslateTTDPatchCodesFunction · 0.80
IConsoleCmdExecFunction · 0.80
FixSCCEncodedNegativeFunction · 0.80

Calls 2

PeekUtf8Method · 0.95
SkipMethod · 0.95

Tested by

no test coverage detected