X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fconfig.h;h=1b7f853b21d11312ec3cecaeea0a8e7b21ac7bc6;hb=bb5c048950a011f181cb3235ed2b0b2677869171;hp=355108fb2c35bcd26f5c012c107dc4d587703212;hpb=74266a6e650f019063cdcd1c9a7bd26d8f99041b;p=builder.git diff --git a/source/config.h b/source/config.h index 355108f..1b7f853 100644 --- a/source/config.h +++ b/source/config.h @@ -1,13 +1,21 @@ +/* $Id$ + +This file is part of builder +Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions +Distributed under the LGPL +*/ + #ifndef CONFIG_H_ #define CONFIG_H_ #include #include -#include +#include #include #include +#include "misc.h" -typedef std::map RawOptionMap; +class Package; /** Manages configuration for a package. A configuration may have an arbitary @@ -30,16 +38,19 @@ public: }; typedef std::map OptionMap; + Config(Package &); void add_option(const std::string &, const std::string &, const std::string &); const Option &get_option(const std::string &) const; const OptionMap &get_options() const { return options; } const Msp::Time::TimeStamp &get_mtime() const { return mtime; } bool is_option(const std::string &) const; - bool process(const RawOptionMap &); - void load(const Msp::Path::Path &); - void save(const Msp::Path::Path &) const; + void select_last_profile(); + void select_profile(const std::string &); + bool update(const StringMap &); + void finish(); + void save() const; private: - class Loader: public Msp::Parser::Loader + class Loader: public Msp::DataFile::Loader { public: Loader(Config &); @@ -48,9 +59,14 @@ private: void option(const std::string &, const std::string &); }; - - OptionMap options; + + Package &package; + OptionMap options; Msp::Time::TimeStamp mtime; + bool freeze_mtime; + + bool set_option(const std::string &, const std::string &); + void load(); }; #endif