21#include "commands/argument.h" 
   22#include "commands/argument_group.h" 
   35        : std::runtime_error(message), input(input), argument(argument)
 
 
   43        : 
ParseException(std::format(
"Failed to parse input '{}' for argument: {}", input, argument.getName()), input, argument)
 
 
   49    const std::string &
getInput() const noexcept { 
return input; }
 
 
   68    TypeParseException(
const std::string &message, 
const std::string &input, 
const std::type_info &targetType)
 
   69        : std::runtime_error(message), input(input), targetType(targetType)
 
 
   77        : 
TypeParseException(std::format(
"Could not parse '{}' to type '{}'", input, targetType.name()), input, targetType)
 
 
   83    const std::string &
getInput() const noexcept { 
return input; }
 
   87    const std::type_info &
getTargetType() const noexcept { 
return targetType; }
 
   91    const std::type_info &targetType;
 
 
  102        : std::runtime_error(message), argumentGroup(argumentGroup)
 
 
 
Base class for command-line arguments.
Definition argument.h:41
Base class for command-line argument groups.
Definition argument_group.h:30
Exception thrown when parsing a group of arguments fails.
Definition parse_exception.h:96
GroupParseException(const std::string &message, const cli::commands::ArgumentGroup &argumentGroup)
Construct a GroupParseException with a message and argument group.
Definition parse_exception.h:101
const cli::commands::ArgumentGroup & getArgumentGroup() const noexcept
Gets the argument group that failed to parse.
Definition parse_exception.h:115
GroupParseException(const cli::commands::ArgumentGroup &argumentGroup)
Construct a GroupParseException with default message and argument group.
Definition parse_exception.h:108
Exception thrown when parsing for an argument fails.
Definition parse_exception.h:28
ParseException(const std::string &input, const cli::commands::ArgumentBase &argument)
Construct a ParseException with default message, input string, and argument.
Definition parse_exception.h:42
const cli::commands::ArgumentBase & getArgument() const noexcept
Gets the argument that failed to parse.
Definition parse_exception.h:53
ParseException(const std::string &message, const std::string &input, const cli::commands::ArgumentBase &argument)
Construct a ParseException with a message, input string, and argument.
Definition parse_exception.h:34
const std::string & getInput() const noexcept
Gets the input string that failed to parse.
Definition parse_exception.h:49
Exception thrown when the input string cannot be parsed to the needed type for an argument.
Definition parse_exception.h:62
const std::type_info & getTargetType() const noexcept
Gets the target type that the input couldn't be parsed to.
Definition parse_exception.h:87
TypeParseException(const std::string &input, const std::type_info &targetType)
Construct a TypeParseException with default message, input string, and target type.
Definition parse_exception.h:76
TypeParseException(const std::string &message, const std::string &input, const std::type_info &targetType)
Construct a TypeParseException with a message, input string, and target type.
Definition parse_exception.h:68
const std::string & getInput() const noexcept
Gets the input string that failed to parse.
Definition parse_exception.h:83