MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / NumToString

Function NumToString

native/thirdpart/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 15

MessageMethod · 0.85
RecurseErrorMethod · 0.85
TypeToIntervalStringFunction · 0.85
ParseHexNumMethod · 0.85
NextMethod · 0.85
ParseFieldMethod · 0.85
ParseStringMethod · 0.85
ParseAnyValueMethod · 0.85
ParseTableMethod · 0.85
ParseAlignAttributeMethod · 0.85
ParseNestedFlatbufferMethod · 0.85
ParseEnumFromStringMethod · 0.85

Calls 2

NumToStringImplWrapperFunction · 0.85
strMethod · 0.45

Tested by

no test coverage detected