]> git.tdb.fi Git - builder.git/blob - source/feature.cpp
Refactor transitive dependencies to work on all targets
[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         exported(false)
10 { }
11
12
13 Feature::Loader::Loader(Feature &f):
14         Msp::DataFile::ObjectLoader<Feature>(f)
15 {
16         add("choice",      &Loader::choice);
17         add("description", &Feature::description);
18         add("default",     &Feature::default_value);
19         add("export",      &Feature::exported);
20 }
21
22 void Feature::Loader::choice(const string &c)
23 {
24         if(obj.choices.empty())
25                 obj.default_value = c;
26         obj.choices.push_back(c);
27 }