]> git.tdb.fi Git - builder.git/blob - source/config.h
Builder can build itself now.
[builder.git] / source / config.h
1 #ifndef CONFIG_H_
2 #define CONFIG_H_
3
4 #include <map>
5 #include <string>
6 #include "option.h"
7
8 typedef std::map<std::string, std::string> RawOptionMap;
9
10 class Config
11 {
12 public:
13         struct Option
14         {
15                 std::string name;
16                 std::string defv;
17                 std::string descr;
18                 std::string value;
19
20                 Option(const std::string &, const std::string &, const std::string &);
21         };
22         typedef std::map<std::string, Option> OptionMap;
23
24         void add_option(const std::string &, const std::string &, const std::string &);
25         const Option &get_option(const std::string &) const;
26         bool is_option(const std::string &) const;
27         bool process(const RawOptionMap &);
28         void load(const std::string &); 
29 private:
30         OptionMap options;
31 };
32
33 #endif