24#ifndef TCLAP_ARG_EXCEPTION_H
25#define TCLAP_ARG_EXCEPTION_H
47 std::string
id =
"undefined",
48 std::string td =
"Generic ArgException")
50 _errorText(std::move(text)),
51 _argId(std::move(id)),
52 _typeDescription(std::move(td)),
53 _what(_argId +
" -- " + _errorText) {}
63 [[nodiscard]] std::
string error()
const {
return (_errorText); }
68 [[nodiscard]] std::string
argId()
const {
69 if (_argId ==
"undefined")
72 return (
"Argument: " + _argId);
78 [[nodiscard]]
const char *
what() const noexcept
override {
92 std::string _errorText;
103 std::string _typeDescription;
122 const std::string &
id =
"undefined")
124 std::string(
"Exception found while parsing ") +
125 std::string(
"the value the Arg has been passed.")) {}
141 const std::string &
id =
"undefined")
143 std::string(
"Exception found when the values ") +
144 std::string(
"on the command line do not meet ") +
145 std::string(
"the requirements of the defined ") +
146 std::string(
"Args.")) {}
162 const std::string &
id =
"undefined")
164 std::string(
"Exception found when an Arg object ") +
165 std::string(
"is improperly defined by the ") +
166 std::string(
"developer.")) {}
A simple class that defines and argument exception.
~ArgException() noexcept override=default
Destructor.
const char * what() const noexcept override
Returns the arg id and error text.
std::string typeDescription() const
Returns the type of the exception.
std::string argId() const
Returns the argument id.
std::string error() const
Returns the error text.
ArgException(std::string text="undefined exception", std::string id="undefined", std::string td="Generic ArgException")
Constructor.
Thrown from within the child Arg classes when it fails to properly parse the argument it has been pas...
ArgParseException(const std::string &text="undefined exception", const std::string &id="undefined")
Constructor.
Thrown from CmdLine when the arguments on the command line are not properly specified,...
CmdLineParseException(const std::string &text="undefined exception", const std::string &id="undefined")
Constructor.
Thrown when TCLAP thinks the program should exit.
int getExitStatus() const noexcept
Thrown from Arg and CmdLine when an Arg is improperly specified, e.g.
SpecificationException(const std::string &text="undefined exception", const std::string &id="undefined")
Constructor.