diff options
Diffstat (limited to 'project2/if.cpp')
-rw-r--r-- | project2/if.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/project2/if.cpp b/project2/if.cpp index 8fc210d..4531b89 100644 --- a/project2/if.cpp +++ b/project2/if.cpp @@ -4,7 +4,7 @@ DECLARE_LOADER("if", If); -class IfModeIsNonsense : public std::exception { }; +SimpleMessageException(IfModeIsNonsense); IfSet::IfSet(const xmlpp::Element * e) : mode(e->get_attribute_value("mode") == "or" ? Or : And) @@ -33,7 +33,7 @@ IfSet::passes() const } return false; } - throw IfModeIsNonsense(); + throw IfModeIsNonsense(getName()); } If::If(const xmlpp::Element * e) : @@ -44,11 +44,13 @@ If::If(const xmlpp::Element * e) : { } -void If::loadComplete(const CommonObjects*) +void +If::loadComplete(const CommonObjects*) { } -void If::execute(const Presenter * presenter) const +void +If::execute(const Presenter * presenter) const { if (passes()) { Logger()->messagef(LOG_DEBUG, "IfSet passed, showing %zu views", subViews.size()); @@ -58,7 +60,8 @@ void If::execute(const Presenter * presenter) const } } -void If::execute() const +void +If::execute() const { if (passes()) { Logger()->message(LOG_DEBUG, "IfSet passed"); @@ -68,4 +71,9 @@ void If::execute() const } } +const std::string & +If::getName() const +{ + return name; +} |