| 304 | cleaned.push_back(c); |
| 305 | } |
| 306 | } |
| 307 | hex = std::move(cleaned); |
| 308 | } |
| 309 | |
| 310 | return true; |
| 311 | } |
| 312 | |
| 313 | std::string String::fmt(const char *fmt, ...) |
| 314 | { |
| 315 | if (!fmt) |
| 316 | return ""; |
| 317 | |
| 318 | va_list args; |
| 319 | va_start(args, fmt); |
| 320 | int size = vsnprintf(nullptr, 0, fmt, args); |
| 321 | va_end(args); |
| 322 | |
| 323 | if (size <= 0) |
| 324 | return ""; |
| 325 | |
| 326 | std::string str; |
| 327 | str.resize(static_cast<size_t>(size)); |
| 328 | |
| 329 | va_start(args, fmt); |
| 330 | vsnprintf(&str[0], static_cast<size_t>(size) + 1, fmt, args); |
nothing calls this directly
no outgoing calls
no test coverage detected