]> git.tdb.fi Git - builder.git/blob - source/feature.cpp
712004fc6125a9b5f3fb616b6464bb91d70d80c1
[builder.git] / source / feature.cpp
1 #include "feature.h"
2
3 using namespace std;
4 using namespace Msp;
5
6 Feature::Feature(const string &n):
7         name(n),
8         default_value("no")
9 { }
10
11
12 Feature::Loader::Loader(Feature &f):
13         Msp::DataFile::ObjectLoader<Feature>(f)
14 {
15         add("choice",      &Loader::choice);
16         add("description", &Feature::description);
17         add("default",     &Feature::default_value);
18 }
19
20 void Feature::Loader::choice(const string &c)
21 {
22         if(obj.choices.empty())
23                 obj.default_value = c;
24         obj.choices.push_back(c);
25 }