MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / StdStringFromFormatV

Function StdStringFromFormatV

common/StringUtil.cpp:30–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28 }
29
30 std::string StdStringFromFormatV(const char* format, std::va_list ap)
31 {
32 std::va_list ap_copy;
33 va_copy(ap_copy, ap);
34
35#ifdef _WIN32
36 int len = _vscprintf(format, ap_copy);
37#else
38 int len = std::vsnprintf(nullptr, 0, format, ap_copy);
39#endif
40 va_end(ap_copy);
41
42 std::string ret;
43
44 // If an encoding error occurs, len is -1. Which we definitely don't want to resize to.
45 if (len > 0)
46 {
47 ret.resize(len);
48 std::vsnprintf(ret.data(), ret.size() + 1, format, ap);
49 }
50
51 return ret;
52 }
53
54 bool WildcardMatch(const char* subject, const char* mask, bool case_sensitive /*= true*/)
55 {

Callers 15

reportErrorMethod · 0.85
GetDrawDumpPathMethod · 0.85
LogAVErrorMethod · 0.85
PushDebugGroupMethod · 0.85
InsertDebugMessageMethod · 0.85
ExecuteCommandBufferMethod · 0.85
LogVulkanResultMethod · 0.85
SetObjectNameFunction · 0.85
PushDebugGroupMethod · 0.85

Calls 3

resizeMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected