diff options
| author | Yuqian Yang <crupest@crupest.life> | 2025-12-15 21:27:33 +0800 |
|---|---|---|
| committer | Yuqian Yang <crupest@crupest.life> | 2025-12-15 21:27:33 +0800 |
| commit | c77072d586bf7aca58e6465ceab3d11a0be0021f (patch) | |
| tree | 83605be90fd32104ef74bbd1d84d900aaf0271ce /src/ui/mapper/style/AndConditionMapper.cpp | |
| parent | bc3fa9650699046f3a87a620282ee43f26b2fa75 (diff) | |
| download | cru-c77072d586bf7aca58e6465ceab3d11a0be0021f.tar.gz cru-c77072d586bf7aca58e6465ceab3d11a0be0021f.tar.bz2 cru-c77072d586bf7aca58e6465ceab3d11a0be0021f.zip | |
Clean up mapper codes.
Diffstat (limited to 'src/ui/mapper/style/AndConditionMapper.cpp')
| -rw-r--r-- | src/ui/mapper/style/AndConditionMapper.cpp | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/src/ui/mapper/style/AndConditionMapper.cpp b/src/ui/mapper/style/AndConditionMapper.cpp deleted file mode 100644 index ad996a4e..00000000 --- a/src/ui/mapper/style/AndConditionMapper.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "cru/ui/mapper/style/AndConditionMapper.h" -#include "cru/base/ClonePtr.h" -#include "cru/ui/mapper/MapperRegistry.h" -#include "cru/ui/mapper/style/IConditionMapper.h" -#include "cru/ui/style/Condition.h" -#include "cru/base/xml/XmlNode.h" - -namespace cru::ui::mapper::style { -bool AndConditionMapper::XmlElementIsOfThisType(xml::XmlElementNode *node) { - return cru::string::CaseInsensitiveCompare(node->GetTag(), "AndCondition") == 0; -} - -ClonePtr<ui::style::AndCondition> AndConditionMapper::DoMapFromXml( - xml::XmlElementNode *node) { - std::vector<ClonePtr<ui::style::Condition>> conditions; - auto condition_mappers = - MapperRegistry::GetInstance()->GetMappersByInterface<IConditionMapper>(); - for (auto child : node->GetChildren()) { - if (child->GetType() == xml::XmlNode::Type::Element) { - auto c = child->AsElement(); - for (auto mapper : condition_mappers) { - if (mapper->XmlElementIsOfThisType(c)) { - conditions.push_back(mapper->MapConditionFromXml(c)); - break; - } - } - } - } - return ui::style::AndCondition::Create(std::move(conditions)); -} -} // namespace cru::ui::mapper::style |
