class
parse_errorAn error generated when parsing fails.
Public functions
-
auto description() const → std::
string_view noexcept - Returns a textual description of the error.
-
auto source() const → const source_
region& noexcept - Returns the region of the source document responsible for the error.
Friends
-
auto operator<<(std::
ostream& lhs, const parse_ error& rhs) → std:: ostream& - Prints a parse_
error to a stream.
Function documentation
std:: string_view toml:: parse_error:: description() const noexcept
Returns a textual description of the error.
std:: ostream& operator<<(std:: ostream& lhs,
const parse_ error& rhs)
Prints a parse_
Parameters | |
---|---|
lhs | The stream. |
rhs | The parse_ |
Returns | The input stream. |
try { auto tbl = toml::parse("enabled = trUe"sv); } catch (const toml::parse_error & err) { std::cerr << "Parsing failed:\n"sv << err << "\n"; }
Parsing failed: Encountered unexpected character while parsing boolean; expected 'true', saw 'trU' (error occurred at line 1, column 13)