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

Method ReadUint32LE

src/core/string_consumer.hpp:257–262  ·  view source on GitHub ↗

* Read binary uint32 using little endian, and advance reader. * @param def Default value to return, if not enough data. * @return Read integer, 'def' if not enough data. * @note The reader is advanced, even if not enough data was present. */

Source from the content-addressed store, hash-verified

255 * @note The reader is advanced, even if not enough data was present.
256 */
257 [[nodiscard]] uint32_t ReadUint32LE(uint32_t def = 0)
258 {
259 auto value = this->PeekUint32LE();
260 this->SkipUint32LE(); // always advance
261 return value.value_or(def);
262 }
263 /**
264 * Skip binary uint32, and advance reader.
265 * @note The reader is advanced, even if not enough data was present.

Callers 1

Calls 2

PeekUint32LEMethod · 0.95
SkipUint32LEMethod · 0.95

Tested by

no test coverage detected