22 template <
class Char>
class formatbuf :
public std::basic_streambuf<Char> {
24 using int_type =
typename std::basic_streambuf<Char>::int_type;
25 using traits_type =
typename std::basic_streambuf<Char>::traits_type;
41 if (!traits_type::eq_int_type(ch, traits_type::eof()))
56 template <
typename Char>
struct test_stream : std::basic_ostream<Char> {
62 template <
typename Char,
typename Traits>
63 void_t<> operator<<(std::basic_ostream<Char, Traits>&, Char);
64 template <
typename Char,
typename Traits>
65 void_t<> operator<<(std::basic_ostream<Char, Traits>&, char);
66 template <
typename Traits>
67 void_t<> operator<<(std::basic_ostream<char, Traits>&, char);
68 template <
typename Traits>
69 void_t<> operator<<(std::basic_ostream<char, Traits>&,
signed char);
70 template <
typename Traits>
71 void_t<> operator<<(std::basic_ostream<char, Traits>&,
unsigned char);
79 << std::declval<U>()),
83 template <
typename>
static std::false_type test(...);
85 using result = decltype(test<T>(0));
94 template <
typename Char>
96 const Char* buf_data = buf.
data();
98 unsigned_streamsize
size = buf.
size();
99 unsigned_streamsize max_size =
to_unsigned(max_value<std::streamsize>());
101 unsigned_streamsize
n = size <= max_size ? size : max_size;
102 os.write(buf_data, static_cast<std::streamsize>(n));
108 template <
typename Char,
typename T>
112 std::basic_ostream<Char> output(&format_buf);
113 #if !defined(FMT_STATIC_THOUSANDS_SEPARATOR)
114 if (loc) output.imbue(loc.get<std::locale>());
117 output.exceptions(std::ios_base::failbit | std::ios_base::badbit);
122 template <
typename T,
typename Char>
124 :
private formatter<basic_string_view<Char>, Char> {
126 -> decltype(ctx.begin()) {
129 template <
typename ParseCtx,
132 auto parse(ParseCtx& ctx) -> decltype(ctx.begin()) {
136 template <
typename OutputIt>
144 template <
typename OutputIt>
149 return std::copy(buffer.begin(), buffer.end(), ctx.out());
155 template <
typename Char>
173 template <
typename S,
typename... Args,
175 void print(std::basic_ostream<Char>& os,
const S& format_str, Args&&...
args) {
177 fmt::make_args_checked<Args...>(format_str,
args...));
181 #endif // FMT_OSTREAM_H_
FMT_CONSTEXPR auto to_unsigned(Int value) -> typename std::make_unsigned< Int >::type
auto data() FMT_NOEXCEPT-> T *
#define FMT_ENABLE_IF(...)
typename std::enable_if< B, T >::type enable_if_t
Define Imath::enable_if_t to be std for C++14, equivalent for C++11.
GLenum GLuint GLenum GLsizei const GLchar * buf
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
GLsizei const GLfloat * value
void vformat_to(buffer< Char > &buf, basic_string_view< Char > fmt, basic_format_args< FMT_BUFFER_CONTEXT(type_identity_t< Char >)> args, detail::locale_ref loc={})
void push_back(const T &value)
#define FMT_END_NAMESPACE
FMT_MODULE_EXPORT void vprint(std::basic_ostream< Char > &os, basic_string_view< Char > format_str, basic_format_args< buffer_context< type_identity_t< Char >>> args)
void write_buffer(std::basic_ostream< Char > &os, buffer< Char > &buf)
FMT_INLINE auto to_string_view(const Char *s) -> basic_string_view< Char >
GLint GLint GLsizei GLint GLenum format
void try_resize(size_t count)
void format_value(buffer< Char > &buf, const T &value, locale_ref loc=locale_ref())
typename type_identity< T >::type type_identity_t
**If you just want to fire and args
FMT_MODULE_EXPORT void print(std::basic_ostream< Char > &os, const S &format_str, Args &&...args)
#define FMT_BEGIN_NAMESPACE
void append(const U *begin, const U *end)
auto size() const FMT_NOEXCEPT-> size_t
#define FMT_MODULE_EXPORT
std::integral_constant< bool, B > bool_constant