26 #ifndef DtCmdLine_ARG_EXCEPTION_H
27 #define DtCmdLine_ARG_EXCEPTION_H
33 #ifdef DtUSE_UTILITIES_NAMESPACE
34 namespace DtUSE_UTILITIES_NAMESPACE
53 const std::string&
id =
"undefined",
54 const std::string& td =
"Generic ArgException")
71 {
return ( _errorText ); }
78 if ( _argId ==
"undefined" )
81 return (
"Argument: " + _argId );
87 const char*
what()
const throw()
89 _ex = _argId +
" -- " + _errorText;
99 return _typeDescription;
141 const std::string&
id =
"undefined" )
144 std::string(
"Exception found while parsing " ) +
145 std::string(
"the value the Arg has been passed." ))
163 const std::string&
id =
"undefined" )
166 std::string(
"Exception found when the values ") +
167 std::string(
"on the command line do not meet ") +
168 std::string(
"the requirements of the defined ") +
169 std::string(
"Args." ))
187 const std::string&
id =
"undefined" )
190 std::string(
"Exception found when an Arg object ")+
191 std::string(
"is improperly defined by the ") +
192 std::string(
"developer." ))
199 #ifdef DtUSE_UTILITIES_NAMESPACE
Thrown from Arg and CmdLine when an Arg is improperly specified, e.g.
Definition: cmdArgException.h:177
virtual ~ArgException()
Destructor.
Definition: cmdArgException.h:64
std::string typeDescription() const
Returns the type of the exception.
Definition: cmdArgException.h:97
Thrown from CmdLine when the arguments on the command line are not properly specified, e.g.
Definition: cmdArgException.h:153
Thrown from within the child Arg classes when it fails to properly parse the argument it has been pas...
Definition: cmdArgException.h:131
std::string argId() const
Returns the argument id.
Definition: cmdArgException.h:76
A simple class that defines and argument exception.
Definition: cmdArgException.h:43
ArgParseException(const std::string &text="undefined exception", const std::string &id="undefined")
Constructor.
Definition: cmdArgException.h:140
std::string _errorText
The text of the exception message.
Definition: cmdArgException.h:108
std::string error() const
Returns the error text.
Definition: cmdArgException.h:70
std::string _argId
The argument related to this exception.
Definition: cmdArgException.h:113
ArgException(const std::string &text="undefined exception", const std::string &id="undefined", const std::string &td="Generic ArgException")
Constructor.
Definition: cmdArgException.h:52
SpecificationException(const std::string &text="undefined exception", const std::string &id="undefined")
Constructor.
Definition: cmdArgException.h:186
std::string _ex
The exception text.
Definition: cmdArgException.h:124
std::string _typeDescription
Describes the type of the exception.
Definition: cmdArgException.h:119
const char * what() const
Returns the arg id and error text.
Definition: cmdArgException.h:87
CmdLineParseException(const std::string &text="undefined exception", const std::string &id="undefined")
Constructor.
Definition: cmdArgException.h:162