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

Method ReadIntegerBase

src/core/string_consumer.hpp:891–896  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

889 */
890 template <class T>
891 [[nodiscard]] T ReadIntegerBase(int base, T def = 0, bool clamp = false)
892 {
893 auto [len, value] = ParseIntegerBase<T>(this->src.substr(this->position), base, clamp, true);
894 this->SkipIntegerBase(base); // always advance
895 return len > 0 ? value : def;
896 }
897 /**
898 * Skip an integer in number 'base'.
899 * If 'base == 0', then a prefix '0x' decides between base 16 or base 10.

Callers 1

IsInNetmaskMethod · 0.80

Calls 2

SkipIntegerBaseMethod · 0.95
substrMethod · 0.80

Tested by

no test coverage detected