MCPcopy Create free account
hub / github.com/MJx0/KittyMemoryEx / fmt

Method fmt

KittyMemoryEx/KittyUtils.cpp:306–327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

304 }
305
306 std::string String::fmt(const char *fmt, ...)
307 {
308 if (!fmt)
309 return "";
310
311 va_list args;
312 va_start(args, fmt);
313 int size = vsnprintf(nullptr, 0, fmt, args);
314 va_end(args);
315
316 if (size <= 0)
317 return "";
318
319 std::string str;
320 str.resize(static_cast<size_t>(size));
321
322 va_start(args, fmt);
323 vsnprintf(&str[0], static_cast<size_t>(size) + 1, fmt, args);
324 va_end(args);
325
326 return str;
327 }
328
329 bool Data::fromHex(std::string in, void *data)
330 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected