Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
internal::format_string_checker< Char, ErrorHandler, Args > Class Template Reference

#include <format.h>

Public Member Functions

FMT_CONSTEXPR format_string_checker (basic_string_view< Char > format_str, ErrorHandler eh)
 
FMT_CONSTEXPR void on_text (const Char *, const Char *)
 
FMT_CONSTEXPR void on_arg_id ()
 
FMT_CONSTEXPR void on_arg_id (unsigned id)
 
FMT_CONSTEXPR void on_arg_id (basic_string_view< Char >)
 
FMT_CONSTEXPR void on_replacement_field (const Char *)
 
FMT_CONSTEXPR const Char * on_format_specs (const Char *begin, const Char *)
 
FMT_CONSTEXPR void on_error (const char *message)
 

Private Types

enum  { NUM_ARGS = sizeof...(Args) }
 
typedef basic_parse_context< Char, ErrorHandlerparse_context_type
 
typedef const Char *(* parse_func) (parse_context_type &)
 

Private Member Functions

FMT_CONSTEXPR void check_arg_id ()
 

Private Attributes

unsigned arg_id_
 
parse_context_type context_
 
parse_func parse_funcs_ [NUM_ARGS > 0?NUM_ARGS:1]
 

Detailed Description

template<typename Char, typename ErrorHandler, typename... Args>
class internal::format_string_checker< Char, ErrorHandler, Args >

Definition at line 2060 of file format.h.

Member Typedef Documentation

template<typename Char , typename ErrorHandler , typename... Args>
typedef basic_parse_context<Char, ErrorHandler> internal::format_string_checker< Char, ErrorHandler, Args >::parse_context_type
private

Definition at line 2093 of file format.h.

template<typename Char , typename ErrorHandler , typename... Args>
typedef const Char*(* internal::format_string_checker< Char, ErrorHandler, Args >::parse_func) (parse_context_type &)
private

Definition at line 2102 of file format.h.

Member Enumeration Documentation

template<typename Char , typename ErrorHandler , typename... Args>
anonymous enum
private
Enumerator
NUM_ARGS 

Definition at line 2094 of file format.h.

2094 { NUM_ARGS = sizeof...(Args) };

Constructor & Destructor Documentation

template<typename Char , typename ErrorHandler , typename... Args>
FMT_CONSTEXPR internal::format_string_checker< Char, ErrorHandler, Args >::format_string_checker ( basic_string_view< Char >  format_str,
ErrorHandler  eh 
)
inlineexplicit

Definition at line 2062 of file format.h.

2064  : arg_id_((std::numeric_limits<unsigned>::max)()), context_(format_str, eh),
2065  parse_funcs_{&parse_format_specs<Args, parse_context_type>...} {}
static int max(int a, int b)
parse_func parse_funcs_[NUM_ARGS > 0?NUM_ARGS:1]
Definition: format.h:2106
parse_context_type context_
Definition: format.h:2105

Member Function Documentation

template<typename Char , typename ErrorHandler , typename... Args>
FMT_CONSTEXPR void internal::format_string_checker< Char, ErrorHandler, Args >::check_arg_id ( )
inlineprivate

Definition at line 2096 of file format.h.

2096  {
2097  if (arg_id_ >= NUM_ARGS)
2098  context_.on_error("argument index out of range");
2099  }
FMT_CONSTEXPR void on_error(const char *message)
Definition: core.h:918
parse_context_type context_
Definition: format.h:2105
template<typename Char , typename ErrorHandler , typename... Args>
FMT_CONSTEXPR void internal::format_string_checker< Char, ErrorHandler, Args >::on_arg_id ( )
inline

Definition at line 2069 of file format.h.

2069  {
2071  check_arg_id();
2072  }
FMT_CONSTEXPR void check_arg_id()
Definition: format.h:2096
FMT_CONSTEXPR unsigned next_arg_id()
Definition: format.h:1118
parse_context_type context_
Definition: format.h:2105
template<typename Char , typename ErrorHandler , typename... Args>
FMT_CONSTEXPR void internal::format_string_checker< Char, ErrorHandler, Args >::on_arg_id ( unsigned  id)
inline

Definition at line 2073 of file format.h.

2073  {
2074  arg_id_ = id;
2075  context_.check_arg_id(id);
2076  check_arg_id();
2077  }
FMT_CONSTEXPR bool check_arg_id(unsigned)
Definition: core.h:908
FMT_CONSTEXPR void check_arg_id()
Definition: format.h:2096
parse_context_type context_
Definition: format.h:2105
template<typename Char , typename ErrorHandler , typename... Args>
FMT_CONSTEXPR void internal::format_string_checker< Char, ErrorHandler, Args >::on_arg_id ( basic_string_view< Char >  )
inline

Definition at line 2078 of file format.h.

2078 {}
template<typename Char , typename ErrorHandler , typename... Args>
FMT_CONSTEXPR void internal::format_string_checker< Char, ErrorHandler, Args >::on_error ( const char *  message)
inline

Definition at line 2088 of file format.h.

2088  {
2090  }
FMT_CONSTEXPR void on_error(const char *message)
Definition: core.h:918
parse_context_type context_
Definition: format.h:2105
template<typename Char , typename ErrorHandler , typename... Args>
FMT_CONSTEXPR const Char* internal::format_string_checker< Char, ErrorHandler, Args >::on_format_specs ( const Char *  begin,
const Char *   
)
inline

Definition at line 2082 of file format.h.

2082  {
2084  return arg_id_ < NUM_ARGS ?
2086  }
FMT_CONSTEXPR auto begin(const C &c) -> decltype(c.begin())
Definition: format.h:251
FMT_CONSTEXPR void advance_to(iterator it)
Definition: core.h:901
parse_func parse_funcs_[NUM_ARGS > 0?NUM_ARGS:1]
Definition: format.h:2106
parse_context_type context_
Definition: format.h:2105
template<typename Char , typename ErrorHandler , typename... Args>
FMT_CONSTEXPR void internal::format_string_checker< Char, ErrorHandler, Args >::on_replacement_field ( const Char *  )
inline

Definition at line 2080 of file format.h.

2080 {}
template<typename Char , typename ErrorHandler , typename... Args>
FMT_CONSTEXPR void internal::format_string_checker< Char, ErrorHandler, Args >::on_text ( const Char *  ,
const Char *   
)
inline

Definition at line 2067 of file format.h.

2067 {}

Member Data Documentation

template<typename Char , typename ErrorHandler , typename... Args>
unsigned internal::format_string_checker< Char, ErrorHandler, Args >::arg_id_
private

Definition at line 2104 of file format.h.

template<typename Char , typename ErrorHandler , typename... Args>
parse_context_type internal::format_string_checker< Char, ErrorHandler, Args >::context_
private

Definition at line 2105 of file format.h.

template<typename Char , typename ErrorHandler , typename... Args>
parse_func internal::format_string_checker< Char, ErrorHandler, Args >::parse_funcs_[NUM_ARGS > 0?NUM_ARGS:1]
private

Definition at line 2106 of file format.h.


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