]> git.tdb.fi Git - builder.git/blobdiff - source/feature.cpp
Inline simple constructors
[builder.git] / source / feature.cpp
index 7c19af5c40b5af674b00ff1f0068cc35134a8ae1..25183777aab27c3b31715455114510d02a27760e 100644 (file)
@@ -1,15 +1,20 @@
-/* $Id$
-
-This file is part of builder
-Copyright © 2009  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #include "feature.h"
 
+using namespace std;
+using namespace Msp;
+
 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);
+       add("export",      &Feature::exported);
+}
+
+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);
 }