]> git.tdb.fi Git - builder.git/blobdiff - source/feature.cpp
Move the bpk files into a subdirectory and install them
[builder.git] / source / feature.cpp
index 7c19af5c40b5af674b00ff1f0068cc35134a8ae1..712004fc6125a9b5f3fb616b6464bb91d70d80c1 100644 (file)
@@ -1,15 +1,25 @@
-/* $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")
+{ }
 
-#include "feature.h"
 
 Feature::Loader::Loader(Feature &f):
-       Msp::DataFile::BasicLoader<Feature>(f)
+       Msp::DataFile::ObjectLoader<Feature>(f)
+{
+       add("choice",      &Loader::choice);
+       add("description", &Feature::description);
+       add("default",     &Feature::default_value);
+}
+
+void Feature::Loader::choice(const string &c)
 {
-       add("description", &Feature::descr);
-       add("default",     &Feature::def_value);
+       if(obj.choices.empty())
+               obj.default_value = c;
+       obj.choices.push_back(c);
 }