6 #include <msp/parser/loader.h>
7 #include <msp/path/path.h>
8 #include <msp/time/timestamp.h>
10 typedef std::map<std::string, std::string> RawOptionMap;
13 Manages configuration for a package. A configuration may have an arbitary
14 amount of options, as well as a modification time (mtime).
20 A single configuration option.
29 Option(const std::string &, const std::string &, const std::string &);
31 typedef std::map<std::string, Option> OptionMap;
33 void add_option(const std::string &, const std::string &, const std::string &);
34 const Option &get_option(const std::string &) const;
35 const OptionMap &get_options() const { return options; }
36 const Msp::Time::TimeStamp &get_mtime() const { return mtime; }
37 bool is_option(const std::string &) const;
38 void select_last_profile();
39 void select_profile(const std::string &);
40 bool update(const RawOptionMap &);
41 void set_source(const Msp::Path::Path &s) { source=s; }
44 class Loader: public Msp::Parser::Loader
51 void option(const std::string &, const std::string &);
54 Msp::Path::Path source;
56 Msp::Time::TimeStamp mtime;
58 bool set_option(const std::string &, const std::string &);