diff options
Diffstat (limited to 'project2/common/options.cpp')
-rw-r--r-- | project2/common/options.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/project2/common/options.cpp b/project2/common/options.cpp index 5c79163..fd93576 100644 --- a/project2/common/options.cpp +++ b/project2/common/options.cpp @@ -1,6 +1,5 @@ #include <pch.hpp> #include "options.h" -#include "environment.h" #include <boost/foreach.hpp> class NamedOption : public Options::Option { @@ -11,9 +10,9 @@ class NamedOption : public Options::Option { desc(d) { } - void consume(const Glib::ustring & n, const Glib::ustring & p, const VariableType & v) const { + void consume(const Glib::ustring & n, const Glib::ustring & p, const VariableType & v, const Options::CurrentPlatform & cp) const { if (n == id) { - target->consume(p, v); + target->consume(p, v, cp); } } void reset() const { @@ -44,9 +43,9 @@ class OptionAlias : public Options::Option { target(t) { } - void consume(const Glib::ustring & a, const Glib::ustring & p, const VariableType & v) const { + void consume(const Glib::ustring & a, const Glib::ustring & p, const VariableType & v, const Options::CurrentPlatform & cp) const { if (a == alias) { - target->target->consume(p, v); + target->target->consume(p, v, cp); } } void reset() const { @@ -108,10 +107,10 @@ Options::reset() const } void -Options::consume(const Glib::ustring & n, const Glib::ustring & p, const VariableType & v) const +Options::consume(const Glib::ustring & n, const Glib::ustring & p, const VariableType & v, const Options::CurrentPlatform & cp) const { BOOST_FOREACH(const OptionPtr & o, options) { - o->consume(n, p, v); + o->consume(n, p, v, cp); } } @@ -145,13 +144,13 @@ Options::InstanceTarget::paramRequired() const } void -Options::InstanceTarget::consume(const Glib::ustring & p, const VariableType & v) const +Options::InstanceTarget::consume(const Glib::ustring & p, const VariableType & v, const Options::CurrentPlatform & cp) const { if (ts != Platform && p.empty()) { assign(v); ts = Global; } - else if (!p.empty() && p == Environment::getCurrent()->platform()) { + else if (!p.empty() && p == cp) { assign(v); ts = Platform; } |