ChainCLI
A modern C++20 command-line interface library
Loading...
Searching...
No Matches
cli::parsing::ParseException Class Reference

Exception thrown when parsing for an argument fails. More...

#include <parse_exception.h>

Inheritance diagram for cli::parsing::ParseException:

Public Member Functions

 ParseException (const std::string &message, const std::string &input, const cli::commands::ArgumentBase &argument)
 Construct a ParseException with a message, input string, and argument.
 
 ParseException (const std::string &input, const cli::commands::ArgumentBase &argument)
 Construct a ParseException with default message, input string, and argument.
 
const std::string & getInput () const noexcept
 Gets the input string that failed to parse.
 
const cli::commands::ArgumentBasegetArgument () const noexcept
 Gets the argument that failed to parse.
 

Detailed Description

Exception thrown when parsing for an argument fails.

Constructor & Destructor Documentation

◆ ParseException() [1/2]

cli::parsing::ParseException::ParseException ( const std::string &  message,
const std::string &  input,
const cli::commands::ArgumentBase argument 
)
inline

Construct a ParseException with a message, input string, and argument.

Parameters
messageThe error message
inputThe input string that failed to parse
argumentThe argument that failed to parse

◆ ParseException() [2/2]

cli::parsing::ParseException::ParseException ( const std::string &  input,
const cli::commands::ArgumentBase argument 
)
inline

Construct a ParseException with default message, input string, and argument.

Parameters
inputThe input string that failed to parse
argumentThe argument that failed to parse

Member Function Documentation

◆ getArgument()

const cli::commands::ArgumentBase & cli::parsing::ParseException::getArgument ( ) const
inlinenoexcept

Gets the argument that failed to parse.

Returns
reference to the argument

◆ getInput()

const std::string & cli::parsing::ParseException::getInput ( ) const
inlinenoexcept

Gets the input string that failed to parse.

Returns
the input string

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