![]() |
Rosetta
2021.16
|
#include <format.h>
Public Member Functions | |
| void | report_unhandled_arg () |
| Result | visit_unhandled_arg () |
| Result | visit_int (int value) |
| Result | visit_long_long (LongLong value) |
| Result | visit_uint (unsigned value) |
| Result | visit_ulong_long (ULongLong value) |
| Result | visit_bool (bool value) |
| Result | visit_char (int value) |
| template<typename T > | |
| Result | visit_any_int (T) |
| Result | visit_double (double value) |
| Result | visit_long_double (long double value) |
| template<typename T > | |
| Result | visit_any_double (T) |
| Result | visit_cstring (const char *) |
| Result | visit_string (Arg::StringValue< char >) |
| Result | visit_wstring (Arg::StringValue< wchar_t >) |
| Result | visit_pointer (const void *) |
| Result | visit_custom (Arg::CustomValue) |
| Result | visit (const Arg &arg) |
Private Types | |
| typedef internal::Arg | Arg |
An argument visitor based on the curiously recurring template pattern <http://en.wikipedia.org/wiki/Curiously_recurring_template_pattern>_.
To use ~fmt::ArgVisitor define a subclass that implements some or all of the visit methods with the same signatures as the methods in ~fmt::ArgVisitor, for example, ~fmt::ArgVisitor::visit_int(). Pass the subclass as the Impl template parameter. Then calling ~fmt::ArgVisitor::visit for some argument will dispatch to a visit method specific to the argument type. For example, if the argument type is double then the ~fmt::ArgVisitor::visit_double() method of a subclass will be called. If the subclass doesn't contain a method with this signature, then a corresponding method of ~fmt::ArgVisitor will be called.
Example**::
class MyArgVisitor : public fmt::ArgVisitor<MyArgVisitor, void> { public: void visit_int(int value) { fmt::print("{}", value); } void visit_double(double value) { fmt::print("{}", value ); } };
|
private |
|
inline |
|
inline |
Visits an argument dispatching to the appropriate visit method based on the argument type. For example, if the argument type is double then the ~fmt::ArgVisitor::visit_double() method of the Impl class will be called.
Referenced by fmt::BasicFormatter< CharType, ArgFormatter >::format().
|
inline |
Visits a double or long double argument.
|
inline |
Visits an argument of any integral type.
|
inline |
Visits a bool argument.
|
inline |
Visits a char or wchar_t argument.
|
inline |
Visits a null-terminated C string (const char *) argument.
|
inline |
Visits an argument of a custom (user-defined) type.
|
inline |
Visits a double argument.
|
inline |
Visits an int argument.
|
inline |
Visits a long double argument.
|
inline |
Visits a long long argument.
|
inline |
Visits a pointer argument.
|
inline |
Visits a string argument.
|
inline |
Visits an unsigned argument.
|
inline |
Visits an unsigned long long argument.
|
inline |
|
inline |
Visits a wide string argument.
1.8.7