proxygen
folly::FormatValue< bool > Class Template Reference

#include <Format-inl.h>

Public Member Functions

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

Private Attributes

bool val_
 

Detailed Description

template<>
class folly::FormatValue< bool >

Definition at line 635 of file Format-inl.h.

Constructor & Destructor Documentation

folly::FormatValue< bool >::FormatValue ( bool  val)
inlineexplicit

Definition at line 637 of file Format-inl.h.

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

Member Function Documentation

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

Definition at line 640 of file Format-inl.h.

References folly::format(), folly::format_value::formatString(), folly::FormatArg::presentation, and folly::FormatArg::validate().

640  {
641  if (arg.presentation == FormatArg::kDefaultPresentation) {
642  arg.validate(FormatArg::Type::OTHER);
643  format_value::formatString(val_ ? "true" : "false", arg, cb);
644  } else { // number
645  FormatValue<int>(val_).format(arg, cb);
646  }
647  }
void formatString(StringPiece val, FormatArg &arg, FormatCallback &cb)
Definition: Format-inl.h:298
static constexpr char kDefaultPresentation
Definition: FormatArg.h:156
void format(FormatArg &arg, FormatCallback &cb) const
Definition: Format-inl.h:640

Member Data Documentation

bool folly::FormatValue< bool >::val_
private

Definition at line 650 of file Format-inl.h.


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