14 namespace fmt_helper {
16 template<
size_t Buffer_Size>
22 template<
size_t Buffer_Size1,
size_t Buffer_Size2>
25 auto *buf_ptr = buf.
data();
29 template<
size_t Buffer_Size>
32 auto *buf_ptr = view.
data();
33 if (buf_ptr !=
nullptr)
39 template<
typename T,
size_t Buffer_Size>
49 using count_type =
typename std::conditional<(sizeof(T) >
sizeof(uint32_t)), uint64_t, uint32_t>
::type;
53 template<
size_t Buffer_Size>
62 dest.
push_back(static_cast<char>(
'0' + n / 10));
63 dest.
push_back(static_cast<char>(
'0' + n % 10));
68 dest.
push_back(static_cast<char>(
'0' + n));
76 template<
typename T,
size_t Buffer_Size>
79 static_assert(std::is_unsigned<T>::value,
"pad_uint must get unsigned T");
83 const char *zeroes =
"0000000000000000000";
84 dest.
append(zeroes, zeroes + width - digits);
89 template<
typename T,
size_t Buffer_Size>
95 template<
typename T,
size_t Buffer_Size>
101 template<
typename T,
size_t Buffer_Size>
110 template<
typename ToDuration>
113 using std::chrono::duration_cast;
114 using std::chrono::seconds;
115 auto duration = tp.time_since_epoch();
116 auto secs = duration_cast<seconds>(duration);
117 return duration_cast<ToDuration>(duration) - duration_cast<ToDuration>(secs);
void append_int(T n, fmt::basic_memory_buffer< char, Buffer_Size > &dest)
void pad3(T n, fmt::basic_memory_buffer< char, Buffer_Size > &dest)
void append_buf(const fmt::basic_memory_buffer< char, Buffer_Size1 > &buf, fmt::basic_memory_buffer< char, Buffer_Size2 > &dest)
void pad6(T n, fmt::basic_memory_buffer< char, Buffer_Size > &dest)
void append_string_view(spdlog::string_view_t view, fmt::basic_memory_buffer< char, Buffer_Size > &dest)
void pad9(T n, fmt::basic_memory_buffer< char, Buffer_Size > &dest)
void push_back(const T &value)
void pad_uint(T n, unsigned int width, fmt::basic_memory_buffer< char, Buffer_Size > &dest)
fmt::string_view string_view_t
std::enable_if< is_contiguous< Container >::value &&internal::is_string< S >::value, std::back_insert_iterator< Container > >::type format_to(std::back_insert_iterator< Container > out, const S &format_str, const Args &...args)
const Char * data() const
void pad2(int n, fmt::basic_memory_buffer< char, Buffer_Size > &dest)
ToDuration time_fraction(const log_clock::time_point &tp)
spdlog::string_view_t to_string_view(const fmt::basic_memory_buffer< char, Buffer_Size > &buf) SPDLOG_NOEXCEPT
unsigned count_digits(T n)
void append(const U *begin, const U *end)