diff options
Diffstat (limited to 'option.h')
-rw-r--r-- | option.h | 20 |
1 files changed, 6 insertions, 14 deletions
@@ -1,11 +1,9 @@ #ifndef _OPTION_H #define _OPTION_H -#include <list> -#include <string> -#include <exception> +#include "utils.h" -#include "error.h" +namespace ledger { typedef void (*handler_t)(const char * arg); @@ -17,20 +15,14 @@ struct option_t { bool handled; }; -class option_error : public error { - public: - option_error(const std::string& reason) throw() : error(reason) {} - virtual ~option_error() throw() {} -}; +DECLARE_EXCEPTION(error, option_error); -bool process_option(option_t * options, const std::string& opt, +bool process_option(option_t * options, const string& opt, const char * arg = NULL); void process_arguments(option_t * options, int argc, char ** argv, - const bool anywhere, std::list<std::string>& args); + const bool anywhere, std::list<string>& args); void process_environment(option_t * options, const char ** envp, - const std::string& tag); - -namespace ledger { + const string& tag); class config_t; class report_t; |