28 #ifndef FMT_OSTREAM_H_ 29 #define FMT_OSTREAM_H_ 39 class FormatBuf :
public std::basic_streambuf<Char> {
42 typedef typename std::basic_streambuf<Char>::traits_type
traits_type;
49 this->setp(start_, start_ + buffer_.
capacity());
52 int_type
overflow(int_type ch = traits_type::eof()) {
53 if (!traits_type::eq_int_type(ch, traits_type::eof())) {
54 size_t buf_size =
size();
59 start_[buf_size] = traits_type::to_char_type(ch);
60 this->setp(start_+ buf_size + 1, start_ + buf_size * 2);
75 void operator<<(Null<>);
90 template <
typename Char,
typename ArgFormatter,
typename T>
92 const Char *&format_str,
const T &
value) {
96 std::basic_ostream<Char> output(&format_buf);
101 format_str = f.
format(format_str, MakeArg(str));
129 #ifdef FMT_HEADER_ONLY 133 #endif // FMT_OSTREAM_H_
void resize(std::size_t new_size)
FMT_API void print(std::FILE *f, CStringRef format_str, ArgList args)
std::string format(CStringRef format_str, ArgList args)
std::size_t capacity() const
Yes & convert(fmt::ULongLong)
static constexpr bool value
FMT_FUNC int fprintf(std::ostream &os, CStringRef format, ArgList args)
MakeUnsigned< Int >::Type to_unsigned(Int value)
No & operator<<(std::ostream &, int)
void reserve(std::size_t capacity)