Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
dynamic_formatter< Char > Class Template Reference

#include <format.h>

Classes

struct  null_handler
 

Public Member Functions

template<typename ParseContext >
auto parse (ParseContext &ctx) -> decltype(ctx.begin())
 
template<typename T , typename FormatContext >
auto format (const T &val, FormatContext &ctx) -> decltype(ctx.out())
 

Private Member Functions

template<typename Context >
void handle_specs (Context &ctx)
 

Private Attributes

internal::dynamic_format_specs< Char > specs_
 

Detailed Description

template<typename Char = char>
class dynamic_formatter< Char >

Definition at line 3004 of file format.h.

Member Function Documentation

template<typename Char = char>
template<typename T , typename FormatContext >
auto dynamic_formatter< Char >::format ( const T &  val,
FormatContext &  ctx 
) -> decltype(ctx.out())
inline

Definition at line 3023 of file format.h.

3023  {
3024  handle_specs(ctx);
3026  checker(null_handler(), internal::get_type<FormatContext, T>::value);
3027  checker.on_align(specs_.align());
3028  if (specs_.flags == 0); // Do nothing.
3029  else if (specs_.has(SIGN_FLAG))
3030  specs_.has(PLUS_FLAG) ? checker.on_plus() : checker.on_space();
3031  else if (specs_.has(MINUS_FLAG))
3032  checker.on_minus();
3033  else if (specs_.has(HASH_FLAG))
3034  checker.on_hash();
3035  if (specs_.precision != -1)
3036  checker.end_precision();
3037  typedef output_range<typename FormatContext::iterator,
3038  typename FormatContext::char_type> range;
3040  internal::make_arg<FormatContext>(val));
3041  return ctx.out();
3042  }
intermediate_table::iterator iterator
void handle_specs(Context &ctx)
Definition: format.h:3046
internal::dynamic_format_specs< Char > specs_
Definition: format.h:3053
FMT_CONSTEXPR internal::result_of< Visitor(int)>::type visit_format_arg(Visitor &&vis, const basic_format_arg< Context > &arg)
Definition: core.h:831
template<typename Char = char>
template<typename Context >
void dynamic_formatter< Char >::handle_specs ( Context &  ctx)
inlineprivate

Definition at line 3046 of file format.h.

3046  {
3047  internal::handle_dynamic_spec<internal::width_checker>(
3048  specs_.width_, specs_.width_ref, ctx);
3049  internal::handle_dynamic_spec<internal::precision_checker>(
3050  specs_.precision, specs_.precision_ref, ctx);
3051  }
internal::dynamic_format_specs< Char > specs_
Definition: format.h:3053
template<typename Char = char>
template<typename ParseContext >
auto dynamic_formatter< Char >::parse ( ParseContext &  ctx) -> decltype(ctx.begin())
inline

Definition at line 3016 of file format.h.

3016  {
3017  // Checks are deferred to formatting time when the argument type is known.
3019  return parse_format_specs(ctx.begin(), ctx.end(), handler);
3020  }
internal::dynamic_format_specs< Char > specs_
Definition: format.h:3053
FMT_CONSTEXPR const ParseContext::char_type * parse_format_specs(ParseContext &ctx)
Definition: format.h:2053
static msg_handler handler
Definition: qglobal.cpp:234

Member Data Documentation

template<typename Char = char>
internal::dynamic_format_specs<Char> dynamic_formatter< Char >::specs_
private

Definition at line 3053 of file format.h.


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