X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ffeature.cpp;h=712004fc6125a9b5f3fb616b6464bb91d70d80c1;hb=c75c89d2425ab0c69e94d45a5d956286838bbc67;hp=a483482c55e0a330c36a188a534f037d74fc08bf;hpb=153372211c242e539754680b5fe979e3be61ebfe;p=builder.git diff --git a/source/feature.cpp b/source/feature.cpp index a483482..712004f 100644 --- a/source/feature.cpp +++ b/source/feature.cpp @@ -1,8 +1,25 @@ #include "feature.h" +using namespace std; +using namespace Msp; + +Feature::Feature(const string &n): + name(n), + default_value("no") +{ } + + Feature::Loader::Loader(Feature &f): Msp::DataFile::ObjectLoader(f) { + 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); +}