MySQL 9.6.0
Source Code Documentation
mysql::strconv::Fluent_parser< Format_t > Class Template Reference

Fluent API for parsing strings. More...

#include <fluent_parser.h>

Public Member Functions

 Fluent_parser (Parser &parser, const Format_t &format)
 Construct a new object, wrapping the given Parser, and using the given format when reading sub-objects. More...
 
 Fluent_parser ()=delete
 
 Fluent_parser (const Fluent_parser &)=delete
 
 Fluent_parser (Fluent_parser &&) noexcept=default
 
Fluent_parseroperator= (const Fluent_parser &)=delete
 
Fluent_parseroperator= (Fluent_parser &&) noexcept=default
 
 ~Fluent_parser ()=default
 
Self_tnext_token_only_if (bool condition)
 Suppress the next token if condition is false. More...
 
Self_tnext_token_only_if (const std::invocable auto &condition)
 If the states is not "closed", suppress the next token if condition evaluates to false. More...
 
Self_tcheck_prev_token (const std::invocable auto &checker)
 If the state is not "closed", invoke the given invocable. More...
 
Self_tend_optional ()
 If the state is not "closed" save the current position, and if a subsequent invocation of a member function fails, rewind to the saved position and suppress the error. More...
 
Self_tcall_unconditionally (const std::invocable auto &function)
 Invoke the given invocable regardless o the open/closed state. More...
 
Self_tread (auto &obj)
 If the state is not "closed", read into the given object once. More...
 
Self_tread_optional (auto &obj)
 If the state is not "closed" read into the given object once; if that fails with parse error, restore to the previous position and suppress the error. More...
 
Self_tread_any (auto &obj)
 If the state is not "closed" read repeatedly into the given object until it fails. More...
 
Self_tread_at_least (std::size_t count, auto &obj)
 If the state is not "closed" read repeatedly into the given object until it fails. More...
 
Self_tread_at_most (std::size_t count, auto &obj)
 If the state is not "closed" read repeatedly into the given object until count instances are found or it fails. More...
 
Self_tread_exact (std::size_t count, auto &obj)
 If the state is not "closed", read into the given object count times. More...
 
Self_tread_range (std::size_t min, std::size_t max, auto &obj)
 If the state is not "closed" read repeatedly into the given object until max instances are found or it fails. More...
 
Self_tread_repeated (const Is_repeat auto &repeat, auto &object)
 If the state is not "closed" read with a number of repetitions specified by the given Is_repeat object. More...
 
Self_tread_with_format (const auto &format, auto &obj)
 If the state is not "closed", read into the given object once. More...
 
Self_tread_with_format_optional (const auto &format, auto &obj)
 If the state is not "closed" read into the given object once; if that fails with parse error, restore to the previous position and suppress the error. More...
 
Self_tread_with_format_any (const auto &format, auto &obj)
 If the state is not "closed" read repeatedly into the given object until it fails. More...
 
Self_tread_with_format_at_least (const auto &format, std::size_t count, auto &obj)
 If the state is not "closed" read repeatedly into the given object until it fails. More...
 
Self_tread_with_format_at_most (const auto &format, std::size_t count, auto &obj)
 If the state is not "closed" read repeatedly into the given object until count instances are found or it fails. More...
 
Self_tread_with_format_exact (const auto &format, std::size_t count, auto &obj)
 If the state is not "closed" read into the given object count times. More...
 
Self_tread_with_format_range (const auto &format, std::size_t min, std::size_t max, auto &obj)
 If the state is not "closed" read repeatedly into the given object until max instances are found or it fails. More...
 
Self_tread_with_format_repeated (const auto &format, const Is_repeat auto &repeat, auto &object)
 If the state is not "closed" read with a number of repetitions specified by the given Is_repeat object. More...
 
Self_tliteral (const std::string_view &sv)
 Like read, but skips the given string literal. More...
 
Self_tliteral_optional (const std::string_view &sv)
 Like read_optional, but skips the given string literal. More...
 
Self_tliteral_any (const std::string_view &sv)
 Like read_any, but skips the given string literal. More...
 
Self_tliteral_at_least (std::size_t count, const std::string_view &sv)
 Like read_at_least, but skips the given string literal. More...
 
Self_tliteral_at_most (std::size_t count, const std::string_view &sv)
 Like read_at_most, but skips the given string literal. More...
 
Self_tliteral_exact (std::size_t count, const std::string_view &sv)
 Like read_exact, but skips the given string literal. More...
 
Self_tliteral_range (std::size_t min, std::size_t max, const std::string_view &sv)
 Like read_range, but skips the given string literal. More...
 
Self_tliteral_repeated (const Is_repeat auto &repeat, const std::string_view &sv)
 Like read_repeated, but skips the given string literal. More...
 
Self_tcall (const std::invocable auto &function)
 Like read, but invokes the given function instead of reading an object. More...
 
Self_tcall_optional (const std::invocable auto &function)
 Like read_optional, but invokes the given function instead of reading an object. More...
 
Self_tcall_any (const std::invocable auto &function)
 Like read_any, but invokes the given function instead of reading an object. More...
 
Self_tcall_at_least (std::size_t count, const std::invocable auto &function)
 Like read_at_least, but invokes the given function instead of reading an object. More...
 
Self_tcall_at_most (std::size_t count, const std::invocable auto &function)
 Like read_at_most, but invokes the given function instead of reading an object. More...
 
Self_tcall_exact (std::size_t count, const std::invocable auto &function)
 Like read_exact, but invokes the given function instead of reading an object. More...
 
Self_tcall_range (std::size_t min, std::size_t max, const std::invocable auto &function)
 Like read_range, but invokes the given function instead of reading an object. More...
 
Self_tcall_repeated (const Is_repeat auto &repeat, const std::invocable auto &function)
 Like read_repeated, but invokes the given function instead of reading an object. More...
 
Self_tread_repeated_with_separators (auto &object, const std::string_view &separator, const Is_repeat auto &repeat, Allow_repeated_separators allow_repeated_separators, Leading_separators leading_separators, Trailing_separators trailing_separators)
 Reads repeatedly into the given object, using the given number of repetitions, and skipping string literals equal to the given string_view between reads. More...
 
Self_tcall_repeated_with_separators (const std::invocable auto &function, const std::string_view &separator, const Is_repeat auto &repeat, Allow_repeated_separators allow_repeated_separators, Leading_separators leading_separators, Trailing_separators trailing_separators)
 Like read_repeated_with_separators, but invokes a function instead of reads into an object. More...
 

Private Types

enum class  Fluent_state { open , next_suppressed , last_suppressed , closed }
 Represents the execution state of the fluent parser. More...
 
using Self_t = Fluent_parser< Format_t >
 

Private Member Functions

Self_tdo_call (const Is_repeat auto &repeat, const std::invocable auto &function)
 Invoke the given function with the given number of repetitions. More...
 

Private Attributes

Format_t m_format
 Format used to parse objects. More...
 
Parserm_parser
 Underlying Parser that this Fluent_parser operates on. More...
 
std::ptrdiff_t m_backtrack_position {no_backtrack_position}
 Previous position we parsed to at which it is OK to stop parsing in case a parse error occurs. More...
 
std::ptrdiff_t m_before_last_token {0}
 Position before the last parsed token. More...
 
Fluent_state m_fluent_state {Fluent_state::open}
 The open/closed state. More...
 

Static Private Attributes

static constexpr std::ptrdiff_t no_backtrack_position = -1
 Value used by m_backtrack_position, indicating that end_optional has not been invoked. More...
 

Detailed Description

template<Is_format Format_t>
class mysql::strconv::Fluent_parser< Format_t >

Fluent API for parsing strings.

This provides a higher-level, fluent API that wraps a lower-level Parser. An instance represents the parser together with the state of the fluent API.

By using the fluent API, parsers that read multiple sub-objects in sequence can often be implemented without having to explicitly handle the failure of each sub-object parser. This can make the implementation safer and the code clearer.

In general, the state of the Fluent_parser is either "open" or "closed". The state determines whether subsequent invocations of member functions are inhibited or not: when in "open" state, subsequent invocations are executed, and when in "closed" state, subsequent invocations do nothing. If the state is "open" and the user invokes a member function, the state remains "open" if the function succeeds and changes to "closed" if the function fails. This enables patterns such as the following for parsing a sequence of tokens:

fluent_parser
.read(object1)
.read(object2)
.read(object3);

The state of the Fluent_parser ensures that it will not attempt to parse object2 or object3 if the parsing of object1 failed. Thus, the user does not have to check for errors in this case. Fewer errors to check can make the user code simpler and safer.

There are also special member functions that provide support for common patterns in string formats:

  • read_repeated_with_separators: Reads repeatedly into an object, skipping literal separators between reads, and optionally skipping literal separators before the first and/or after the last read.
  • end_optional: Stores the information that it is valid for the string to end at the current position. If an error occurs while parsing subsequent tokens, the error is suppressed, the position rewound to the saved position, and the state altered to "closed".
  • next_token_only_if: If the given boolean predicate is true, temporarily closes the Fluent_parser for only the following token.
  • check_prev_token: Invokes a given invocable. If that produces an error in the Parser, rewinds to the position just before the last parsed token (so the error message points to just before the problematic token).
  • call_unconditionally: Invokes a given invocable, regardless of the open/closed state.

The Fluent_parser also holds a Format object, used when reading objects.

Template Parameters
Format_tType used for the internal Format object.

Member Typedef Documentation

◆ Self_t

template<Is_format Format_t>
using mysql::strconv::Fluent_parser< Format_t >::Self_t = Fluent_parser<Format_t>
private

Member Enumeration Documentation

◆ Fluent_state

template<Is_format Format_t>
enum class mysql::strconv::Fluent_parser::Fluent_state
strongprivate

Represents the execution state of the fluent parser.

Using the fluent API amounts to a sequence of invocations of member functions. Within this sequence, each invocation either represents one token parsed from the string, or behaves as a modifier for the following token, or a modifier for the preceding token. Thus, invocations can be grouped according to which token they belong to. Accordingly, we define a token sequence as a maximal, non-empty sequence of invocations of the following member functions:

next_token_only_if* (read|call|literal|end_optional)? check_prev_token*

The Fluent_state tracks the open/closed state, and tracks whether next_token_only_if has temporarily altered the state to closed, needing to restore to open when the next token sequence begins.

Enumerator
open 

Ready to parse tokens.

next_suppressed 

next_token_only_if has temporarily closed the token, and none of read/call/literal/end_optional/check_prev_token has yet been invoked for the current token.

last_suppressed 

next_token_only_if has temporarily closed the token, and at least one of read/call/literal/ end_optional/check_prev_token has been invoked for the current token, but none of next_token_only_if/read/call/literal/end_optional has been invoked for the next token and thus subsequent check_prev_token invocations are still to be suppressed.

closed 

All subsequent tokens are suppressed.

Constructor & Destructor Documentation

◆ Fluent_parser() [1/4]

template<Is_format Format_t>
mysql::strconv::Fluent_parser< Format_t >::Fluent_parser ( Parser parser,
const Format_t &  format 
)
inline

Construct a new object, wrapping the given Parser, and using the given format when reading sub-objects.

◆ Fluent_parser() [2/4]

template<Is_format Format_t>
mysql::strconv::Fluent_parser< Format_t >::Fluent_parser ( )
delete

◆ Fluent_parser() [3/4]

template<Is_format Format_t>
mysql::strconv::Fluent_parser< Format_t >::Fluent_parser ( const Fluent_parser< Format_t > &  )
delete

◆ Fluent_parser() [4/4]

template<Is_format Format_t>
mysql::strconv::Fluent_parser< Format_t >::Fluent_parser ( Fluent_parser< Format_t > &&  )
defaultnoexcept

◆ ~Fluent_parser()

template<Is_format Format_t>
mysql::strconv::Fluent_parser< Format_t >::~Fluent_parser ( )
default

Member Function Documentation

◆ call()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::call ( const std::invocable auto &  function)
inline

Like read, but invokes the given function instead of reading an object.

◆ call_any()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::call_any ( const std::invocable auto &  function)
inline

Like read_any, but invokes the given function instead of reading an object.

◆ call_at_least()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::call_at_least ( std::size_t  count,
const std::invocable auto &  function 
)
inline

Like read_at_least, but invokes the given function instead of reading an object.

◆ call_at_most()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::call_at_most ( std::size_t  count,
const std::invocable auto &  function 
)
inline

Like read_at_most, but invokes the given function instead of reading an object.

◆ call_exact()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::call_exact ( std::size_t  count,
const std::invocable auto &  function 
)
inline

Like read_exact, but invokes the given function instead of reading an object.

◆ call_optional()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::call_optional ( const std::invocable auto &  function)
inline

Like read_optional, but invokes the given function instead of reading an object.

◆ call_range()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::call_range ( std::size_t  min,
std::size_t  max,
const std::invocable auto &  function 
)
inline

Like read_range, but invokes the given function instead of reading an object.

◆ call_repeated()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::call_repeated ( const Is_repeat auto &  repeat,
const std::invocable auto &  function 
)
inline

Like read_repeated, but invokes the given function instead of reading an object.

◆ call_repeated_with_separators()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::call_repeated_with_separators ( const std::invocable auto &  function,
const std::string_view &  separator,
const Is_repeat auto &  repeat,
Allow_repeated_separators  allow_repeated_separators,
Leading_separators  leading_separators,
Trailing_separators  trailing_separators 
)
inline

Like read_repeated_with_separators, but invokes a function instead of reads into an object.

See also
read_repeated_with_separators.

◆ call_unconditionally()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::call_unconditionally ( const std::invocable auto &  function)
inline

Invoke the given invocable regardless o the open/closed state.

◆ check_prev_token()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::check_prev_token ( const std::invocable auto &  checker)
inline

If the state is not "closed", invoke the given invocable.

If that changes the state of the underlying Parse_stat to not-ok, rewind the position to before the last token.

Parameters
checkerInvocable to invoke.

◆ do_call()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::do_call ( const Is_repeat auto &  repeat,
const std::invocable auto &  function 
)
inlineprivate

Invoke the given function with the given number of repetitions.

This function performs the bookkeeping of progressing the Fluent_state, of tracking the position before the token (used by subsequent check_prev_token calls), and of rewinding the position to m_backtrack_position after parse errors.

◆ end_optional()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::end_optional ( )
inline

If the state is not "closed" save the current position, and if a subsequent invocation of a member function fails, rewind to the saved position and suppress the error.

◆ literal()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::literal ( const std::string_view &  sv)
inline

Like read, but skips the given string literal.

◆ literal_any()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::literal_any ( const std::string_view &  sv)
inline

Like read_any, but skips the given string literal.

◆ literal_at_least()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::literal_at_least ( std::size_t  count,
const std::string_view &  sv 
)
inline

Like read_at_least, but skips the given string literal.

◆ literal_at_most()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::literal_at_most ( std::size_t  count,
const std::string_view &  sv 
)
inline

Like read_at_most, but skips the given string literal.

◆ literal_exact()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::literal_exact ( std::size_t  count,
const std::string_view &  sv 
)
inline

Like read_exact, but skips the given string literal.

◆ literal_optional()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::literal_optional ( const std::string_view &  sv)
inline

Like read_optional, but skips the given string literal.

◆ literal_range()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::literal_range ( std::size_t  min,
std::size_t  max,
const std::string_view &  sv 
)
inline

Like read_range, but skips the given string literal.

◆ literal_repeated()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::literal_repeated ( const Is_repeat auto &  repeat,
const std::string_view &  sv 
)
inline

Like read_repeated, but skips the given string literal.

◆ next_token_only_if() [1/2]

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::next_token_only_if ( bool  condition)
inline

Suppress the next token if condition is false.

Parameters
conditionIf false, the state will be "closed" while processing the following token.

◆ next_token_only_if() [2/2]

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::next_token_only_if ( const std::invocable auto &  condition)
inline

If the states is not "closed", suppress the next token if condition evaluates to false.

Parameters
conditionIf this evaluates to false, the state will be "closed" while processing the following token.

◆ operator=() [1/2]

template<Is_format Format_t>
Fluent_parser & mysql::strconv::Fluent_parser< Format_t >::operator= ( const Fluent_parser< Format_t > &  )
delete

◆ operator=() [2/2]

template<Is_format Format_t>
Fluent_parser & mysql::strconv::Fluent_parser< Format_t >::operator= ( Fluent_parser< Format_t > &&  )
defaultnoexcept

◆ read()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::read ( auto &  obj)
inline

If the state is not "closed", read into the given object once.

◆ read_any()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::read_any ( auto &  obj)
inline

If the state is not "closed" read repeatedly into the given object until it fails.

Then, if the error is parse_error, restore to the previous position after the last successful read and suppress the error.

◆ read_at_least()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::read_at_least ( std::size_t  count,
auto &  obj 
)
inline

If the state is not "closed" read repeatedly into the given object until it fails.

Then, if the error is parse_error and at least count instances were read, restore to the previous position after the last successful read and suppress the error.

◆ read_at_most()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::read_at_most ( std::size_t  count,
auto &  obj 
)
inline

If the state is not "closed" read repeatedly into the given object until count instances are found or it fails.

If that failed with parse_error, restore to the previous position after the last successful read and suppress the error.

◆ read_exact()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::read_exact ( std::size_t  count,
auto &  obj 
)
inline

If the state is not "closed", read into the given object count times.

◆ read_optional()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::read_optional ( auto &  obj)
inline

If the state is not "closed" read into the given object once; if that fails with parse error, restore to the previous position and suppress the error.

◆ read_range()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::read_range ( std::size_t  min,
std::size_t  max,
auto &  obj 
)
inline

If the state is not "closed" read repeatedly into the given object until max instances are found or it fails.

If that failed with parse_error and at least count instances were read, restore to the previous position after the last successful read and suppress the error.

◆ read_repeated()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::read_repeated ( const Is_repeat auto &  repeat,
auto &  object 
)
inline

If the state is not "closed" read with a number of repetitions specified by the given Is_repeat object.

If that failed with parse_error and at least the minimum number of repetitions were read, restore to the previous position after the last successful read and suppress the error.

◆ read_repeated_with_separators()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::read_repeated_with_separators ( auto &  object,
const std::string_view &  separator,
const Is_repeat auto &  repeat,
Allow_repeated_separators  allow_repeated_separators,
Leading_separators  leading_separators,
Trailing_separators  trailing_separators 
)
inline

Reads repeatedly into the given object, using the given number of repetitions, and skipping string literals equal to the given string_view between reads.

Parameters
objectObject to read into.
separatorString separator to read between objects.
repeatThe range of allowed repetitions. If fewer than the minimum number of reads succeeded, the Parser remains in error state and this Fluent_parser is closed. If at least the minimum number of reads succeed and a parse error occurs, the error of the Parser is suppressed and the Fluent_parser remains open.
allow_repeated_separatorsWhen a separator is expected in the input string, this controls the number of repetitions allowed: if no, exactly one instance of the separator is parsed; if yes, one or more separators are parsed.
leading_separatorsIf yes, the separator is required before the first read. If no, the first read is attempted without reading the separator. If optional, a separator preceding the first read is optional.
trailing_separatorsIf yes, the separator is required after the last read. If no, the separator is not read after the last read. If optional, a separator after the last read is optional.

◆ read_with_format()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::read_with_format ( const auto &  format,
auto &  obj 
)
inline

If the state is not "closed", read into the given object once.

◆ read_with_format_any()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::read_with_format_any ( const auto &  format,
auto &  obj 
)
inline

If the state is not "closed" read repeatedly into the given object until it fails.

Then, if the error is parse_error, restore to the previous position after the last successful read and suppress the error.

◆ read_with_format_at_least()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::read_with_format_at_least ( const auto &  format,
std::size_t  count,
auto &  obj 
)
inline

If the state is not "closed" read repeatedly into the given object until it fails.

Then, if the error is parse_error and at least count instances were read, restore to the previous position after the last successful read and suppress the error.

◆ read_with_format_at_most()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::read_with_format_at_most ( const auto &  format,
std::size_t  count,
auto &  obj 
)
inline

If the state is not "closed" read repeatedly into the given object until count instances are found or it fails.

If that failed with parse_error, restore to the previous position after the last successful read and suppress the error.

◆ read_with_format_exact()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::read_with_format_exact ( const auto &  format,
std::size_t  count,
auto &  obj 
)
inline

If the state is not "closed" read into the given object count times.

◆ read_with_format_optional()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::read_with_format_optional ( const auto &  format,
auto &  obj 
)
inline

If the state is not "closed" read into the given object once; if that fails with parse error, restore to the previous position and suppress the error.

◆ read_with_format_range()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::read_with_format_range ( const auto &  format,
std::size_t  min,
std::size_t  max,
auto &  obj 
)
inline

If the state is not "closed" read repeatedly into the given object until max instances are found or it fails.

If that failed with parse_error and at least count instances were read, restore to the previous position after the last successful read and suppress the error.

◆ read_with_format_repeated()

template<Is_format Format_t>
Self_t & mysql::strconv::Fluent_parser< Format_t >::read_with_format_repeated ( const auto &  format,
const Is_repeat auto &  repeat,
auto &  object 
)
inline

If the state is not "closed" read with a number of repetitions specified by the given Is_repeat object.

If that failed with parse_error and at least the minimum number of repetitions were read, restore to the previous position after the last successful read and suppress the error.

Member Data Documentation

◆ m_backtrack_position

template<Is_format Format_t>
std::ptrdiff_t mysql::strconv::Fluent_parser< Format_t >::m_backtrack_position {no_backtrack_position}
private

Previous position we parsed to at which it is OK to stop parsing in case a parse error occurs.

Set by end_optional.

◆ m_before_last_token

template<Is_format Format_t>
std::ptrdiff_t mysql::strconv::Fluent_parser< Format_t >::m_before_last_token {0}
private

Position before the last parsed token.

Used if check_prev_token sets an error state.

◆ m_fluent_state

template<Is_format Format_t>
Fluent_state mysql::strconv::Fluent_parser< Format_t >::m_fluent_state {Fluent_state::open}
private

The open/closed state.

◆ m_format

template<Is_format Format_t>
Format_t mysql::strconv::Fluent_parser< Format_t >::m_format
private

Format used to parse objects.

◆ m_parser

template<Is_format Format_t>
Parser& mysql::strconv::Fluent_parser< Format_t >::m_parser
private

Underlying Parser that this Fluent_parser operates on.

◆ no_backtrack_position

template<Is_format Format_t>
constexpr std::ptrdiff_t mysql::strconv::Fluent_parser< Format_t >::no_backtrack_position = -1
staticconstexprprivate

Value used by m_backtrack_position, indicating that end_optional has not been invoked.


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