Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
fmt::ArgVisitor< Impl, Result > Class Template Reference

#include <format.h>

+ Inheritance diagram for fmt::ArgVisitor< Impl, Result >:

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
 

Detailed Description

template<typename Impl, typename Result>
class fmt::ArgVisitor< Impl, Result >

\rst 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, ~fmtArgVisitor::visit_int(). Pass the subclass as the Impl template parameter. Then calling ~fmtArgVisitor::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 ~fmtArgVisitor::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 ); } }; \endrst

Definition at line 1659 of file format.h.

Member Typedef Documentation

◆ Arg

template<typename Impl , typename Result >
typedef internal::Arg fmt::ArgVisitor< Impl, Result >::Arg
private

Definition at line 1661 of file format.h.

Member Function Documentation

◆ report_unhandled_arg()

template<typename Impl , typename Result >
void fmt::ArgVisitor< Impl, Result >::report_unhandled_arg ( )
inline

Definition at line 1664 of file format.h.

◆ visit()

template<typename Impl , typename Result >
Result fmt::ArgVisitor< Impl, Result >::visit ( const Arg & arg)
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 the ~fmtArgVisitor::visit_double() method of the Impl class will be called. \endrst

Definition at line 1756 of file format.h.

◆ visit_any_double()

template<typename Impl , typename Result >
template<typename T >
Result fmt::ArgVisitor< Impl, Result >::visit_any_double ( T )
inline

Visits a double or long double argument.

Definition at line 1719 of file format.h.

◆ visit_any_int()

template<typename Impl , typename Result >
template<typename T >
Result fmt::ArgVisitor< Impl, Result >::visit_any_int ( T )
inline

Visits an argument of any integral type.

Definition at line 1703 of file format.h.

◆ visit_bool()

template<typename Impl , typename Result >
Result fmt::ArgVisitor< Impl, Result >::visit_bool ( bool value)
inline

Visits a bool argument.

Definition at line 1692 of file format.h.

◆ visit_char()

template<typename Impl , typename Result >
Result fmt::ArgVisitor< Impl, Result >::visit_char ( int value)
inline

Visits a char or wchar_t argument.

Definition at line 1697 of file format.h.

◆ visit_cstring()

template<typename Impl , typename Result >
Result fmt::ArgVisitor< Impl, Result >::visit_cstring ( const char * )
inline

Visits a null-terminated C string (const char *) argument.

Definition at line 1724 of file format.h.

◆ visit_custom()

template<typename Impl , typename Result >
Result fmt::ArgVisitor< Impl, Result >::visit_custom ( Arg::CustomValue )
inline

Visits an argument of a custom (user-defined) type.

Definition at line 1744 of file format.h.

◆ visit_double()

template<typename Impl , typename Result >
Result fmt::ArgVisitor< Impl, Result >::visit_double ( double value)
inline

Visits a double argument.

Definition at line 1708 of file format.h.

◆ visit_int()

template<typename Impl , typename Result >
Result fmt::ArgVisitor< Impl, Result >::visit_int ( int value)
inline

Visits an int argument.

Definition at line 1672 of file format.h.

◆ visit_long_double()

template<typename Impl , typename Result >
Result fmt::ArgVisitor< Impl, Result >::visit_long_double ( long double value)
inline

Visits a long double argument.

Definition at line 1713 of file format.h.

◆ visit_long_long()

template<typename Impl , typename Result >
Result fmt::ArgVisitor< Impl, Result >::visit_long_long ( LongLong value)
inline

Visits a long long argument.

Definition at line 1677 of file format.h.

◆ visit_pointer()

template<typename Impl , typename Result >
Result fmt::ArgVisitor< Impl, Result >::visit_pointer ( const void * )
inline

Visits a pointer argument.

Definition at line 1739 of file format.h.

◆ visit_string()

template<typename Impl , typename Result >
Result fmt::ArgVisitor< Impl, Result >::visit_string ( Arg::StringValue< char > )
inline

Visits a string argument.

Definition at line 1729 of file format.h.

◆ visit_uint()

template<typename Impl , typename Result >
Result fmt::ArgVisitor< Impl, Result >::visit_uint ( unsigned value)
inline

Visits an unsigned argument.

Definition at line 1682 of file format.h.

◆ visit_ulong_long()

template<typename Impl , typename Result >
Result fmt::ArgVisitor< Impl, Result >::visit_ulong_long ( ULongLong value)
inline

Visits an unsigned long long argument.

Definition at line 1687 of file format.h.

◆ visit_unhandled_arg()

template<typename Impl , typename Result >
Result fmt::ArgVisitor< Impl, Result >::visit_unhandled_arg ( )
inline

Definition at line 1666 of file format.h.

◆ visit_wstring()

template<typename Impl , typename Result >
Result fmt::ArgVisitor< Impl, Result >::visit_wstring ( Arg::StringValue< wchar_t > )
inline

Visits a wide string argument.

Definition at line 1734 of file format.h.


The documentation for this class was generated from the following file: