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

Method TryReadUint8

src/core/string_consumer.hpp:111–116  ·  view source on GitHub ↗

* Try to read binary uint8, and then advance reader. */

Source from the content-addressed store, hash-verified

109 * Try to read binary uint8, and then advance reader.
110 */
111 [[nodiscard]] std::optional<uint8_t> TryReadUint8()
112 {
113 auto value = this->PeekUint8();
114 if (value.has_value()) this->SkipUint8();
115 return value;
116 }
117 /**
118 * Read binary uint8, and advance reader.
119 * @param def Default value to return, if not enough data.

Callers 2

_io_file_lexfeed_ASCIIFunction · 0.80
ReadByteMethod · 0.80

Calls 2

PeekUint8Method · 0.95
SkipUint8Method · 0.95

Tested by

no test coverage detected