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

Method TryReadUint32LE

src/core/string_consumer.hpp:245–250  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

243 * Try to read binary uint32, and then advance reader.
244 */
245 [[nodiscard]] std::optional<uint32_t> TryReadUint32LE()
246 {
247 auto value = this->PeekUint32LE();
248 if (value.has_value()) this->SkipUint32LE();
249 return value;
250 }
251 /**
252 * Read binary uint32 using little endian, and advance reader.
253 * @param def Default value to return, if not enough data.

Callers 1

ReadDWordMethod · 0.80

Calls 2

PeekUint32LEMethod · 0.95
SkipUint32LEMethod · 0.95

Tested by

no test coverage detected