move Glib ustring format helper to utils
this formatter is useful for other modules which want to print Glib exceptions messages
This commit is contained in:
parent
12caae8fd2
commit
d4da04a750
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <glibmm/ustring.h>
|
||||
|
||||
class pow_format {
|
||||
public:
|
||||
|
@ -84,5 +85,15 @@ namespace fmt {
|
|||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Glib ustirng support
|
||||
template <>
|
||||
struct formatter<Glib::ustring> : formatter<std::string> {
|
||||
template <typename FormatContext>
|
||||
auto format(const Glib::ustring& value, FormatContext& ctx) {
|
||||
return formatter<std::string>::format(value, ctx);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -8,13 +8,7 @@
|
|||
#include <fstream>
|
||||
#include <map>
|
||||
|
||||
template <>
|
||||
struct fmt::formatter<Glib::ustring> : formatter<std::string> {
|
||||
template <typename FormatContext>
|
||||
auto format(const Glib::ustring& value, FormatContext& ctx) {
|
||||
return formatter<std::string>::format(value, ctx);
|
||||
}
|
||||
};
|
||||
#include "util/format.hpp"
|
||||
|
||||
template <>
|
||||
struct fmt::formatter<Glib::VariantBase> : formatter<std::string> {
|
||||
|
|
Loading…
Reference in New Issue