X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ffeature.cpp;h=7bf9a578e0344a6321a1b1e9516af565221b3c6a;hb=ae1ab287b544cc19d185024fa64e475a957313e4;hp=54ed5147f622796ba3e6a6d5ae13444b764ab559;hpb=0458300fda4f345f865a7f3ee4fc0f2020a91983;p=builder.git diff --git a/source/feature.cpp b/source/feature.cpp index 54ed514..7bf9a57 100644 --- a/source/feature.cpp +++ b/source/feature.cpp @@ -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(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); }