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

Function NumToStringImplWrapper

native/thirdpart/flatbuffers/util.h:113–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111
112template<typename T>
113std::string NumToStringImplWrapper(T t, const char *fmt, int precision = 0) {
114 size_t string_width = NumToStringWidth(t, precision);
115 std::string s(string_width, 0x00);
116 // Allow snprintf to use std::string trailing null to detect buffer overflow
117 snprintf(const_cast<char *>(s.data()), (s.size() + 1), fmt, string_width, t);
118 return s;
119}
120#endif // FLATBUFFERS_PREFER_PRINTF
121
122// Convert an integer or floating point value to a string.

Callers 3

NumToStringFunction · 0.85
FloatToStringFunction · 0.85
IntToStringHexFunction · 0.85

Calls 3

NumToStringWidthFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected