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 @@ ...@@ -5,6 +5,7 @@
#include <stdexcept> #include <stdexcept>
#include <string> #include <string>
#include <vector> #include <vector>
#include <iostream>
#define POSIX_SOURCE 1 #define POSIX_SOURCE 1
...@@ -198,13 +199,16 @@ namespace Utilities { ...@@ -198,13 +199,16 @@ namespace Utilities {
/** /**
Throw this exception if an error occured inside the Options package. Throw this exception if an error occured inside the Options package.
*/ */
/* class X_OptionError: public std::exception { */ class X_OptionError: public std::exception {
/* public: */ public:
/* X_OptionError() throw() {}; */ X_OptionError() throw() {};
/* virtual const char * what() const throw() { */ X_OptionError(const string& s) throw() {cerr << s << endl;}
/* return "There were errors parsing the command line!"; */ 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. Throw this exception if no matching option was found during parsing.
...@@ -250,8 +254,8 @@ namespace Utilities { ...@@ -250,8 +254,8 @@ namespace Utilities {
/* string str_; */ /* string str_; */
/* }; */ /* }; */
/* /** */ /* */
/* */ */ /* */
/* class X_InvalidArgument: public X_OptionError { */ /* class X_InvalidArgument: public X_OptionError { */
/* public: */ /* public: */
/* X_InvalidArgument(const string& o, const string& v) throw(): */ /* X_InvalidArgument(const string& o, const string& v) throw(): */
...@@ -393,8 +397,8 @@ int main(unsigned int argc, char **argv) { ...@@ -393,8 +397,8 @@ int main(unsigned int argc, char **argv) {
@return true on success. @return true on success.
*/ */
unsigned int parse_option(const string& optstr, const string& valstr) unsigned int parse_option(const string& optstr, const string& valstr)
// throw(X_AlreadySet, X_UnknownOption, throw(X_OptionError);
// X_MissingArgument, X_InvalidArgument);
/** /**
@param str A string of the form --option[=value]. @param str A string of the form --option[=value].
@return true on success. @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