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

Method PutIntegerBase

src/core/string_builder.hpp:52–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50 */
51 template <class T>
52 void PutIntegerBase(T value, int base)
53 {
54 std::array<char, 32> buf;
55 auto result = std::to_chars(buf.data(), buf.data() + buf.size(), value, base);
56 if (result.ec != std::errc{}) return;
57 size_type len = result.ptr - buf.data();
58 this->PutBuffer({buf.data(), len});
59 }
60};
61
62/**

Callers 4

GetEncodedStringWithArgsFunction · 0.80
operator()Method · 0.80
operator()Method · 0.80
_GetEncodedTextMethod · 0.80

Calls 3

dataMethod · 0.45
sizeMethod · 0.45
PutBufferMethod · 0.45

Tested by

no test coverage detected