aboutsummaryrefslogtreecommitdiff
path: root/src/ui/mapper/StringMapper.cpp
blob: 6f6b4546c1160dbccccac9b054ce170fba74eec8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "cru/ui/mapper/StringMapper.h"
#include "cru/xml/XmlNode.h"

namespace cru::ui::mapper {
StringMapper::StringMapper() { SetAllowedTags({"String"}); }

StringMapper::~StringMapper() {}

std::string StringMapper::DoMapFromString(std::string str) {
  return std::move(str);
}

std::string StringMapper::DoMapFromXml(xml::XmlElementNode* node) {
  auto value_attr = node->GetOptionalAttributeValueCaseInsensitive("value");
  if (value_attr) return *value_attr;
  return {};
}
}  // namespace cru::ui::mapper