Switch to vformat_to
Drive-by: reduce the amount of occurences of #ifdef SPDLOG_USE_STD_FORMAT
This commit is contained in:
@@ -23,6 +23,20 @@ inline spdlog::string_view_t to_string_view(const memory_buf_t &buf) SPDLOG_NOEX
|
||||
return spdlog::string_view_t{buf.data(), buf.size()};
|
||||
}
|
||||
|
||||
#ifdef SPDLOG_USE_STD_FORMAT
|
||||
template<typename T>
|
||||
std::basic_string<T> to_string(const std::basic_string<T> &buf)
|
||||
{
|
||||
return buf;
|
||||
}
|
||||
#else
|
||||
template<typename T, size_t Size>
|
||||
std::basic_string<T> to_string(const fmt::basic_memory_buffer<T, Size> &buf)
|
||||
{
|
||||
return fmt::to_string(buf);
|
||||
}
|
||||
#endif
|
||||
|
||||
inline void append_string_view(spdlog::string_view_t view, memory_buf_t &dest)
|
||||
{
|
||||
auto *buf_ptr = view.data();
|
||||
|
||||
@@ -388,11 +388,7 @@ SPDLOG_INLINE std::string filename_to_str(const filename_t &filename)
|
||||
{
|
||||
memory_buf_t buf;
|
||||
wstr_to_utf8buf(filename, buf);
|
||||
# ifdef SPDLOG_USE_STD_FORMAT
|
||||
return buf;
|
||||
# else
|
||||
return fmt::to_string(buf);
|
||||
# endif
|
||||
return fmt_helper::to_string(buf);
|
||||
}
|
||||
#else
|
||||
SPDLOG_INLINE std::string filename_to_str(const filename_t &filename)
|
||||
|
||||
Reference in New Issue
Block a user