mrdocs::ParseResult

The result of a parse operation.

Synopsis

Declared in <mrdocs/Support/Parse.hpp>
struct ParseResult;

Member Functions

Name Description
operator bool Conversion to bool

Data Members

Name
ec
ptr

Friends

|===
Name Description
operator== Equality operator

Non-Member Functions

Name Description
parseParse a string view

Description

This class holds the result of a parse operation. The structure is similar to std::from_chars_result, where we have a ptr member that points to the first character not parsed, and a ec member that holds the error code.

If parsing was successful, then ec stores a default constructed Error object, which indicates success. The operator bool can also be used to check for success.

The typical format of a parsing function is:

ParseResult parseType( char const* first, char const* last, Type& value);

where more parameters can be defined as needed for parsing options.

Created with MrDocs