summaryrefslogtreecommitdiff
path: root/option.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-08-03 04:34:50 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:40:47 -0400
commita32173ace60df5a1e9414f5e95b556c436f62718 (patch)
treefff5b881c657fddb8543b0f787bfa75cf009a0b7 /option.h
parentcc98b59d1e99238270eb307b117da8b0b35e6f27 (diff)
downloadfork-ledger-a32173ace60df5a1e9414f5e95b556c436f62718.tar.gz
fork-ledger-a32173ace60df5a1e9414f5e95b556c436f62718.tar.bz2
fork-ledger-a32173ace60df5a1e9414f5e95b556c436f62718.zip
changes
Diffstat (limited to 'option.h')
-rw-r--r--option.h44
1 files changed, 0 insertions, 44 deletions
diff --git a/option.h b/option.h
deleted file mode 100644
index 2e4d7599..00000000
--- a/option.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef _OPTION_H
-#define _OPTION_H
-
-#include <list>
-#include <string>
-#include <exception>
-
-struct option_handler {
- bool handled;
- option_handler() : handled(false) {}
- virtual void operator()(const char * arg = NULL) = 0;
-};
-
-struct option_t {
- char short_opt;
- std::string long_opt;
- bool wants_arg;
- option_handler * handler;
-
- option_t() : short_opt(0), wants_arg(false), handler(NULL) {}
-};
-
-class option_error : public std::exception {
- std::string reason;
- public:
- option_error(const std::string& _reason) throw() : reason(_reason) {}
- virtual ~option_error() throw() {}
-
- virtual const char* what() const throw() {
- return reason.c_str();
- }
-};
-
-void add_option_handler(std::list<option_t>& options, const std::string& label,
- const std::string& opt_chars, option_handler& option);
-bool process_option(std::list<option_t>& options,
- const std::string& opt, const char * arg = NULL);
-void process_arguments(std::list<option_t>& options,
- int argc, char ** argv, const bool anywhere,
- std::list<std::string>& args);
-void process_environment(std::list<option_t>& options,
- char ** envp, const std::string& tag);
-
-#endif // _OPTION_H