aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/ThemeResourceDictionary.h
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-10-17 12:06:14 +0800
committerYuqian Yang <crupest@crupest.life>2025-10-17 12:06:14 +0800
commit32aa6f116acc6e3e20a1ec76cef45b29f7005ad7 (patch)
tree892b71060a88b58d9293d78033000b05818783df /include/cru/ui/ThemeResourceDictionary.h
parentfaf77949e19dc0d01f75bf8abb783eda70328048 (diff)
downloadcru-32aa6f116acc6e3e20a1ec76cef45b29f7005ad7.tar.gz
cru-32aa6f116acc6e3e20a1ec76cef45b29f7005ad7.tar.bz2
cru-32aa6f116acc6e3e20a1ec76cef45b29f7005ad7.zip
Remove String stage 1.
Diffstat (limited to 'include/cru/ui/ThemeResourceDictionary.h')
-rw-r--r--include/cru/ui/ThemeResourceDictionary.h10
1 files changed, 5 insertions, 5 deletions
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 <typename T>
- 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<std::type_index, std::any> cache;
};
std::unique_ptr<xml::XmlElementNode> xml_root_;
- std::unordered_map<String, ResourceEntry> resource_map_;
+ std::unordered_map<std::string, ResourceEntry> resource_map_;
};
} // namespace cru::ui