MCPcopy Create free account
hub / github.com/aseprite/laf / string_vprintf

Function string_vprintf

base/string.cpp:74–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74std::string string_vprintf(const char* format, va_list ap)
75{
76 std::vector<char> buf(1, 0);
77 std::va_list ap2;
78 va_copy(ap2, ap);
79 const size_t required_size = std::vsnprintf(nullptr, 0, format, ap);
80 if (required_size > 0) {
81 buf.resize(required_size + 1);
82 std::vsnprintf(buf.data(), buf.size(), format, ap2);
83 }
84 va_end(ap2);
85 return std::string(buf.data());
86}
87
88std::string string_to_lower(const std::string& original)
89{

Callers 2

string_printfFunction · 0.85
ExceptionMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected