]> git.tdb.fi Git - builder.git/blobdiff - source/config.h
Add Id tag to all files
[builder.git] / source / config.h
index 2767f8263a827a67693ee18376d605e842077530..69094b59777027e5e08056ae6e37408b372feb98 100644 (file)
@@ -1,3 +1,10 @@
+/* $Id$
+
+This file is part of builder
+Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions
+Distributed under the LGPL
+*/
+
 #ifndef CONFIG_H_
 #define CONFIG_H_
 
@@ -6,8 +13,9 @@
 #include <msp/parser/loader.h>
 #include <msp/path/path.h>
 #include <msp/time/timestamp.h>
+#include "misc.h"
 
-typedef std::map<std::string, std::string> RawOptionMap;
+class Package;
 
 /**
 Manages configuration for a package.  A configuration may have an arbitary
@@ -30,6 +38,7 @@ public:
        };
        typedef std::map<std::string, Option> 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; }
@@ -37,8 +46,8 @@ public:
        bool is_option(const std::string &) const;
        void select_last_profile();
        void select_profile(const std::string &);
-       bool update(const RawOptionMap &);
-       void set_source(const Msp::Path::Path &s)     { source=s; }
+       bool update(const StringMap &);
+       void finish();
        void save() const;
 private:
        class Loader: public Msp::Parser::Loader
@@ -50,10 +59,11 @@ private:
                
                void option(const std::string &, const std::string &);
        };
-       
-       Msp::Path::Path source;
+
+       Package         &package;
        OptionMap       options;
        Msp::Time::TimeStamp mtime;
+       bool freeze_mtime;
 
        bool set_option(const std::string &, const std::string &);
        void load();