aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/mapper
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-01-20 22:49:41 +0800
committercrupest <crupest@outlook.com>2022-01-20 22:49:41 +0800
commitc0f802594e17efd5b93d4019431bf1a6d24249c3 (patch)
tree408c1a212f02a11ba84eb3911137f272f3862799 /include/cru/ui/mapper
parent6f26995173d8ad46e347afc2ebd27573cee98ce7 (diff)
downloadcru-c0f802594e17efd5b93d4019431bf1a6d24249c3.tar.gz
cru-c0f802594e17efd5b93d4019431bf1a6d24249c3.tar.bz2
cru-c0f802594e17efd5b93d4019431bf1a6d24249c3.zip
...
Diffstat (limited to 'include/cru/ui/mapper')
-rw-r--r--include/cru/ui/mapper/PointMapper.hpp2
-rw-r--r--include/cru/ui/mapper/SizeMapper.hpp18
2 files changed, 18 insertions, 2 deletions
diff --git a/include/cru/ui/mapper/PointMapper.hpp b/include/cru/ui/mapper/PointMapper.hpp
index 0fcb733f..5641af01 100644
--- a/include/cru/ui/mapper/PointMapper.hpp
+++ b/include/cru/ui/mapper/PointMapper.hpp
@@ -5,8 +5,6 @@ namespace cru::ui::mapper {
class CRU_UI_API PointMapper : public BasicMapper<Point> {
public:
CRU_DEFAULT_CONSTRUCTOR_DESTRUCTOR(PointMapper)
- CRU_DELETE_COPY(PointMapper)
- CRU_DELETE_MOVE(PointMapper)
public:
bool SupportMapFromString() override { return true; }
diff --git a/include/cru/ui/mapper/SizeMapper.hpp b/include/cru/ui/mapper/SizeMapper.hpp
new file mode 100644
index 00000000..20558bf4
--- /dev/null
+++ b/include/cru/ui/mapper/SizeMapper.hpp
@@ -0,0 +1,18 @@
+#pragma once
+#include "Mapper.hpp"
+
+namespace cru::ui::mapper {
+class CRU_UI_API SizeMapper : public BasicMapper<Size> {
+ public:
+ CRU_DEFAULT_CONSTRUCTOR_DESTRUCTOR(SizeMapper)
+
+ public:
+ bool SupportMapFromString() override { return true; }
+ bool SupportMapFromXml() override { return true; }
+ bool XmlElementIsOfThisType(xml::XmlElementNode* node) override;
+
+ protected:
+ std::unique_ptr<Size> DoMapFromString(String str) override;
+ std::unique_ptr<Size> DoMapFromXml(xml::XmlElementNode* node) override;
+};
+} // namespace cru::ui::mapper