MCPcopy Create free account
hub / github.com/UZ-SLAMLab/ORB_SLAM3 / formatString

Function formatString

Thirdparty/g2o/g2o/stuff/string_tools.cpp:95–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95std::string formatString(const char* fmt, ...)
96{
97 char* auxPtr = NULL;
98 va_list arg_list;
99 va_start(arg_list, fmt);
100 int numChar = vasprintf(&auxPtr, fmt, arg_list);
101 va_end(arg_list);
102 string retString;
103 if (numChar != -1)
104 retString = auxPtr;
105 else {
106 cerr << __PRETTY_FUNCTION__ << ": Error while allocating memory" << endl;
107 }
108 free(auxPtr);
109 return retString;
110}
111
112int strPrintf(std::string& str, const char* fmt, ...)
113{

Callers

nothing calls this directly

Calls 1

vasprintfFunction · 0.85

Tested by

no test coverage detected