Scippy

SoPlex

Sequential object-oriented simPlex

basic_format_parse_context< Char, ErrorHandler > Class Template Reference

#include <core.h>

Public Types

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

Public Member Functions

FMT_CONSTEXPR basic_format_parse_context (basic_string_view< Char > format_str, ErrorHandler eh=ErrorHandler())
 
FMT_CONSTEXPR iterator begin () const FMT_NOEXCEPT
 
FMT_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)
 
FMT_CONSTEXPR ErrorHandler error_handler () const
 

Private Attributes

basic_string_view< Char > format_str_
 
int next_arg_id_
 

Detailed Description

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

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> | +--------------------—+----------------------------------—+

Definition at line 477 of file core.h.

Member Typedef Documentation

◆ char_type

using char_type = Char

Definition at line 483 of file core.h.

◆ iterator

using iterator = typename basic_string_view<Char>::iterator

Definition at line 484 of file core.h.

Constructor & Destructor Documentation

◆ basic_format_parse_context()

FMT_CONSTEXPR basic_format_parse_context ( basic_string_view< Char >  format_str,
ErrorHandler  eh = ErrorHandler() 
)
explicit

Definition at line 486 of file core.h.

Member Function Documentation

◆ advance_to()

FMT_CONSTEXPR void advance_to ( iterator  it)

Advances the begin iterator to it.

Definition at line 504 of file core.h.

Referenced by advance_to(), and value< basic_format_context >::format_custom_arg().

◆ begin()

FMT_CONSTEXPR iterator begin ( ) const

Returns an iterator to the beginning of the format string range being parsed.

Definition at line 494 of file core.h.

Referenced by advance_to(), formatter< std::chrono::duration< Rep, Period >, Char >::do_parse(), and formatter< internal::bigint >::parse().

◆ check_arg_id() [1/2]

FMT_CONSTEXPR void check_arg_id ( int  )

Reports an error if using the automatic argument indexing; otherwise switches to the manual indexing.

Definition at line 522 of file core.h.

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

◆ check_arg_id() [2/2]

FMT_CONSTEXPR void check_arg_id ( basic_string_view< Char >  )

Definition at line 529 of file core.h.

◆ end()

FMT_CONSTEXPR iterator end ( ) const

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

Definition at line 501 of file core.h.

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

◆ error_handler()

FMT_CONSTEXPR ErrorHandler error_handler ( ) const

Definition at line 535 of file core.h.

◆ next_arg_id()

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 512 of file core.h.

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

◆ on_error()

FMT_CONSTEXPR void on_error ( const char *  message)

Definition at line 531 of file core.h.

Referenced by basic_printf_context< OutputIt, Char >::on_error().

Member Data Documentation

◆ format_str_

basic_string_view<Char> format_str_
private

Definition at line 479 of file core.h.

◆ next_arg_id_

int next_arg_id_
private

Definition at line 480 of file core.h.