SoPlex Documentation
Loading...
Searching...
No Matches
basic_format_parse_context< Char, ErrorHandler > Class Template Reference

#include <core.h>

Inheritance diagram for basic_format_parse_context< Char, ErrorHandler >:
error_handler basic_printf_parse_context< Char >

Public Types

using char_type = Char
 
using iterator = typename basic_string_view<Char>::iterator
 

Public Member Functions

constexpr basic_format_parse_context (basic_string_view< Char > format_str, ErrorHandler eh={}, int next_arg_id=0)
 
constexpr iterator begin () const FMT_NOEXCEPT
 
constexpr iterator end () const FMT_NOEXCEPT
 
FMT_CONSTEXPR void advance_to (iterator it)
 
FMT_CONSTEXPR int next_arg_id ()
 
FMT_CONSTEXPR void check_arg_id (int)
 
FMT_CONSTEXPR void check_arg_id (basic_string_view< Char >)
 
FMT_CONSTEXPR void on_error (const char *message)
 
constexpr ErrorHandler error_handler () const
 

Private Attributes

basic_string_view< Char > format_str_
 
int next_arg_id_
 

Additional Inherited Members

- Private Member Functions inherited from error_handler
constexpr error_handler ()=default
 
constexpr error_handler (const error_handler &)=default
 
FMT_NORETURN FMT_API void on_error (const char *message)
 

Detailed Description

template<typename Char, typename ErrorHandler = detail::error_handler>
class basic_format_parse_context< Char, ErrorHandler >

\rst Parsing context consisting of a format string range being parsed and an argument counter for automatic indexing.

You can use one of the following type aliases for common character types:

+--------------------—+----------------------------------—+ | Type | Definition | +=======================+=====================================+ | format_parse_context | basic_format_parse_context<char> | +--------------------—+----------------------------------—+ | wformat_parse_context | basic_format_parse_context<wchar_t> | +--------------------—+----------------------------------—+ \endrst

Definition at line 559 of file core.h.

Member Typedef Documentation

◆ char_type

template<typename Char , typename ErrorHandler = detail::error_handler>
using char_type = Char

Definition at line 565 of file core.h.

◆ iterator

template<typename Char , typename ErrorHandler = detail::error_handler>
using iterator = typename basic_string_view<Char>::iterator

Definition at line 566 of file core.h.

Constructor & Destructor Documentation

◆ basic_format_parse_context()

template<typename Char , typename ErrorHandler = detail::error_handler>
basic_format_parse_context ( basic_string_view< Char > format_str,
ErrorHandler eh = {},
int next_arg_id = 0 )
explicitconstexpr

Definition at line 568 of file core.h.

Member Function Documentation

◆ advance_to()

template<typename Char , typename ErrorHandler = detail::error_handler>
FMT_CONSTEXPR void advance_to ( iterator it)

◆ begin()

template<typename Char , typename ErrorHandler = detail::error_handler>
iterator begin ( ) const
constexpr

◆ check_arg_id() [1/2]

template<typename Char , typename ErrorHandler = detail::error_handler>
FMT_CONSTEXPR void check_arg_id ( basic_string_view< Char > )

Definition at line 612 of file core.h.

◆ check_arg_id() [2/2]

template<typename Char , typename ErrorHandler = detail::error_handler>
FMT_CONSTEXPR void check_arg_id ( int )

◆ end()

template<typename Char , typename ErrorHandler = detail::error_handler>
iterator end ( ) const
constexpr

Returns an iterator past the end of the format string range being parsed.

Definition at line 582 of file core.h.

References basic_format_parse_context< Char, ErrorHandler >::format_str_.

Referenced by formatter< std::chrono::duration< Rep, Period >, Char >::do_parse().

◆ error_handler()

template<typename Char , typename ErrorHandler = detail::error_handler>
ErrorHandler error_handler ( ) const
constexpr

Definition at line 618 of file core.h.

◆ next_arg_id()

template<typename Char , typename ErrorHandler = detail::error_handler>
FMT_CONSTEXPR int next_arg_id ( )

Reports an error if using the manual argument indexing; otherwise returns the next argument index and switches to the automatic indexing.

Definition at line 593 of file core.h.

References basic_format_parse_context< Char, ErrorHandler >::next_arg_id_, and basic_format_parse_context< Char, ErrorHandler >::on_error().

Referenced by formatter< std::chrono::duration< Rep, Period >, Char >::spec_handler::make_arg_ref(), and format_handler< OutputIt, Char, Context >::on_arg_id().

◆ on_error()

template<typename Char , typename ErrorHandler = detail::error_handler>
FMT_CONSTEXPR void on_error ( const char * message)

Member Data Documentation

◆ format_str_

template<typename Char , typename ErrorHandler = detail::error_handler>
basic_string_view<Char> format_str_
private

◆ next_arg_id_

template<typename Char , typename ErrorHandler = detail::error_handler>
int next_arg_id_
private