Wrapper around sibr::sprintf that returns a string
| 99 | |
| 100 | /// Wrapper around sibr::sprintf that returns a string |
| 101 | std::string sprint(const char *msg, ...) |
| 102 | { |
| 103 | #define TEMP_STR_SIZE 4096 |
| 104 | va_list args; |
| 105 | va_start(args, msg); |
| 106 | char s_StrSingle[TEMP_STR_SIZE]; |
| 107 | #ifdef WIN32 |
| 108 | vsprintf_s(s_StrSingle, TEMP_STR_SIZE, msg, args); |
| 109 | #else |
| 110 | vsnprintf(s_StrSingle, TEMP_STR_SIZE, msg, args); |
| 111 | #endif |
| 112 | va_end(args); |
| 113 | return std::string(s_StrSingle); |
| 114 | #undef TEMP_STR_SIZE |
| 115 | } |
| 116 | |
| 117 | int sprintf(char* buffer, size_t size, const char* format, ...) |
| 118 | { |