MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / string_format

Function string_format

subprojects/llama.cpp/common/common.cpp:399–412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

397//
398
399std::string string_format(const char * fmt, ...) {
400 va_list ap;
401 va_list ap2;
402 va_start(ap, fmt);
403 va_copy(ap2, ap);
404 int size = vsnprintf(NULL, 0, fmt, ap);
405 GGML_ASSERT(size >= 0 && size < INT_MAX); // NOLINT
406 std::vector<char> buf(size + 1);
407 int size2 = vsnprintf(buf.data(), size + 1, fmt, ap2);
408 GGML_ASSERT(size2 == size);
409 va_end(ap2);
410 va_end(ap);
411 return std::string(buf.data(), size);
412}
413
414std::string string_strip(const std::string & str) {
415 size_t start = 0;

Callers 14

to_argsMethod · 0.70
set_optionMethod · 0.70
apply_to_paramsMethod · 0.70
load_from_iniMethod · 0.70
load_from_models_dirMethod · 0.70
read_fileFunction · 0.70
common_params_parse_exFunction · 0.70
parse_device_listFunction · 0.70
common_params_to_mapFunction · 0.70
read_fileFunction · 0.70
write_fileFunction · 0.70

Calls 2

stringClass · 0.85
dataMethod · 0.45

Tested by

no test coverage detected