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

Method PeekUint16LE

src/core/string_consumer.cpp:44–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44std::optional<uint16_t> StringConsumer::PeekUint16LE() const
45{
46 if (this->GetBytesLeft() < 2) return std::nullopt;
47 return static_cast<uint8_t>(this->src[this->position]) |
48 static_cast<uint8_t>(this->src[this->position + 1]) << 8;
49}
50
51std::optional<uint32_t> StringConsumer::PeekUint32LE() const
52{

Callers 3

TryReadUint16LEMethod · 0.95
ReadUint16LEMethod · 0.95

Calls 1

GetBytesLeftMethod · 0.95

Tested by

no test coverage detected