summaryrefslogtreecommitdiff
path: root/option.h
blob: 778b16ba3041c67742c2f8206c28e2b51b3b31b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef _OPTION_H
#define _OPTION_H

#include <list>
#include <map>
#include <string>
#include <exception>

#include "xpath.h"
#include "error.h"

namespace ledger {

bool process_option(const std::string& name, xml::xpath_t::scope_t * scope,
		    const char * arg = NULL);

void process_environment(const char ** envp, const std::string& tag,
			 xml::xpath_t::scope_t * scope);

void process_arguments(int argc, char ** argv, const bool anywhere,
		       xml::xpath_t::scope_t * scope,
		       std::list<std::string>& args);

class option_error : public error {
 public:
  option_error(const std::string& reason) throw() : error(reason) {}
  virtual ~option_error() throw() {}
};

} // namespace ledger

#endif // _OPTION_H