3 This file is part of builder
4 Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
13 #include <msp/datafile/loader.h>
14 #include <msp/path/path.h>
15 #include <msp/time/timestamp.h>
21 Manages configuration for a package. A configuration may have an arbitary
22 amount of options, as well as a modification time (mtime).
28 A single configuration option.
37 Option(const std::string &, const std::string &, const std::string &);
39 typedef std::map<std::string, Option> OptionMap;
41 Config(SourcePackage &);
42 void add_option(const std::string &, const std::string &, const std::string &);
43 const Option &get_option(const std::string &) const;
44 const OptionMap &get_options() const { return options; }
45 const Msp::Time::TimeStamp &get_mtime() const { return mtime; }
46 bool is_option(const std::string &) const;
47 void select_last_profile();
48 void select_profile(const std::string &);
49 bool update(const StringMap &);
53 class Loader: public Msp::DataFile::Loader
60 void option(const std::string &, const std::string &);
63 SourcePackage &package;
65 Msp::Time::TimeStamp mtime;
68 bool set_option(const std::string &, const std::string &);