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

Method ReadChar

src/core/string_consumer.hpp:394–398  ·  view source on GitHub ↗

* Read 8-bit character, and advance reader. * @param def Default value to return, if not enough data. * @return Read character, 'def' if not enough data. */

Source from the content-addressed store, hash-verified

392 * @return Read character, 'def' if not enough data.
393 */
394 [[nodiscard]] char ReadChar(char def = '?') {
395 auto value = this->PeekChar();
396 this->SkipChar(); // always advance
397 return value.value_or(def);
398 }
399 /**
400 * Skip 8-bit character, and advance reader.
401 */

Callers 3

CompileTypemaskFunction · 0.80
DumpLineFunction · 0.80

Calls 2

PeekCharMethod · 0.95
SkipCharMethod · 0.95

Tested by

no test coverage detected