X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fconfig.cpp;h=69abe9d0b51b929d84a50ee08f3e9d7ef2bbb673;hb=HEAD;hp=50e0de9f9a165bfd9e461c6d8a194e1a756c316c;hpb=59ac0a44d6edf179c01604c6ced744873213f855;p=builder.git diff --git a/source/config.cpp b/source/config.cpp deleted file mode 100644 index 50e0de9..0000000 --- a/source/config.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include -#include "config.h" - -using namespace std; -using namespace Msp; - -void Config::add_option(const string &n, const string &v, const string &d) -{ - options.insert(OptionMap::value_type(n, Option(n, v, d))); -} - -const Config::Option &Config::get_option(const string &name) const -{ - OptionMap::const_iterator i=options.find(name); - if(i==options.end()) - throw Exception("Tried to access nonexistent option "+name); - - return i->second; -} - -bool Config::is_option(const string &name) const -{ - return options.count(name); -} - -bool Config::process(const RawOptionMap &opts) -{ - bool changed=false; - for(RawOptionMap::const_iterator i=opts.begin(); i!=opts.end(); ++i) - { - OptionMap::iterator j=options.find(i->first); - if(j!=options.end()) - { - if(i->second!=j->second.value) - changed=true; - j->second.value=i->second; - } - } - - return changed; -} - -Config::Option::Option(const string &n, const string &v, const string &d): - name(n), - defv(v), - descr(d), - value(v) -{ }