proxygen
folly::FormatValue< dynamic > Class Template Reference

#include <dynamic-inl.h>

Public Member Functions

 FormatValue (const dynamic &val)
 
template<class FormatCallback >
void format (FormatArg &arg, FormatCallback &cb) const
 

Private Attributes

const dynamicval_
 

Detailed Description

template<>
class folly::FormatValue< dynamic >

Definition at line 1167 of file dynamic-inl.h.

Constructor & Destructor Documentation

folly::FormatValue< dynamic >::FormatValue ( const dynamic val)
inlineexplicit

Definition at line 1169 of file dynamic-inl.h.

1169 : val_(val) {}
double val
Definition: String.cpp:273

Member Function Documentation

template<class FormatCallback >
void folly::FormatValue< dynamic >::format ( FormatArg arg,
FormatCallback &  cb 
) const
inline

Definition at line 1172 of file dynamic-inl.h.

References folly::dynamic::ARRAY, folly::dynamic::BOOL, folly::dynamic::DOUBLE, folly::format(), folly::dynamic::INT64, folly::dynamic::NULLT, folly::dynamic::OBJECT, folly::FormatArg::splitIntKey(), folly::FormatArg::splitKey(), folly::dynamic::STRING, and folly::Range< Iter >::toString().

1172  {
1173  switch (val_.type()) {
1174  case dynamic::NULLT:
1175  FormatValue<std::nullptr_t>(nullptr).format(arg, cb);
1176  break;
1177  case dynamic::BOOL:
1178  FormatValue<bool>(val_.asBool()).format(arg, cb);
1179  break;
1180  case dynamic::INT64:
1181  FormatValue<int64_t>(val_.asInt()).format(arg, cb);
1182  break;
1183  case dynamic::STRING:
1184  FormatValue<std::string>(val_.asString()).format(arg, cb);
1185  break;
1186  case dynamic::DOUBLE:
1187  FormatValue<double>(val_.asDouble()).format(arg, cb);
1188  break;
1189  case dynamic::ARRAY:
1190  FormatValue(val_.at(arg.splitIntKey())).format(arg, cb);
1191  break;
1192  case dynamic::OBJECT:
1193  FormatValue(val_.at(arg.splitKey().toString())).format(arg, cb);
1194  break;
1195  }
1196  }
double asDouble() const
Definition: dynamic-inl.h:521
FormatValue(const dynamic &val)
Definition: dynamic-inl.h:1169
bool asBool() const
Definition: dynamic-inl.h:527
std::string asString() const
Definition: dynamic-inl.h:518
int64_t asInt() const
Definition: dynamic-inl.h:524
void format(FormatArg &arg, FormatCallback &cb) const
Definition: dynamic-inl.h:1172
IfIsNonStringDynamicConvertible< K, dynamic const & > at(K &&) const &
Definition: dynamic-inl.h:792
Type type() const
Definition: dynamic-inl.h:514

Member Data Documentation

const dynamic& folly::FormatValue< dynamic >::val_
private

Definition at line 1199 of file dynamic-inl.h.


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