]> git.tdb.fi Git - builder.git/blob - source/feature.cpp
891ba72c8514452094a3bef79feb14cb08a3be9a
[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 { }
9
10
11 Feature::Loader::Loader(Feature &f):
12         Msp::DataFile::ObjectLoader<Feature>(f)
13 {
14         add("choice",      &Loader::choice);
15         add("description", &Feature::description);
16         add("default",     &Feature::default_value);
17         add("export",      &Feature::exported);
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 }