X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ffeature.cpp;h=891ba72c8514452094a3bef79feb14cb08a3be9a;hb=d1f9551e05c9d341149eb490e05b1465d3d6b711;hp=7c19af5c40b5af674b00ff1f0068cc35134a8ae1;hpb=55a110c49b85482c4079745211cc599f4508945f;p=builder.git diff --git a/source/feature.cpp b/source/feature.cpp index 7c19af5..891ba72 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) +{ } -#include "feature.h" Feature::Loader::Loader(Feature &f): - Msp::DataFile::BasicLoader(f) + Msp::DataFile::ObjectLoader(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); }