.. _program_listing_file__tmp_ws_src_ecl_core_ecl_command_line_include_ecl_command_line_arg_exception.hpp: Program Listing for File arg_exception.hpp ========================================== |exhale_lsh| :ref:`Return to documentation for file ` (``/tmp/ws/src/ecl_core/ecl_command_line/include/ecl/command_line/arg_exception.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /***************************************************************************** ** Ifdefs *****************************************************************************/ #ifndef TCLAP_ARG_EXCEPTION_H #define TCLAP_ARG_EXCEPTION_H #include #include namespace ecl { class ArgException : public std::exception { public: ArgException( const std::string& text = "undefined exception", const std::string& id = "undefined", const std::string& td = "Generic ArgException") : std::exception(), _errorText(text), _argId( id ), _typeDescription(td) { } virtual ~ArgException() throw() { } std::string error() const { return ( _errorText ); } std::string argId() const { if ( _argId == "undefined" ) return " "; else return ( "Argument: " + _argId ); } const char* what() const throw() { static std::string ex; ex = _argId + " -- " + _errorText; return ex.c_str(); } std::string typeDescription() const { return _typeDescription; } private: std::string _errorText; std::string _argId; std::string _typeDescription; }; class ArgParseException : public ArgException { public: ArgParseException( const std::string& text = "undefined exception", const std::string& id = "undefined" ) : ArgException( text, id, std::string( "Exception found while parsing " ) + std::string( "the value the Arg has been passed." )) { } }; class CmdLineParseException : public ArgException { public: CmdLineParseException( const std::string& text = "undefined exception", const std::string& id = "undefined" ) : ArgException( text, id, std::string( "Exception found when the values ") + std::string( "on the command line do not meet ") + std::string( "the requirements of the defined ") + std::string( "Args." )) { } }; class SpecificationException : public ArgException { public: SpecificationException( const std::string& text = "undefined exception", const std::string& id = "undefined" ) : ArgException( text, id, std::string("Exception found when an Arg object ")+ std::string("is improperly defined by the ") + std::string("developer." )) { } }; } // namespace ecl #endif