Skip to content
Snippets Groups Projects
Commit 05c75007 authored by Christian Beckmann's avatar Christian Beckmann
Browse files

*** empty log message ***

parent bb2688c0
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@
#include <stdexcept>
#include <string>
#include <vector>
#include <iostream>
#define POSIX_SOURCE 1
......@@ -198,13 +199,16 @@ namespace Utilities {
/**
Throw this exception if an error occured inside the Options package.
*/
/* class X_OptionError: public std::exception { */
/* public: */
/* X_OptionError() throw() {}; */
/* virtual const char * what() const throw() { */
/* return "There were errors parsing the command line!"; */
/* } */
/* }; */
class X_OptionError: public std::exception {
public:
X_OptionError() throw() {};
X_OptionError(const string& s) throw() {cerr << s << endl;}
X_OptionError(const string& o, const string& v) throw() {
cerr << o << ":invalid argument " << v <<"!" <<endl; }
virtual const char * what() const throw() {
return "There were errors parsing the command line!";
}
};
/**
Throw this exception if no matching option was found during parsing.
......@@ -250,8 +254,8 @@ namespace Utilities {
/* string str_; */
/* }; */
/* /** */
/* */ */
/* */
/* */
/* class X_InvalidArgument: public X_OptionError { */
/* public: */
/* X_InvalidArgument(const string& o, const string& v) throw(): */
......@@ -393,8 +397,8 @@ int main(unsigned int argc, char **argv) {
@return true on success.
*/
unsigned int parse_option(const string& optstr, const string& valstr)
// throw(X_AlreadySet, X_UnknownOption,
// X_MissingArgument, X_InvalidArgument);
throw(X_OptionError);
/**
@param str A string of the form --option[=value].
@return true on success.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment