MCPcopy Create free account
hub / github.com/WebAssembly/wabt / StringPrintf

Function StringPrintf

include/wabt/string-format.h:53–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51
52inline std::string WABT_PRINTF_FORMAT(1, 2)
53 StringPrintf(const char* format, ...) {
54 va_list args;
55 va_list args_copy;
56 va_start(args, format);
57 va_copy(args_copy, args);
58 size_t len = wabt_vsnprintf(nullptr, 0, format, args) + 1; // For \0.
59 std::vector<char> buffer(len);
60 va_end(args);
61 wabt_vsnprintf(buffer.data(), len, format, args_copy);
62 va_end(args_copy);
63 return std::string(buffer.data(), len - 1);
64}
65
66} // namespace wabt
67

Callers 15

FormatErrorFunction · 0.85
CheckTypeIndexFunction · 0.85
CheckTypesFunction · 0.85
ResolveTargetRefTypeMethod · 0.85
BlockSigToStringMethod · 0.85
SanitizeForCommentFunction · 0.85
MangleMethod · 0.85
CommandRunnerMethod · 0.85
ReadInvalidModuleMethod · 0.85
ReadMalformedModuleMethod · 0.85

Calls 2

wabt_vsnprintfFunction · 0.85
dataMethod · 0.80

Tested by 4

CommandRunnerMethod · 0.68
ReadInvalidModuleMethod · 0.68
ReadMalformedModuleMethod · 0.68
ExpectedValueToStringFunction · 0.68