#include <format_parse_context.hpp>
template<fly::StandardCharacter CharType>
class fly::detail::BasicFormatParseContext< CharType >
Provides access to the format string parsing state consisting of the format string being parsed, and the format parameter types and indices.
- Author
- Timothy Flynn (trfly.nosp@m.nn89.nosp@m.@pm.m.nosp@m.e)
- Version
- April 25, 2021
◆ BasicFormatParseContext()
template<fly::StandardCharacter CharType>
template<std::size_t N>
|
explicitconstexprnoexcept |
Constructor.
- Parameters
-
format | The format string to be parsed. |
parameters | Pointer to a list of parameter types to be formatted. |
parameters_size | Size of the parameter types list. |
◆ error()
template<fly::StandardCharacter CharType>
If an error was stored from a non-constant-evaluated context, returns the last error that was encountered while parsing the format string.
- Returns
- The error (if any) that was encountered while parsing the format string.
◆ has_error()
template<fly::StandardCharacter CharType>
If an error was stored from a non-constant-evaluated context, returns whether an error was encountered while parsing the format string.
- Returns
- True if an error was encountered while parsing.
◆ lexer()
template<fly::StandardCharacter CharType>
- Returns
- The lexer for parsing the format string.
◆ next_position()
template<fly::StandardCharacter CharType>
Parse the optional position argument of the current replacement field. If a position was not found, the position is observed to be the next format parameter in order.
It is an error if the format string has a mix of manual and automatic positioning.
- Returns
- The parsed or observed format parameter position.
◆ on_error()
template<fly::StandardCharacter CharType>
Record an error that was encountered while parsing the format string.
If invoked from a constant-evaluation context, this will raise a compilation error because this method is purposefully non-constexpr. This results in an attempt to invoke a non-constant expression from a constant context, which is erroneous. The error message from the caller should be displayed in the terminal.
If not invoked from a constant-evaluation context, this will store the error message.
- Parameters
-
error | A message describing the error that was encountered. |
◆ parameter_type()
template<fly::StandardCharacter CharType>
Retrieve the type of the format parameter at the provided index.
- Parameters
-
index | The index of the format parameter. |
- Returns
- If the index exists, the format parameter type. Otherwise, an uninitialized value.
◆ view()
template<fly::StandardCharacter CharType>
- Returns
- A string view into the format string.
The documentation for this class was generated from the following file: