10 #ifndef FMT_OSTREAM_H_ 11 #define FMT_OSTREAM_H_ 21 class FormatBuf :
public std::basic_streambuf<Char> {
23 typedef typename std::basic_streambuf<Char>::int_type
int_type;
24 typedef typename std::basic_streambuf<Char>::traits_type
traits_type;
31 this->setp(start_, start_ + buffer_.
capacity());
34 int_type
overflow(int_type ch = traits_type::eof()) {
35 if (!traits_type::eq_int_type(ch, traits_type::eof())) {
36 size_t buf_size =
size();
41 start_[buf_size] = traits_type::to_char_type(ch);
42 this->setp(start_+ buf_size + 1, start_ + buf_size * 2);
57 void operator<<(Null<>);
75 template <
typename Char,
typename ArgFormatter,
typename T>
77 const Char *&format_str,
const T &
value) {
81 std::basic_ostream<Char> output(&format_buf);
86 format_str = f.
format(format_str, MakeArg(str));
102 #ifdef FMT_HEADER_ONLY 106 #endif // FMT_OSTREAM_H_
void format_arg(Formatter &, const Char *, const T &)
FMT_FUNC void write(std::ostream &os, Writer &w)
GLsizei const GLfloat * value
Yes & convert(fmt::ULongLong)
GLubyte GLubyte GLubyte GLubyte w
void reserve(std::size_t capacity)
MakeUnsigned< Int >::Type to_unsigned(Int value)
No & operator<<(std::ostream &, int)
FMT_FUNC void print(std::FILE *f, CStringRef format_str, ArgList args)
std::size_t capacity() const
void resize(std::size_t new_size)