X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ffeature.cpp;h=712004fc6125a9b5f3fb616b6464bb91d70d80c1;hb=c75c89d2425ab0c69e94d45a5d956286838bbc67;hp=54ed5147f622796ba3e6a6d5ae13444b764ab559;hpb=0458300fda4f345f865a7f3ee4fc0f2020a91983;p=builder.git diff --git a/source/feature.cpp b/source/feature.cpp index 54ed514..712004f 100644 --- a/source/feature.cpp +++ b/source/feature.cpp @@ -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::ObjectLoader(f) { - add("description", &Feature::descr); - add("default", &Feature::def_value); + add("choice", &Loader::choice); + add("description", &Feature::description); + add("default", &Feature::default_value); +} + +void Feature::Loader::choice(const string &c) +{ + if(obj.choices.empty()) + obj.default_value = c; + obj.choices.push_back(c); }