TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
fmt::ArgList Class Reference

#include <format.h>

Public Types

enum  { MAX_PACKED_ARGS = 16 }
 

Public Member Functions

 ArgList ()
 
 ArgList (ULongLong types, const internal::Value *values)
 
 ArgList (ULongLong types, const internal::Arg *args)
 
internal::Arg operator[] (unsigned index) const
 

Private Member Functions

internal::Arg::Type type (unsigned index) const
 

Private Attributes

uint64_t types_
 
union {
   const internal::Value *   values_
 
   const internal::Arg *   args_
 
}; 
 

Friends

template<typename Char >
class internal::ArgMap
 

Detailed Description

An argument list.

Member Enumeration Documentation

anonymous enum
Enumerator
MAX_PACKED_ARGS 
1423 { MAX_PACKED_ARGS = 16 };
Definition: format.h:1423

Constructor & Destructor Documentation

fmt::ArgList::ArgList ( )
inline
1425 : types_(0) {}
uint64_t types_
Definition: format.h:1400
fmt::ArgList::ArgList ( ULongLong  types,
const internal::Value values 
)
inline
1428  : types_(types), values_(values) {}
uint64_t types_
Definition: format.h:1400
const internal::Value * values_
Definition: format.h:1407
fmt::ArgList::ArgList ( ULongLong  types,
const internal::Arg args 
)
inline
1430  : types_(types), args_(args) {}
uint64_t types_
Definition: format.h:1400
const internal::Arg * args_
Definition: format.h:1408

Member Function Documentation

internal::Arg fmt::ArgList::operator[] ( unsigned  index) const
inline

Returns the argument at specified index.

1433  {
1434  using internal::Arg;
1435  Arg arg;
1436  bool use_values = type(MAX_PACKED_ARGS - 1) == Arg::NONE;
1437  if (index < MAX_PACKED_ARGS) {
1438  Arg::Type arg_type = type(index);
1439  internal::Value &val = arg;
1440  if (arg_type != Arg::NONE)
1441  val = use_values ? values_[index] : args_[index];
1442  arg.type = arg_type;
1443  return arg;
1444  }
1445  if (use_values) {
1446  // The index is greater than the number of arguments that can be stored
1447  // in values, so return a "none" argument.
1448  arg.type = Arg::NONE;
1449  return arg;
1450  }
1451  for (unsigned i = MAX_PACKED_ARGS; i <= index; ++i) {
1452  if (args_[i].type == Arg::NONE)
1453  return args_[i];
1454  }
1455  return args_[index];
1456  }
Definition: format.h:983
Definition: format.h:1423
GenericValue< UTF8<> > Value
GenericValue with UTF8 encoding.
Definition: document.h:1706
const internal::Arg * args_
Definition: format.h:1408
internal::NamedArg< char > arg(StringRef name, const T &arg)
Definition: format.h:3248
Type type
Definition: format.h:984
Type
Type of JSON value.
Definition: rapidjson.h:642
const internal::Value * values_
Definition: format.h:1407
internal::Arg::Type type(unsigned index) const
Definition: format.h:1411

+ Here is the call graph for this function:

internal::Arg::Type fmt::ArgList::type ( unsigned  index) const
inlineprivate
1411  {
1412  unsigned shift = index * 4;
1413  uint64_t mask = 0xf;
1414  return static_cast<internal::Arg::Type>(
1415  (types_ & (mask << shift)) >> shift);
1416  }
uint64_t types_
Definition: format.h:1400
Type
Definition: format.h:971
unsigned __int64 uint64_t
Definition: stdint.h:90

Friends And Related Function Documentation

template<typename Char >
friend class internal::ArgMap
friend

Member Data Documentation

union { ... }
const internal::Arg* fmt::ArgList::args_
uint64_t fmt::ArgList::types_
private
const internal::Value* fmt::ArgList::values_

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