blob: 0110edd9c6489ae050a1c3f19a70b7002565445c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#include "cru/ui/mapper/style/HoverConditionMapper.h"
#include "cru/base/ClonablePtr.h"
#include "cru/ui/style/Condition.h"
namespace cru::ui::mapper::style {
using namespace cru::ui::style;
bool HoverConditionMapper::XmlElementIsOfThisType(xml::XmlElementNode* node) {
return node->GetTag().CaseInsensitiveEqual(u"HoverCondition");
}
ClonablePtr<HoverCondition> HoverConditionMapper::DoMapFromXml(
xml::XmlElementNode* node) {
auto value = node->GetAttributeValueCaseInsensitive(u"value");
if (value.CaseInsensitiveEqual(u"true")) {
return ui::style::HoverCondition::Create(true);
} else if (value.CaseInsensitiveEqual(u"false")) {
return ui::style::HoverCondition::Create(false);
} else {
throw Exception(u"Invalid value for HoverCondition: " + value);
}
}
} // namespace cru::ui::mapper::style
|