Agora
1.2.0
Agora project
|
Namespaces | |
align | |
detail | |
detail_exported | |
literals | |
safe_duration_cast | |
sign | |
Typedefs | |
template<bool B, typename T = void> | |
using | enable_if_t = typename std::enable_if< B, T >::type |
template<bool B, typename T , typename F > | |
using | conditional_t = typename std::conditional< B, T, F >::type |
template<bool B> | |
using | bool_constant = std::integral_constant< bool, B > |
template<typename T > | |
using | remove_reference_t = typename std::remove_reference< T >::type |
template<typename T > | |
using | remove_const_t = typename std::remove_const< T >::type |
template<typename T > | |
using | remove_cvref_t = typename std::remove_cv< remove_reference_t< T > >::type |
template<typename T > | |
using | type_identity_t = typename type_identity< T >::type |
using | string_view = basic_string_view< char > |
template<typename S > | |
using | char_t = typename detail::char_t_impl< S >::type |
using | format_parse_context = basic_format_parse_context< char > |
template<typename T , typename Context > | |
using | has_formatter = std::is_constructible< typename Context::template formatter_type< T > > |
template<typename Char > | |
using | buffer_context = basic_format_context< detail::buffer_appender< Char >, Char > |
using | format_context = buffer_context< char > |
template<typename T , typename Char = char> | |
using | is_formattable = bool_constant< !std::is_base_of< detail::unformattable, decltype(detail::arg_mapper< buffer_context< Char > >().map(std::declval< T >()))>::value &&!detail::has_fallback_formatter< T, Char >::value > |
using | format_args = basic_format_args< format_context > |
using | align_t = align::type |
using | sign_t = sign::type |
using | format_specs = basic_format_specs< char > |
template<typename... Args> | |
using | format_string = basic_format_string< char, type_identity_t< Args >... > |
using | memory_buffer = basic_memory_buffer< char > |
template<typename It , typename Sentinel , typename Char > | |
using | arg_join = join_view< It, Sentinel, Char > |
using | cstring_view = basic_cstring_view< char > |
using | wcstring_view = basic_cstring_view< wchar_t > |
template<typename Char > | |
using | basic_printf_context_t = basic_printf_context< detail::buffer_appender< Char >, Char > |
using | printf_context = basic_printf_context_t< char > |
using | wprintf_context = basic_printf_context_t< wchar_t > |
using | printf_args = basic_format_args< printf_context > |
using | wprintf_args = basic_format_args< wprintf_context > |
template<typename Char , typename... T> | |
using | tuple_arg_join = tuple_join_view< Char, T... > |
using | wstring_view = basic_string_view< wchar_t > |
using | wformat_parse_context = basic_format_parse_context< wchar_t > |
using | wformat_context = buffer_context< wchar_t > |
using | wformat_args = basic_format_args< wformat_context > |
using | wmemory_buffer = basic_memory_buffer< wchar_t > |
template<typename... Args> | |
using | wformat_string = basic_format_string< wchar_t, type_identity_t< Args >... > |
Functions | |
std::tm | localtime (std::time_t time) |
std::tm | localtime (std::chrono::time_point< std::chrono::system_clock > time_point) |
std::tm | gmtime (std::time_t time) |
std::tm | gmtime (std::chrono::time_point< std::chrono::system_clock > time_point) |
text_style | fg (detail::color_type foreground) throw () |
text_style | bg (detail::color_type background) throw () |
text_style | operator| (emphasis lhs, emphasis rhs) throw () |
template<typename S , typename Char = char_t<S>> | |
void | vprint (std::FILE *f, const text_style &ts, const S &format, basic_format_args< buffer_context< type_identity_t< Char >>> args) |
template<typename S , typename... Args, enable_if_t<(detail::is_string< S >::value), int > = 0> | |
void | print (std::FILE *f, const text_style &ts, const S &format_str, const Args &... args) |
template<typename S , typename... Args, enable_if_t<(detail::is_string< S >::value), int > = 0> | |
void | print (const text_style &ts, const S &format_str, const Args &... args) |
template<typename S , typename Char = char_t<S>> | |
std::basic_string< Char > | vformat (const text_style &ts, const S &format_str, basic_format_args< buffer_context< type_identity_t< Char >>> args) |
template<typename S , typename... Args, typename Char = char_t<S>> | |
std::basic_string< Char > | format (const text_style &ts, const S &format_str, const Args &... args) |
template<typename OutputIt , typename Char , enable_if_t<(detail::is_output_iterator< OutputIt, Char >::value), int > = 0> | |
OutputIt | vformat_to (OutputIt out, const text_style &ts, basic_string_view< Char > format_str, basic_format_args< buffer_context< type_identity_t< Char >>> args) |
template<typename OutputIt , typename S , typename... Args, bool enable = detail::is_output_iterator<OutputIt, char_t<S>>::value&& detail::is_string<S>::value> | |
auto | format_to (OutputIt out, const text_style &ts, const S &format_str, Args &&... args) -> typename std::enable_if< enable, OutputIt >::type |
template<typename OutputIt , typename S , typename... Args, enable_if_t<(detail::is_compiled_string< S >::value), int > = 0> | |
format_to_n_result< OutputIt > | format_to_n (OutputIt out, size_t n, const S &format_str, Args &&... args) |
template<typename S , typename... Args, enable_if_t<(detail::is_compiled_string< S >::value), int > = 0> | |
size_t | formatted_size (const S &format_str, const Args &... args) |
template<typename S , typename... Args, enable_if_t<(detail::is_compiled_string< S >::value), int > = 0> | |
void | print (std::FILE *f, const S &format_str, const Args &... args) |
template<typename S , typename... Args, enable_if_t<(detail::is_compiled_string< S >::value), int > = 0> | |
void | print (const S &format_str, const Args &... args) |
template<typename Char , enable_if_t<(is_char< Char >::value), int > = 0> | |
auto | to_string_view (const Char *s) -> basic_string_view< Char > |
template<typename Char , typename Traits , typename Alloc > | |
auto | to_string_view (const std::basic_string< Char, Traits, Alloc > &s) -> basic_string_view< Char > |
template<typename Char > | |
constexpr auto | to_string_view (basic_string_view< Char > s) -> basic_string_view< Char > |
template<typename Char , enable_if_t<(!std::is_empty< detail::std_string_view< Char >>::value), int > = 0> | |
auto | to_string_view (detail::std_string_view< Char > s) -> basic_string_view< Char > |
template<typename S , enable_if_t<(is_compile_string< S >::value), int > = 0> | |
constexpr auto | to_string_view (const S &s) -> basic_string_view< typename S::char_type > |
template<typename Visitor , typename Context > | |
auto | visit_format_arg (Visitor &&vis, const basic_format_arg< Context > &arg) -> decltype(vis(0)) |
template<typename Context = format_context, typename... Args> | |
constexpr auto | make_format_args (Args &&... args) -> format_arg_store< Context, remove_cvref_t< Args >... > |
template<typename Char , typename T > | |
auto | arg (const Char *name, const T &arg) -> detail::named_arg< Char, T > |
template<typename S > | |
auto | runtime (const S &s) -> basic_runtime< char_t< S >> |
auto | vformat (string_view fmt, format_args args) -> std::string |
template<typename... T> | |
auto | format (format_string< T... > fmt, T &&... args) -> std::string |
template<typename OutputIt , enable_if_t<(detail::is_output_iterator< OutputIt, char >::value), int > = 0> | |
auto | vformat_to (OutputIt out, string_view fmt, format_args args) -> OutputIt |
template<typename OutputIt , typename... T, enable_if_t<(detail::is_output_iterator< OutputIt, char >::value), int > = 0> | |
auto | format_to (OutputIt out, format_string< T... > fmt, T &&... args) -> OutputIt |
template<typename OutputIt , typename... T, enable_if_t<(detail::is_output_iterator< OutputIt, char >::value), int > = 0> | |
auto | vformat_to_n (OutputIt out, size_t n, string_view fmt, format_args args) -> format_to_n_result< OutputIt > |
template<typename OutputIt , typename... T, enable_if_t<(detail::is_output_iterator< OutputIt, char >::value), int > = 0> | |
auto | format_to_n (OutputIt out, size_t n, format_string< T... > fmt, T &&... args) -> format_to_n_result< OutputIt > |
template<typename... T> | |
auto | formatted_size (format_string< T... > fmt, T &&... args) -> size_t |
void | vprint (string_view fmt, format_args args) |
void | vprint (std::FILE *f, string_view fmt, format_args args) |
template<typename... T> | |
void | print (format_string< T... > fmt, T &&... args) |
template<typename... T> | |
void | print (std::FILE *f, format_string< T... > fmt, T &&... args) |
std::system_error | vsystem_error (int error_code, string_view format_str, format_args args) |
void | format_system_error (detail::buffer< char > &out, int error_code, const char *message) throw () |
void | report_system_error (int error_code, const char *message) throw () |
template<typename... Args, typename S , typename Char = char_t<S>> | |
auto | make_args_checked (const S &fmt, const remove_reference_t< Args > &... args) -> format_arg_store< buffer_context< Char >, remove_reference_t< Args >... > |
template<typename... T> | |
auto | system_error (int error_code, format_string< T... > fmt, T &&... args) -> std::system_error |
template<typename T > | |
auto | ptr (T p) -> const void * |
template<typename T > | |
auto | ptr (const std::unique_ptr< T > &p) -> const void * |
template<typename T > | |
auto | ptr (const std::shared_ptr< T > &p) -> const void * |
template<typename T > | |
auto | group_digits (T value) -> group_digits_view< T > |
template<typename It , typename Sentinel > | |
auto | join (It begin, Sentinel end, string_view sep) -> join_view< It, Sentinel > |
template<typename Range > | |
auto | join (Range &&range, string_view sep) -> join_view< detail::iterator_t< Range >, detail::sentinel_t< Range >> |
template<typename T , enable_if_t<(!std::is_integral< T >::value), int > = 0> | |
auto | to_string (const T &value) -> std::string |
template<typename T , enable_if_t<(std::is_integral< T >::value), int > = 0> | |
auto | to_string (T value) -> std::string |
template<typename Char , size_t SIZE> | |
auto | to_string (const basic_memory_buffer< Char, SIZE > &buf) -> std::basic_string< Char > |
template<typename Locale , enable_if_t<(detail::is_locale< Locale >::value), int > = 0> | |
auto | vformat (const Locale &loc, string_view fmt, format_args args) -> std::string |
template<typename Locale , typename... T, enable_if_t<(detail::is_locale< Locale >::value), int > = 0> | |
auto | format (const Locale &loc, format_string< T... > fmt, T &&... args) -> std::string |
template<typename... T, size_t SIZE, typename Allocator > | |
auto | format_to (basic_memory_buffer< char, SIZE, Allocator > &buf, format_string< T... > fmt, T &&... args) -> appender |
template<typename OutputIt , typename Locale , enable_if_t<(detail::is_output_iterator< OutputIt, char >::value &&detail::is_locale< Locale >::value), int > = 0> | |
auto | vformat_to (OutputIt out, const Locale &loc, string_view fmt, format_args args) -> OutputIt |
template<typename OutputIt , typename Locale , typename... T, enable_if_t<(detail::is_output_iterator< OutputIt, char >::value &&detail::is_locale< Locale >::value), int > = 0> | |
auto | format_to (OutputIt out, const Locale &loc, format_string< T... > fmt, T &&... args) -> OutputIt |
const std::error_category & | system_category () throw () |
template<typename Char > | |
void | vprint (std::basic_ostream< Char > &os, basic_string_view< Char > format_str, basic_format_args< buffer_context< type_identity_t< Char >>> args) |
template<typename S , typename... Args, typename Char = enable_if_t<detail::is_string<S>::value, char_t<S>>> | |
void | print (std::basic_ostream< Char > &os, const S &format_str, Args &&... args) |
template<typename... T> | |
auto | make_printf_args (const T &... args) -> format_arg_store< printf_context, T... > |
template<typename... T> | |
auto | make_wprintf_args (const T &... args) -> format_arg_store< wprintf_context, T... > |
template<typename S , typename Char = char_t<S>> | |
auto | vsprintf (const S &fmt, basic_format_args< basic_printf_context_t< type_identity_t< Char >>> args) -> std::basic_string< Char > |
template<typename S , typename... T, typename Char = enable_if_t<detail::is_string<S>::value, char_t<S>>> | |
auto | sprintf (const S &fmt, const T &... args) -> std::basic_string< Char > |
template<typename S , typename Char = char_t<S>> | |
auto | vfprintf (std::FILE *f, const S &fmt, basic_format_args< basic_printf_context_t< type_identity_t< Char >>> args) -> int |
template<typename S , typename... T, typename Char = char_t<S>> | |
auto | fprintf (std::FILE *f, const S &fmt, const T &... args) -> int |
template<typename S , typename Char = char_t<S>> | |
auto | vprintf (const S &fmt, basic_format_args< basic_printf_context_t< type_identity_t< Char >>> args) -> int |
template<typename S , typename... T, enable_if_t<(detail::is_string< S >::value), int > = 0> | |
auto | printf (const S &fmt, const T &... args) -> int |
template<typename S , typename Char = char_t<S>> | |
auto | vfprintf (std::basic_ostream< Char > &os, const S &fmt, basic_format_args< basic_printf_context_t< type_identity_t< Char >>> args) -> int |
template<typename S , typename... T, typename Char = char_t<S>> | |
auto | fprintf (std::basic_ostream< Char > &os, const S &fmt, const T &... args) -> int |
template<typename... T> | |
auto | join (const std::tuple< T... > &tuple, string_view sep) -> tuple_join_view< char, T... > |
template<typename... T> | |
auto | join (const std::tuple< T... > &tuple, basic_string_view< wchar_t > sep) -> tuple_join_view< wchar_t, T... > |
template<typename T > | |
auto | join (std::initializer_list< T > list, string_view sep) -> join_view< const T *, const T * > |
template<typename... Args> | |
constexpr format_arg_store< wformat_context, Args... > | make_wformat_args (const Args &... args) |
constexpr auto | operator""_format (const wchar_t *s, size_t n) -> detail::udl_formatter< wchar_t > |
template<typename It , typename Sentinel > | |
auto | join (It begin, Sentinel end, wstring_view sep) -> join_view< It, Sentinel, wchar_t > |
template<typename Range > | |
auto | join (Range &&range, wstring_view sep) -> join_view< detail::iterator_t< Range >, detail::sentinel_t< Range >, wchar_t > |
template<typename T > | |
auto | join (std::initializer_list< T > list, wstring_view sep) -> join_view< const T *, const T *, wchar_t > |
template<typename Char , enable_if_t<(!std::is_same< Char, char >::value), int > = 0> | |
auto | vformat (basic_string_view< Char > format_str, basic_format_args< buffer_context< type_identity_t< Char >>> args) -> std::basic_string< Char > |
template<typename S , typename... Args, typename Char = char_t<S>, enable_if_t<(!std::is_same< Char, char >::value), int > = 0> | |
auto | format (const S &format_str, Args &&... args) -> std::basic_string< Char > |
template<typename Locale , typename S , typename Char = char_t<S>, enable_if_t<(detail::is_locale< Locale >::value &&detail::is_exotic_char< Char >::value), int > = 0> | |
auto | vformat (const Locale &loc, const S &format_str, basic_format_args< buffer_context< type_identity_t< Char >>> args) -> std::basic_string< Char > |
template<typename Locale , typename S , typename... Args, typename Char = char_t<S>, enable_if_t<(detail::is_locale< Locale >::value &&detail::is_exotic_char< Char >::value), int > = 0> | |
auto | format (const Locale &loc, const S &format_str, Args &&... args) -> std::basic_string< Char > |
template<typename OutputIt , typename S , typename Char = char_t<S>, enable_if_t<(detail::is_output_iterator< OutputIt, Char >::value &&detail::is_exotic_char< Char >::value), int > = 0> | |
auto | vformat_to (OutputIt out, const S &format_str, basic_format_args< buffer_context< type_identity_t< Char >>> args) -> OutputIt |
template<typename OutputIt , typename S , typename... Args, typename Char = char_t<S>, enable_if_t<(detail::is_output_iterator< OutputIt, Char >::value &&detail::is_exotic_char< Char >::value), int > = 0> | |
auto | format_to (OutputIt out, const S &fmt, Args &&... args) -> OutputIt |
template<typename S , typename... Args, typename Char , size_t SIZE, typename Allocator , enable_if_t<(detail::is_string< S >::value), int > = 0> | |
auto | format_to (basic_memory_buffer< Char, SIZE, Allocator > &buf, const S &format_str, Args &&... args) -> typename buffer_context< Char >::iterator |
template<typename Locale , typename S , typename OutputIt , typename... Args, typename Char = char_t<S>, enable_if_t<(detail::is_output_iterator< OutputIt, Char >::value &&detail::is_locale< Locale >::value &&detail::is_exotic_char< Char >::value), int > = 0> | |
auto | vformat_to (OutputIt out, const Locale &loc, const S &format_str, basic_format_args< buffer_context< type_identity_t< Char >>> args) -> OutputIt |
template<typename OutputIt , typename Locale , typename S , typename... Args, typename Char = char_t<S>, bool enable = detail::is_output_iterator<OutputIt, Char>::value&& detail::is_locale<Locale>::value&& detail::is_exotic_char<Char>::value> | |
auto | format_to (OutputIt out, const Locale &loc, const S &format_str, Args &&... args) -> typename std::enable_if< enable, OutputIt >::type |
template<typename OutputIt , typename Char , typename... Args, enable_if_t<(detail::is_output_iterator< OutputIt, Char >::value &&detail::is_exotic_char< Char >::value), int > = 0> | |
auto | vformat_to_n (OutputIt out, size_t n, basic_string_view< Char > format_str, basic_format_args< buffer_context< type_identity_t< Char >>> args) -> format_to_n_result< OutputIt > |
template<typename OutputIt , typename S , typename... Args, typename Char = char_t<S>, enable_if_t<(detail::is_output_iterator< OutputIt, Char >::value &&detail::is_exotic_char< Char >::value), int > = 0> | |
auto | format_to_n (OutputIt out, size_t n, const S &fmt, const Args &... args) -> format_to_n_result< OutputIt > |
template<typename S , typename... Args, typename Char = char_t<S>, enable_if_t<(detail::is_exotic_char< Char >::value), int > = 0> | |
auto | formatted_size (const S &fmt, Args &&... args) -> size_t |
void | vprint (std::FILE *f, wstring_view fmt, wformat_args args) |
void | vprint (wstring_view fmt, wformat_args args) |
template<typename... T> | |
void | print (std::FILE *f, wformat_string< T... > fmt, T &&... args) |
template<typename... T> | |
void | print (wformat_string< T... > fmt, T &&... args) |
template<typename T > | |
auto | to_wstring (const T &value) -> std::wstring |
using fmt::v8::align_t = typedef align::type |
using fmt::v8::arg_join = typedef join_view<It, Sentinel, Char> |
using fmt::v8::basic_printf_context_t = typedef basic_printf_context<detail::buffer_appender<Char>, Char> |
using fmt::v8::bool_constant = typedef std::integral_constant<bool, B> |
using fmt::v8::buffer_context = typedef basic_format_context<detail::buffer_appender<Char>, Char> |
using fmt::v8::char_t = typedef typename detail::char_t_impl<S>::type |
String's character type.
using fmt::v8::conditional_t = typedef typename std::conditional<B, T, F>::type |
using fmt::v8::cstring_view = typedef basic_cstring_view<char> |
using fmt::v8::enable_if_t = typedef typename std::enable_if<B, T>::type |
using fmt::v8::format_args = typedef basic_format_args<format_context> |
An alias to basic_format_args<format_context>
.
using fmt::v8::format_context = typedef buffer_context<char> |
using fmt::v8::format_parse_context = typedef basic_format_parse_context<char> |
using fmt::v8::format_specs = typedef basic_format_specs<char> |
using fmt::v8::format_string = typedef basic_format_string<char, type_identity_t<Args>...> |
using fmt::v8::has_formatter = typedef std::is_constructible<typename Context::template formatter_type<T> > |
using fmt::v8::is_formattable = typedef bool_constant< !std::is_base_of<detail::unformattable, decltype(detail::arg_mapper<buffer_context<Char> >().map( std::declval<T>()))>::value && !detail::has_fallback_formatter<T, Char>::value> |
using fmt::v8::memory_buffer = typedef basic_memory_buffer<char> |
using fmt::v8::printf_args = typedef basic_format_args<printf_context> |
using fmt::v8::printf_context = typedef basic_printf_context_t<char> |
using fmt::v8::remove_const_t = typedef typename std::remove_const<T>::type |
using fmt::v8::remove_cvref_t = typedef typename std::remove_cv<remove_reference_t<T> >::type |
using fmt::v8::remove_reference_t = typedef typename std::remove_reference<T>::type |
using fmt::v8::sign_t = typedef sign::type |
using fmt::v8::string_view = typedef basic_string_view<char> |
using fmt::v8::tuple_arg_join = typedef tuple_join_view<Char, T...> |
using fmt::v8::type_identity_t = typedef typename type_identity<T>::type |
using fmt::v8::wcstring_view = typedef basic_cstring_view<wchar_t> |
using fmt::v8::wformat_args = typedef basic_format_args<wformat_context> |
using fmt::v8::wformat_context = typedef buffer_context<wchar_t> |
using fmt::v8::wformat_parse_context = typedef basic_format_parse_context<wchar_t> |
using fmt::v8::wformat_string = typedef basic_format_string<wchar_t, type_identity_t<Args>...> |
using fmt::v8::wmemory_buffer = typedef basic_memory_buffer<wchar_t> |
using fmt::v8::wprintf_args = typedef basic_format_args<wprintf_context> |
using fmt::v8::wprintf_context = typedef basic_printf_context_t<wchar_t> |
using fmt::v8::wstring_view = typedef basic_string_view<wchar_t> |
|
strong |
|
strong |
|
strong |
|
strong |
|
inline |
\rst Returns a named argument to be used in a formatting function. It should only be used in a call to a formatting function or dynamic_format_arg_store::push_back
.
Example**::
fmt::print("Elapsed time: {s:.2f} seconds", fmt::arg("s", 1.23)); \endrst
|
inline |
Creates a text style from the background color.
|
inline |
Creates a text style from the foreground (text) color.
|
inline |
|
inline |
auto fmt::v8::format | ( | const S & | format_str, |
Args &&... | args | ||
) | -> std::basic_string<Char> |
|
inline |
\rst Formats arguments and returns the result as a string using ANSI escape sequences to specify text formatting.
Example**::
#include <fmt/color.h> std::string message = fmt::format(fmt::emphasis::bold | fg(fmt::color::red), "The answer is {}", 42); \endrst
|
inline |
\rst Formats args
according to specifications in fmt
and returns the result as a string.
Example**::
#include <fmt/core.h> std::string message = fmt::format("The answer is {}.", 42); \endrst
void fmt::v8::format_system_error | ( | detail::buffer< char > & | out, |
int | error_code, | ||
const char * | message | ||
) | |||
throw | ( | ||
) |
\rst Formats an error message for an error returned by an operating system or a language runtime, for example a file opening error, and writes it to out. The format is the same as the one used by std::system_error(ec, message)
where ec
is std::error_code(error_code, std::generic_category()})
. It is implementation-defined but normally looks like:
.. parsed-literal:: <message>*: *<system-message>*
where *<message>* is the passed message and *<system-message>* is the system message corresponding to the error code. error_code* is a system error code as given by errno
. \endrst
auto fmt::v8::format_to | ( | basic_memory_buffer< Char, SIZE, Allocator > & | buf, |
const S & | format_str, | ||
Args &&... | args | ||
) | -> typename buffer_context<Char>::iterator |
auto fmt::v8::format_to | ( | basic_memory_buffer< char, SIZE, Allocator > & | buf, |
format_string< T... > | fmt, | ||
T &&... | args | ||
) | -> appender |
|
inline |
|
inline |
|
inline |
|
inline |
\rst Formats arguments with the given text_style, writes the result to the output iterator out
and returns the iterator past the end of the output range.
Example**::
std::vector<char> out; fmt::format_to(std::back_inserter(out), fmt::emphasis::bold | fg(fmt::color::red), "{}", 42); \endrst
|
inline |
\rst Formats args
according to specifications in fmt
, writes the result to the output iterator out
and returns the iterator past the end of the output range. format_to
does not append a terminating null character.
Example**::
auto out = std::vector<char>(); fmt::format_to(std::back_inserter(out), "{}", 42); \endrst
|
inline |
format_to_n_result<OutputIt> fmt::v8::format_to_n | ( | OutputIt | out, |
size_t | n, | ||
const S & | format_str, | ||
Args &&... | args | ||
) |
|
inline |
\rst Formats args
according to specifications in fmt
, writes up to n
characters of the result to the output iterator out
and returns the total (not truncated) output size and the iterator past the end of the output range. format_to_n
does not append a terminating null character. \endrst
|
inline |
size_t fmt::v8::formatted_size | ( | const S & | format_str, |
const Args &... | args | ||
) |
|
inline |
Returns the number of chars in the output of format(fmt, args...)
.
auto fmt::v8::fprintf | ( | std::basic_ostream< Char > & | os, |
const S & | fmt, | ||
const T &... | args | ||
) | -> int |
|
inline |
\rst Prints formatted data to the file f.
Example**::
fmt::fprintf(stderr, "Don't %s!", "panic"); \endrst
|
inline |
|
inline |
Converts given time since epoch as std::time_t
value into calendar time, expressed in Coordinated Universal Time (UTC). Unlike std::gmtime
, this function is thread-safe on most platforms.
auto fmt::v8::group_digits | ( | T | value | ) | -> group_digits_view<T> |
\rst Returns a view that formats an integer value using ',' as a locale-independent thousands separator.
Example**::
fmt::print("{}", fmt::group_digits(12345)); Output: "12,345" \endrst
auto fmt::v8::join | ( | const std::tuple< T... > & | tuple, |
basic_string_view< wchar_t > | sep | ||
) | -> tuple_join_view<wchar_t, T...> |
auto fmt::v8::join | ( | const std::tuple< T... > & | tuple, |
string_view | sep | ||
) | -> tuple_join_view<char, T...> |
\rst Returns an object that formats tuple
with elements separated by sep
.
Example**::
std::tuple<int, char> t = {1, 'a'}; fmt::print("{}", fmt::join(t, ", ")); Output: "1, a" \endrst
auto fmt::v8::join | ( | It | begin, |
Sentinel | end, | ||
string_view | sep | ||
) | -> join_view<It, Sentinel> |
Returns a view that formats the iterator range [begin, end)
with elements separated by sep
.
auto fmt::v8::join | ( | It | begin, |
Sentinel | end, | ||
wstring_view | sep | ||
) | -> join_view<It, Sentinel, wchar_t> |
auto fmt::v8::join | ( | Range && | range, |
string_view | sep | ||
) | -> join_view<detail::iterator_t<Range>, detail::sentinel_t<Range>> |
\rst Returns a view that formats range
with elements separated by sep
.
Example**::
std::vector<int> v = {1, 2, 3}; fmt::print("{}", fmt::join(v, ", ")); Output: "1, 2, 3"
fmt::join
applies passed format specifiers to the range elements::
fmt::print("{:02}", fmt::join(v, ", ")); Output: "01, 02, 03" \endrst
auto fmt::v8::join | ( | Range && | range, |
wstring_view | sep | ||
) | -> join_view<detail::iterator_t<Range>, detail::sentinel_t<Range>, wchar_t> |
auto fmt::v8::join | ( | std::initializer_list< T > | list, |
string_view | sep | ||
) | -> join_view<const T*, const T*> |
\rst Returns an object that formats initializer_list
with elements separated by sep
.
Example**::
fmt::print("{}", fmt::join({1, 2, 3}, ", ")); Output: "1, 2, 3" \endrst
auto fmt::v8::join | ( | std::initializer_list< T > | list, |
wstring_view | sep | ||
) | -> join_view<const T*, const T*, wchar_t> |
|
inline |
|
inline |
Converts given time since epoch as std::time_t
value into calendar time, expressed in local time. Unlike std::localtime
, this function is thread-safe on most platforms.
|
inline |
\rst Constructs a ~fmt::format_arg_store
object that contains references to arguments and can be implicitly converted to ~fmtformat_args
. If fmt
is a compile-time string then make_args_checked
checks its validity at compile time. \endrst
|
constexpr |
\rst Constructs a ~fmt::format_arg_store
object that contains references to arguments and can be implicitly converted to ~fmtformat_args
. Context
can be omitted in which case it defaults to ~fmt::context
. See ~fmtarg
for lifetime considerations. \endrst
|
inline |
\rst Constructs an ~fmt::format_arg_store
object that contains references to arguments and can be implicitly converted to ~fmtprintf_args
. \endrst
|
constexpr |
|
inline |
\rst Constructs an ~fmt::format_arg_store
object that contains references to arguments and can be implicitly converted to ~fmtwprintf_args
. \endrst
|
inline |
void fmt::v8::print | ( | const S & | format_str, |
const Args &... | args | ||
) |
void fmt::v8::print | ( | const text_style & | ts, |
const S & | format_str, | ||
const Args &... | args | ||
) |
\rst Formats a string and prints it to stdout using ANSI escape sequences to specify text formatting.
Example**::
fmt::print(fmt::emphasis::bold | fg(fmt::color::red), "Elapsed time: {0:.2f} seconds", 1.23); \endrst
|
inline |
\rst Formats args
according to specifications in fmt
and writes the output to stdout
.
Example**::
fmt::print("Elapsed time: {0:.2f} seconds", 1.23); \endrst
void fmt::v8::print | ( | std::basic_ostream< Char > & | os, |
const S & | format_str, | ||
Args &&... | args | ||
) |
\rst Prints formatted data to the stream os.
Example**::
fmt::print(cerr, "Don't {}!", "panic"); \endrst
void fmt::v8::print | ( | std::FILE * | f, |
const S & | format_str, | ||
const Args &... | args | ||
) |
void fmt::v8::print | ( | std::FILE * | f, |
const text_style & | ts, | ||
const S & | format_str, | ||
const Args &... | args | ||
) |
\rst Formats a string and prints it to the specified file stream using ANSI escape sequences to specify text formatting.
Example**::
fmt::print(fmt::emphasis::bold | fg(fmt::color::red), "Elapsed time: {0:.2f} seconds", 1.23); \endrst
|
inline |
\rst Formats args
according to specifications in fmt
and writes the output to the file f
.
Example**::
fmt::print(stderr, "Don't {}!", "panic"); \endrst
void fmt::v8::print | ( | std::FILE * | f, |
wformat_string< T... > | fmt, | ||
T &&... | args | ||
) |
void fmt::v8::print | ( | wformat_string< T... > | fmt, |
T &&... | args | ||
) |
|
inline |
\rst Prints formatted data to stdout
.
Example**::
fmt::printf("Elapsed time: %.2f seconds", 1.23); \endrst
auto fmt::v8::ptr | ( | const std::shared_ptr< T > & | p | ) | -> const void* |
auto fmt::v8::ptr | ( | const std::unique_ptr< T > & | p | ) | -> const void* |
auto fmt::v8::ptr | ( | T | p | ) | -> const void* |
\rst Converts p
to const void*
for pointer formatting.
Example**::
auto s = fmt::format("{}", fmt::ptr(p)); \endrst
void fmt::v8::report_system_error | ( | int | error_code, |
const char * | message | ||
) | |||
throw | ( | ||
) |
auto fmt::v8::runtime | ( | const S & | s | ) | -> basic_runtime<char_t<S>> |
\rst Creates a runtime format string.
Example**::
Check format string at runtime instead of compile-time. fmt::print(fmt::runtime("{:d}"), "I am not a number"); \endrst
|
inline |
\rst Formats arguments and returns the result as a string.
Example**::
std::string message = fmt::sprintf("The answer is %d", 42); \endrst
|
inline |
auto fmt::v8::system_error | ( | int | error_code, |
format_string< T... > | fmt, | ||
T &&... | args | ||
) | -> std::system_error |
\rst Constructs :class:std::system_error
with a message formatted with fmt::format(fmt, args...)
. error_code* is a system error code as given by errno
.
Example**::
This throws std::system_error with the description cannot open file 'madeup': No such file or directory or similar (system message may vary). const char* filename = "madeup"; std::FILE* file = std::fopen(filename, "r"); if (!file) throw fmt::system_error(errno, "cannot open file '{}'", filename); \endrst
auto fmt::v8::to_string | ( | const basic_memory_buffer< Char, SIZE > & | buf | ) | -> std::basic_string<Char> |
|
inline |
\rst Converts value to std::string
using the default format for type T.
Example**::
#include <fmt/format.h>
std::string answer = fmt::to_string(42); \endrst
|
inline |
|
constexpr |
|
inline |
|
constexpr |
|
inline |
|
inline |
|
inline |
Converts value to std::wstring
using the default format for type T.
auto fmt::v8::vformat | ( | basic_string_view< Char > | format_str, |
basic_format_args< buffer_context< type_identity_t< Char >>> | args | ||
) | -> std::basic_string<Char> |
|
inline |
|
inline |
|
inline |
std::string fmt::v8::vformat | ( | string_view | fmt, |
format_args | args | ||
) | -> std::string |
|
inline |
auto fmt::v8::vformat_to | ( | OutputIt | out, |
const Locale & | loc, | ||
string_view | fmt, | ||
format_args | args | ||
) | -> OutputIt |
auto fmt::v8::vformat_to | ( | OutputIt | out, |
const S & | format_str, | ||
basic_format_args< buffer_context< type_identity_t< Char >>> | args | ||
) | -> OutputIt |
OutputIt fmt::v8::vformat_to | ( | OutputIt | out, |
const text_style & | ts, | ||
basic_string_view< Char > | format_str, | ||
basic_format_args< buffer_context< type_identity_t< Char >>> | args | ||
) |
Formats a string with the given text_style and writes the output to out
.
auto fmt::v8::vformat_to | ( | OutputIt | out, |
string_view | fmt, | ||
format_args | args | ||
) | -> OutputIt |
Formats a string and writes the output to out
.
|
inline |
auto fmt::v8::vformat_to_n | ( | OutputIt | out, |
size_t | n, | ||
string_view | fmt, | ||
format_args | args | ||
) | -> format_to_n_result<OutputIt> |
auto fmt::v8::vfprintf | ( | std::basic_ostream< Char > & | os, |
const S & | fmt, | ||
basic_format_args< basic_printf_context_t< type_identity_t< Char >>> | args | ||
) | -> int |
|
inline |
|
inline |
\rst Visits an argument dispatching to the appropriate visit method based on the argument type. For example, if the argument type is double
then vis(value)
will be called with the value of type double
. \endrst
void fmt::v8::vprint | ( | std::basic_ostream< Char > & | os, |
basic_string_view< Char > | format_str, | ||
basic_format_args< buffer_context< type_identity_t< Char >>> | args | ||
) |
void fmt::v8::vprint | ( | std::FILE * | f, |
const text_style & | ts, | ||
const S & | format, | ||
basic_format_args< buffer_context< type_identity_t< Char >>> | args | ||
) |
void fmt::v8::vprint | ( | std::FILE * | f, |
string_view | fmt, | ||
format_args | args | ||
) |
|
inline |
void fmt::v8::vprint | ( | string_view | fmt, |
format_args | args | ||
) |
|
inline |
|
inline |
|
inline |
auto fmt::v8::vsystem_error | ( | int | error_code, |
string_view | format_str, | ||
format_args | args | ||
) |