X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ffeature.cpp;h=7bf9a578e0344a6321a1b1e9516af565221b3c6a;hb=69cd5cc73f466181420711fb907979de58687a4c;hp=a483482c55e0a330c36a188a534f037d74fc08bf;hpb=153372211c242e539754680b5fe979e3be61ebfe;p=builder.git diff --git a/source/feature.cpp b/source/feature.cpp index a483482..7bf9a57 100644 --- a/source/feature.cpp +++ b/source/feature.cpp @@ -1,8 +1,27 @@ #include "feature.h" +using namespace std; +using namespace Msp; + +Feature::Feature(const string &n): + name(n), + default_value("no"), + exported(false) +{ } + + Feature::Loader::Loader(Feature &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) +{ + if(obj.choices.empty()) + obj.default_value = c; + obj.choices.push_back(c); }