]> git.tdb.fi Git - builder.git/blobdiff - source/feature.cpp
Allow features to be exported
[builder.git] / source / feature.cpp
index 54ed5147f622796ba3e6a6d5ae13444b764ab559..7bf9a578e0344a6321a1b1e9516af565221b3c6a 100644 (file)
@@ -1,15 +1,27 @@
-/* $Id$
+#include "feature.h"
 
-This file is part of builder
-Copyright © 2009  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
+using namespace std;
+using namespace Msp;
+
+Feature::Feature(const string &n):
+       name(n),
+       default_value("no"),
+       exported(false)
+{ }
 
-#include "feature.h"
 
 Feature::Loader::Loader(Feature &f):
        Msp::DataFile::ObjectLoader<Feature>(f)
 {
-       add("description", &Feature::descr);
-       add("default",     &Feature::def_value);
+       add("choice",      &Loader::choice);
+       add("description", &Feature::description);
+       add("default",     &Feature::default_value);
+       add("export",      &Feature::exported);
+}
+
+void Feature::Loader::choice(const string &c)
+{
+       if(obj.choices.empty())
+               obj.default_value = c;
+       obj.choices.push_back(c);
 }