MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / NumToString

Function NumToString

Libs/flatbuffers/util.h:125–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123// In contrast to std::stringstream, "char" values are
124// converted to a string of digits, and we don't use scientific notation.
125template<typename T> std::string NumToString(T t) {
126 // clang-format off
127
128 #ifndef FLATBUFFERS_PREFER_PRINTF
129 std::stringstream ss;
130 ss << t;
131 return ss.str();
132 #else // FLATBUFFERS_PREFER_PRINTF
133 auto v = static_cast<long long>(t);
134 return NumToStringImplWrapper(v, "%.*lld");
135 #endif // FLATBUFFERS_PREFER_PRINTF
136 // clang-format on
137}
138// Avoid char types used as character data.
139template<> inline std::string NumToString<signed char>(signed char t) {
140 return NumToString(static_cast<int>(t));

Callers 10

ToStringMethod · 0.85
ToStringMethod · 0.85
NumToString<signed char>Function · 0.85
NumToString<char>Function · 0.85
NamedMethod · 0.85
LongMethod · 0.85
ULongMethod · 0.85
FloatMethod · 0.85
DoubleMethod · 0.85

Calls 2

NumToStringImplWrapperFunction · 0.85
strMethod · 0.45

Tested by

no test coverage detected