Public Types | Public Member Functions | Public Attributes | Static Private Member Functions | List of all members
internal::value< Context > Class Template Reference

#include <core.h>

Public Types

typedef Context::char_type char_type
 

Public Member Functions

FMT_CONSTEXPR value (int val=0)
 
 value (unsigned val)
 
 value (long long val)
 
 value (unsigned long long val)
 
 value (double val)
 
 value (long double val)
 
 value (const char_type *val)
 
 value (const signed char *val)
 
 value (const unsigned char *val)
 
 value (basic_string_view< char_type > val)
 
 value (const void *val)
 
template<typename T >
 value (const T &val)
 
const named_arg_base< char_type > & as_named_arg ()
 

Public Attributes

union {
   int   int_value
 
   unsigned   uint_value
 
   long long   long_long_value
 
   unsigned long long   ulong_long_value
 
   double   double_value
 
   long double   long_double_value
 
   const void *   pointer
 
   string_value< char_type >   string
 
   string_value< signed char >   sstring
 
   string_value< unsigned char >   ustring
 
   custom_value< Context >   custom
 
}; 
 

Static Private Member Functions

template<typename T >
static void format_custom_arg (const void *arg, Context &ctx)
 

Detailed Description

template<typename Context>
class internal::value< Context >

Definition at line 564 of file core.h.

Member Typedef Documentation

template<typename Context>
typedef Context::char_type internal::value< Context >::char_type

Definition at line 566 of file core.h.

Constructor & Destructor Documentation

template<typename Context>
FMT_CONSTEXPR internal::value< Context >::value ( int  val = 0)
inline

Definition at line 582 of file core.h.

template<typename Context>
internal::value< Context >::value ( unsigned  val)
inline

Definition at line 583 of file core.h.

583 { uint_value = val; }
unsigned uint_value
Definition: core.h:570
template<typename Context>
internal::value< Context >::value ( long long  val)
inline

Definition at line 584 of file core.h.

584 { long_long_value = val; }
long long long_long_value
Definition: core.h:571
template<typename Context>
internal::value< Context >::value ( unsigned long long  val)
inline

Definition at line 585 of file core.h.

585 { ulong_long_value = val; }
unsigned long long ulong_long_value
Definition: core.h:572
template<typename Context>
internal::value< Context >::value ( double  val)
inline

Definition at line 586 of file core.h.

586 { double_value = val; }
double double_value
Definition: core.h:573
template<typename Context>
internal::value< Context >::value ( long double  val)
inline

Definition at line 587 of file core.h.

587 { long_double_value = val; }
long double long_double_value
Definition: core.h:574
template<typename Context>
internal::value< Context >::value ( const char_type val)
inline

Definition at line 588 of file core.h.

588 { string.value = val; }
template<typename Context>
internal::value< Context >::value ( const signed char *  val)
inline

Definition at line 589 of file core.h.

589  {
591  "incompatible string types");
592  sstring.value = val;
593  }
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1225
string_value< signed char > sstring
Definition: core.h:577
const Char * value
Definition: core.h:552
template<typename Context>
internal::value< Context >::value ( const unsigned char *  val)
inline

Definition at line 594 of file core.h.

594  {
596  "incompatible string types");
597  ustring.value = val;
598  }
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1225
string_value< unsigned char > ustring
Definition: core.h:578
const Char * value
Definition: core.h:552
template<typename Context>
internal::value< Context >::value ( basic_string_view< char_type val)
inline

Definition at line 599 of file core.h.

599  {
600  string.value = val.data();
601  string.size = val.size();
602  }
FMT_CONSTEXPR size_t size() const
Definition: core.h:389
FMT_CONSTEXPR const Char * data() const
Definition: core.h:386
template<typename Context>
internal::value< Context >::value ( const void *  val)
inline

Definition at line 603 of file core.h.

603 { pointer = val; }
const void * pointer
Definition: core.h:575
template<typename Context>
template<typename T >
internal::value< Context >::value ( const T &  val)
inlineexplicit

Definition at line 606 of file core.h.

606  {
607  custom.value = &val;
608  custom.format = &format_custom_arg<T>;
609  }

Member Function Documentation

template<typename Context>
const named_arg_base<char_type>& internal::value< Context >::as_named_arg ( )
inline

Definition at line 611 of file core.h.

611  {
612  return *static_cast<const named_arg_base<char_type>*>(pointer);
613  }
const void * pointer
Definition: core.h:575
template<typename Context>
template<typename T >
static void internal::value< Context >::format_custom_arg ( const void *  arg,
Context &  ctx 
)
inlinestaticprivate

Definition at line 618 of file core.h.

618  {
619  // Get the formatter type through the context to allow different contexts
620  // have different extension points, e.g. `formatter<T>` for `format` and
621  // `printf_formatter<T>` for `printf`.
622  typename Context::template formatter_type<T>::type f;
623  auto &&parse_ctx = ctx.parse_context();
624  parse_ctx.advance_to(f.parse(parse_ctx));
625  ctx.advance_to(f.format(*static_cast<const T*>(arg), ctx));
626  }
internal::named_arg< T, char > arg(string_view name, const T &arg)
Definition: core.h:1391
static QCString type
Definition: declinfo.cpp:672

Member Data Documentation

union { ... }
template<typename Context>
custom_value<Context> internal::value< Context >::custom

Definition at line 579 of file core.h.

template<typename Context>
double internal::value< Context >::double_value

Definition at line 573 of file core.h.

template<typename Context>
int internal::value< Context >::int_value

Definition at line 569 of file core.h.

template<typename Context>
long double internal::value< Context >::long_double_value

Definition at line 574 of file core.h.

template<typename Context>
long long internal::value< Context >::long_long_value

Definition at line 571 of file core.h.

template<typename Context>
const void* internal::value< Context >::pointer

Definition at line 575 of file core.h.

template<typename Context>
string_value<signed char> internal::value< Context >::sstring

Definition at line 577 of file core.h.

template<typename Context>
string_value<char_type> internal::value< Context >::string

Definition at line 576 of file core.h.

template<typename Context>
unsigned internal::value< Context >::uint_value

Definition at line 570 of file core.h.

template<typename Context>
unsigned long long internal::value< Context >::ulong_long_value

Definition at line 572 of file core.h.

template<typename Context>
string_value<unsigned char> internal::value< Context >::ustring

Definition at line 578 of file core.h.


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