TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
fmt::internal::MakeValue< Formatter > Class Template Reference

#include <format.h>

Public Types

typedef Formatter::Char Char
 
- Public Types inherited from fmt::internal::Value
enum  Type {
  NONE, NAMED_ARG, INT, UINT,
  LONG_LONG, ULONG_LONG, BOOL, CHAR,
  LAST_INTEGER_TYPE = CHAR, DOUBLE, LONG_DOUBLE, LAST_NUMERIC_TYPE = LONG_DOUBLE,
  CSTRING, STRING, WSTRING, POINTER,
  CUSTOM
}
 
typedef void(* FormatFunc )(void *formatter, const void *arg, void *format_str_ptr)
 

Public Member Functions

 MakeValue ()
 
 MakeValue (long value)
 
 MakeValue (unsigned long value)
 
 MakeValue (typename WCharHelper< wchar_t, Char >::Supported value)
 
template<typename T >
 MakeValue (const T &value, typename EnableIf< Not< ConvertToInt< T >::value >::value, int >::type=0)
 
template<typename T >
 MakeValue (const T &value, typename EnableIf< ConvertToInt< T >::value, int >::type=0)
 
template<typename Char_ >
 MakeValue (const NamedArg< Char_ > &value)
 

Static Public Member Functions

static uint64_t type (long)
 
static uint64_t type (unsigned long)
 
static uint64_t type (wchar_t)
 
template<typename T >
static uint64_t type (const T &)
 
template<typename Char_ >
static uint64_t type (const NamedArg< Char_ > &)
 

Private Member Functions

template<typename T >
 MakeValue (const T *value)
 
template<typename T >
 MakeValue (T *value)
 
 MakeValue (typename WCharHelper< wchar_t, Char >::Unsupported)
 
 MakeValue (typename WCharHelper< wchar_t *, Char >::Unsupported)
 
 MakeValue (typename WCharHelper< const wchar_t *, Char >::Unsupported)
 
 MakeValue (typename WCharHelper< const std::wstring &, Char >::Unsupported)
 
 MakeValue (typename WCharHelper< WStringRef, Char >::Unsupported)
 
void set_string (StringRef str)
 
void set_string (WStringRef str)
 

Static Private Member Functions

template<typename T >
static void format_custom_arg (void *formatter, const void *arg, void *format_str_ptr)
 

Additional Inherited Members

- Public Attributes inherited from fmt::internal::Arg
Type type
 
- Public Attributes inherited from fmt::internal::Value
union {
   int   int_value
 
   unsigned   uint_value
 
   LongLong   long_long_value
 
   ULongLong   ulong_long_value
 
   double   double_value
 
   long double   long_double_value
 
   const void *   pointer
 
   StringValue< char >   string
 
   StringValue< signed char >   sstring
 
   StringValue< unsigned char >   ustring
 
   StringValue< wchar_t >   wstring
 
   CustomValue   custom
 
}; 
 

Member Typedef Documentation

template<typename Formatter >
typedef Formatter::Char fmt::internal::MakeValue< Formatter >::Char

Constructor & Destructor Documentation

template<typename Formatter >
template<typename T >
fmt::internal::MakeValue< Formatter >::MakeValue ( const T *  value)
private
template<typename Formatter >
template<typename T >
fmt::internal::MakeValue< Formatter >::MakeValue ( T *  value)
private
template<typename Formatter >
fmt::internal::MakeValue< Formatter >::MakeValue ( typename WCharHelper< wchar_t, Char >::Unsupported  )
private
template<typename Formatter >
fmt::internal::MakeValue< Formatter >::MakeValue ( typename WCharHelper< wchar_t *, Char >::Unsupported  )
private
template<typename Formatter >
fmt::internal::MakeValue< Formatter >::MakeValue ( typename WCharHelper< const wchar_t *, Char >::Unsupported  )
private
template<typename Formatter >
fmt::internal::MakeValue< Formatter >::MakeValue ( typename WCharHelper< const std::wstring &, Char >::Unsupported  )
private
template<typename Formatter >
fmt::internal::MakeValue< Formatter >::MakeValue ( typename WCharHelper< WStringRef, Char >::Unsupported  )
private
template<typename Formatter >
fmt::internal::MakeValue< Formatter >::MakeValue ( )
inline
1135 {}
template<typename Formatter >
fmt::internal::MakeValue< Formatter >::MakeValue ( long  value)
inline
1150  {
1151  // To minimize the number of types we need to deal with, long is
1152  // translated either to int or to long long depending on its size.
1153  if (check(sizeof(long) == sizeof(int)))
1154  int_value = static_cast<int>(value);
1155  else
1157  }
int int_value
Definition: format.h:957
const FieldDescriptor value
Definition: descriptor.h:1522
LongLong long_long_value
Definition: format.h:959
T check(T value)
Definition: format.h:305

+ Here is the call graph for this function:

template<typename Formatter >
fmt::internal::MakeValue< Formatter >::MakeValue ( unsigned long  value)
inline
1162  {
1163  if (check(sizeof(unsigned long) == sizeof(unsigned)))
1164  uint_value = static_cast<unsigned>(value);
1165  else
1167  }
unsigned uint_value
Definition: format.h:958
ULongLong ulong_long_value
Definition: format.h:960
const FieldDescriptor value
Definition: descriptor.h:1522
T check(T value)
Definition: format.h:305

+ Here is the call graph for this function:

template<typename Formatter >
fmt::internal::MakeValue< Formatter >::MakeValue ( typename WCharHelper< wchar_t, Char >::Supported  value)
inline
1183  {
1184  int_value = value;
1185  }
int int_value
Definition: format.h:957
const FieldDescriptor value
Definition: descriptor.h:1522
template<typename Formatter >
template<typename T >
fmt::internal::MakeValue< Formatter >::MakeValue ( const T &  value,
typename EnableIf< Not< ConvertToInt< T >::value >::value, int >::type  = 0 
)
inline
1218  {
1219  custom.value = &value;
1220  custom.format = &format_custom_arg<T>;
1221  }
const void * value
Definition: format.h:952
CustomValue custom
Definition: format.h:968
const FieldDescriptor value
Definition: descriptor.h:1522
FormatFunc format
Definition: format.h:953
template<typename Formatter >
template<typename T >
fmt::internal::MakeValue< Formatter >::MakeValue ( const T &  value,
typename EnableIf< ConvertToInt< T >::value, int >::type  = 0 
)
inline
1225  {
1226  int_value = value;
1227  }
int int_value
Definition: format.h:957
const FieldDescriptor value
Definition: descriptor.h:1522
template<typename Formatter >
template<typename Char_ >
fmt::internal::MakeValue< Formatter >::MakeValue ( const NamedArg< Char_ > &  value)
inline
1237 { pointer = &value; }
const void * pointer
Definition: format.h:963
const FieldDescriptor value
Definition: descriptor.h:1522

Member Function Documentation

template<typename Formatter >
template<typename T >
static void fmt::internal::MakeValue< Formatter >::format_custom_arg ( void *  formatter,
const void *  arg,
void *  format_str_ptr 
)
inlinestaticprivate
1128  {
1129  format(*static_cast<Formatter*>(formatter),
1130  *static_cast<const Char**>(format_str_ptr),
1131  *static_cast<const T*>(arg));
1132  }
void format(BasicFormatter< Char > &f, const Char *&format_str, const T &value)
Definition: format.h:2963
internal::NamedArg< char > arg(StringRef name, const T &arg)
Definition: format.h:3248

+ Here is the call graph for this function:

template<typename Formatter >
void fmt::internal::MakeValue< Formatter >::set_string ( StringRef  str)
inlineprivate
1115  {
1116  string.value = str.data();
1117  string.size = str.size();
1118  }

+ Here is the call graph for this function:

template<typename Formatter >
void fmt::internal::MakeValue< Formatter >::set_string ( WStringRef  str)
inlineprivate
1120  {
1121  wstring.value = str.data();
1122  wstring.size = str.size();
1123  }
std::size_t size
Definition: format.h:945
const Char * value
Definition: format.h:944
StringValue< wchar_t > wstring
Definition: format.h:967

+ Here is the call graph for this function:

template<typename Formatter >
static uint64_t fmt::internal::MakeValue< Formatter >::type ( long  )
inlinestatic
1158  {
1159  return sizeof(long) == sizeof(int) ? Arg::INT : Arg::LONG_LONG;
1160  }
Definition: format.h:974
Definition: format.h:974
template<typename Formatter >
static uint64_t fmt::internal::MakeValue< Formatter >::type ( unsigned  long)
inlinestatic
1168  {
1169  return sizeof(unsigned long) == sizeof(unsigned) ?
1171  }
Definition: format.h:974
Definition: format.h:974
template<typename Formatter >
static uint64_t fmt::internal::MakeValue< Formatter >::type ( wchar_t  )
inlinestatic
1186 { return Arg::CHAR; }
Definition: format.h:974
template<typename Formatter >
template<typename T >
static uint64_t fmt::internal::MakeValue< Formatter >::type ( const T &  )
inlinestatic
1230  {
1232  }
Definition: format.h:1053
Definition: format.h:974
Definition: format.h:977
template<typename Formatter >
template<typename Char_ >
static uint64_t fmt::internal::MakeValue< Formatter >::type ( const NamedArg< Char_ > &  )
inlinestatic
1240 { return Arg::NAMED_ARG; }
Definition: format.h:972

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