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

Method PeekUint32LE

src/core/string_consumer.cpp:51–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51std::optional<uint32_t> StringConsumer::PeekUint32LE() const
52{
53 if (this->GetBytesLeft() < 4) return std::nullopt;
54 return static_cast<uint8_t>(this->src[this->position]) |
55 static_cast<uint8_t>(this->src[this->position + 1]) << 8 |
56 static_cast<uint8_t>(this->src[this->position + 2]) << 16 |
57 static_cast<uint8_t>(this->src[this->position + 3]) << 24;
58}
59
60std::optional<uint64_t> StringConsumer::PeekUint64LE() const
61{

Callers 4

TryReadUint32LEMethod · 0.95
ReadUint32LEMethod · 0.95
PeekDWordMethod · 0.80

Calls 1

GetBytesLeftMethod · 0.95

Tested by

no test coverage detected