18 class formatbuf :
public std::basic_streambuf<Char> {
21 typedef typename std::basic_streambuf<Char>::traits_type traits_type;
37 if (!traits_type::eq_int_type(ch, traits_type::eof()))
43 buffer_.
append(s, s + count);
48 template <
typename Char>
53 void operator<<(
null);
57 template <
typename T,
typename Char>
63 << internal::declval<U>(), std::true_type()) test(
int);
66 static std::false_type test(...);
68 typedef decltype(test<T>(0)) result;
71 static const bool value = result::value;
75 template <
typename Char>
79 UnsignedStreamSize size = buf.
size();
80 UnsignedStreamSize max_size =
83 UnsignedStreamSize n = size <= max_size ? size : max_size;
84 os.write(data, static_cast<std::streamsize>(n));
90 template <
typename Char,
typename T>
93 std::basic_ostream<Char> output(&format_buf);
94 output.exceptions(std::ios_base::failbit | std::ios_base::badbit);
102 template <
typename T,
typename Char>
104 static const bool value =
110 template <
typename T,
typename Char>
112 typename
std::enable_if<
113 internal::is_streamable<T, Char>::value &&
114 !internal::format_type<
115 typename buffer_context<Char>::type, T>::value>
::type>
116 :
formatter<basic_string_view<Char>, Char> {
118 template <
typename Context>
119 auto format(
const T &value, Context &ctx) -> decltype(ctx.out()) {
127 template <
typename Char>
128 inline void vprint(std::basic_ostream<Char> &os,
144 template <
typename S,
typename... Args>
145 inline typename std::enable_if<internal::is_string<S>::value>
::type 147 const Args & ... args) {
153 #endif // FMT_OSTREAM_H_
void write(std::basic_ostream< Char > &os, basic_buffer< Char > &buf)
#define FMT_END_NAMESPACE
buffer_context< Char >::type::iterator vformat_to(internal::basic_buffer< Char > &buf, basic_string_view< Char > format_str, basic_format_args< typename buffer_context< Char >::type > args)
basic_buffer< char > buffer
void resize(std::size_t new_size)
void push_back(const T &value)
std::make_unsigned< Int >::type to_unsigned(Int value)
std::basic_string< typename char_t< S >::type > format(const S &format_str, const Args &...args)
void vprint(std::basic_ostream< Char > &os, basic_string_view< Char > format_str, basic_format_args< typename buffer_context< Char >::type > args)
string_view_t & to_string_view(spdlog::level::level_enum l) noexcept
std::add_rvalue_reference< T >::type declval()
void format_value(basic_buffer< Char > &buffer, const T &value)
std::enable_if< internal::is_string< S >::value >::type print(std::basic_ostream< typename char_t< S >::type > &os, const S &format_str, const Args &...args)
#define FMT_BEGIN_NAMESPACE
void append(const U *begin, const U *end)