remove Mu::format, use mu_format

Use the new fmt-based formatting.
This commit is contained in:
Dirk-Jan C. Binnema
2023-08-19 17:13:01 +03:00
parent ce397f3c25
commit 15f08488d3
10 changed files with 52 additions and 139 deletions

View File

@ -44,7 +44,6 @@
#include <glib/gprintf.h>
#include "mu-utils.hh"
#include "mu-utils-format.hh"
#include "mu-error.hh"
#include "mu-option.hh"
@ -306,34 +305,6 @@ Mu::quote(const std::string& str)
return res + "\"";
}
std::string
Mu::format(const char* frm, ...)
{
va_list args;
va_start(args, frm);
auto str = vformat(frm, args);
va_end(args);
return str;
}
std::string
Mu::vformat(const char* frm, va_list args)
{
char* s{};
const auto res = g_vasprintf(&s, frm, args);
if (res == -1) {
std::cerr << "string format failed" << std::endl;
return {};
}
std::string str{s};
g_free(s);
return str;
}
static Option<::time_t>
delta_ymwdhMs(const std::string& expr)
{