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>
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_
std::ostream & operator<<(std::ostream &os, const WireCell::Binning &bins)
void append(const U *begin, const U *end)
std::add_rvalue_reference< T >::type declval() FMT_NOEXCEPT
If we are still before C++14, supply the fodder for doing the "indices trick".
void resize(std::size_t new_size)
void write(std::basic_ostream< Char > &os, basic_buffer< Char > &buf)
#define FMT_END_NAMESPACE
std::basic_string< FMT_CHAR(S)> format(const S &format_str, const Args &... args)
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)
dummy_string_view to_string_view(...)
void vprint(std::basic_ostream< Char > &os, basic_string_view< Char > format_str, basic_format_args< typename buffer_context< Char >::type > args)
std::size_t size() const FMT_NOEXCEPT
void push_back(const T &value)
basic_buffer< char > buffer
std::enable_if< internal::is_string< S >::value >::type print(std::basic_ostream< FMT_CHAR(S)> &os, const S &format_str, const Args &... args)
FMT_CONSTEXPR std::make_unsigned< Int >::type to_unsigned(Int value)
void format_value(basic_buffer< Char > &buffer, const T &value)