From 32aa6f116acc6e3e20a1ec76cef45b29f7005ad7 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Fri, 17 Oct 2025 12:06:14 +0800 Subject: Remove String stage 1. --- include/cru/ui/ThemeResourceDictionary.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include/cru/ui/ThemeResourceDictionary.h') diff --git a/include/cru/ui/ThemeResourceDictionary.h b/include/cru/ui/ThemeResourceDictionary.h index 0cbda01b..90cbe520 100644 --- a/include/cru/ui/ThemeResourceDictionary.h +++ b/include/cru/ui/ThemeResourceDictionary.h @@ -44,11 +44,11 @@ class CRU_UI_API ThemeResourceDictionary : public Object { public: template - T GetResource(const String& key) { - auto find_result = resource_map_.find(key); + T GetResource(std::string_view key) { + auto find_result = resource_map_.find(std::string(key)); if (find_result == resource_map_.cend()) { throw ThemeResourceKeyNotExistException( - std::format("Theme resource key {} not exist.", key.ToUtf8())); + std::format("Theme resource key {} not exist.", key)); } auto& cache = find_result->second.cache; @@ -73,12 +73,12 @@ class CRU_UI_API ThemeResourceDictionary : public Object { CRU_DEFAULT_COPY(ResourceEntry) CRU_DEFAULT_MOVE(ResourceEntry) - String name; + std::string name; xml::XmlElementNode* xml_node; std::unordered_map cache; }; std::unique_ptr xml_root_; - std::unordered_map resource_map_; + std::unordered_map resource_map_; }; } // namespace cru::ui -- cgit v1.2.3