summaryrefslogtreecommitdiff
path: root/option.h
diff options
context:
space:
mode:
Diffstat (limited to 'option.h')
-rw-r--r--option.h20
1 files changed, 6 insertions, 14 deletions
diff --git a/option.h b/option.h
index 91838b99..1714d9db 100644
--- a/option.h
+++ b/option.h
@@ -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;