mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-31 03:07:36 +02:00
clang-format
This commit is contained in:
@ -197,8 +197,7 @@ using internal::printf; // For printing into memory_buffer.
|
|||||||
|
|
||||||
template <typename Range> class printf_arg_formatter;
|
template <typename Range> class printf_arg_formatter;
|
||||||
|
|
||||||
template <typename OutputIt, typename Char>
|
template <typename OutputIt, typename Char> class basic_printf_context;
|
||||||
class basic_printf_context;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\rst
|
\rst
|
||||||
@ -212,6 +211,7 @@ class printf_arg_formatter
|
|||||||
public internal::arg_formatter_base<Range> {
|
public internal::arg_formatter_base<Range> {
|
||||||
public:
|
public:
|
||||||
typedef decltype(internal::declval<Range>().begin()) iterator;
|
typedef decltype(internal::declval<Range>().begin()) iterator;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef typename Range::value_type char_type;
|
typedef typename Range::value_type char_type;
|
||||||
typedef internal::arg_formatter_base<Range> base;
|
typedef internal::arg_formatter_base<Range> base;
|
||||||
@ -326,8 +326,7 @@ template <typename T> struct printf_formatter {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** This template formats data and writes the output to a writer. */
|
/** This template formats data and writes the output to a writer. */
|
||||||
template <typename OutputIt, typename Char>
|
template <typename OutputIt, typename Char> class basic_printf_context {
|
||||||
class basic_printf_context {
|
|
||||||
public:
|
public:
|
||||||
/** The character type for the output. */
|
/** The character type for the output. */
|
||||||
typedef Char char_type;
|
typedef Char char_type;
|
||||||
@ -377,7 +376,8 @@ class basic_printf_context {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Formats stored arguments and writes the output to the range. */
|
/** Formats stored arguments and writes the output to the range. */
|
||||||
template<typename ArgFormatter = printf_arg_formatter<back_insert_range<internal::buffer<Char>>>>
|
template <typename ArgFormatter =
|
||||||
|
printf_arg_formatter<back_insert_range<internal::buffer<Char>>>>
|
||||||
OutputIt format();
|
OutputIt format();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -714,8 +714,8 @@ inline int vfprintf(
|
|||||||
|
|
||||||
/** Formats arguments and writes the output to the range. */
|
/** Formats arguments and writes the output to the range. */
|
||||||
template <typename ArgFormatter, typename Char,
|
template <typename ArgFormatter, typename Char,
|
||||||
typename Context = basic_printf_context<
|
typename Context =
|
||||||
typename ArgFormatter::iterator, Char>>
|
basic_printf_context<typename ArgFormatter::iterator, Char>>
|
||||||
typename ArgFormatter::iterator vprintf(internal::buffer<Char>& out,
|
typename ArgFormatter::iterator vprintf(internal::buffer<Char>& out,
|
||||||
basic_string_view<Char> format_str,
|
basic_string_view<Char> format_str,
|
||||||
basic_format_args<Context> args) {
|
basic_format_args<Context> args) {
|
||||||
@ -724,7 +724,6 @@ typename ArgFormatter::iterator vprintf(internal::buffer<Char>& out,
|
|||||||
return iter;
|
return iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\rst
|
\rst
|
||||||
Prints formatted data to the stream *os*.
|
Prints formatted data to the stream *os*.
|
||||||
|
@ -556,7 +556,8 @@ TEST(PrintfTest, VSPrintfMakeWArgsExample) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
typedef fmt::printf_arg_formatter<
|
typedef fmt::printf_arg_formatter<
|
||||||
fmt::back_insert_range<fmt::internal::buffer<char>>> formatter_t;
|
fmt::back_insert_range<fmt::internal::buffer<char>>>
|
||||||
|
formatter_t;
|
||||||
typedef fmt::basic_printf_context<formatter_t::iterator, char> context_t;
|
typedef fmt::basic_printf_context<formatter_t::iterator, char> context_t;
|
||||||
|
|
||||||
// A custom printf argument formatter that doesn't print `-` for floating-point
|
// A custom printf argument formatter that doesn't print `-` for floating-point
|
||||||
@ -565,7 +566,8 @@ class custom_printf_arg_formatter : public formatter_t {
|
|||||||
public:
|
public:
|
||||||
using formatter_t::iterator;
|
using formatter_t::iterator;
|
||||||
|
|
||||||
custom_printf_arg_formatter(formatter_t::iterator iter, formatter_t::format_specs& spec, context_t& ctx)
|
custom_printf_arg_formatter(formatter_t::iterator iter,
|
||||||
|
formatter_t::format_specs& spec, context_t& ctx)
|
||||||
: formatter_t(iter, spec, ctx) {}
|
: formatter_t(iter, spec, ctx) {}
|
||||||
|
|
||||||
using formatter_t::operator();
|
using formatter_t::operator();
|
||||||
@ -580,7 +582,8 @@ class custom_printf_arg_formatter : public formatter_t {
|
|||||||
if (round(value * pow(10, spec()->precision)) == 0.0) value = 0;
|
if (round(value * pow(10, spec()->precision)) == 0.0) value = 0;
|
||||||
return formatter_t::operator()(value);
|
return formatter_t::operator()(value);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
;
|
||||||
|
|
||||||
typedef fmt::basic_format_args<context_t> format_args_t;
|
typedef fmt::basic_format_args<context_t> format_args_t;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user