From d40f03e4090edafea75f04a1697ef0384231d333 Mon Sep 17 00:00:00 2001 From: guyingzhao Date: Fri, 28 Feb 2025 00:17:57 +0800 Subject: C++: Add more convenience functions to the interface --- include/plist/Dictionary.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include/plist/Dictionary.h') diff --git a/include/plist/Dictionary.h b/include/plist/Dictionary.h index 583a430..fc7e558 100644 --- a/include/plist/Dictionary.h +++ b/include/plist/Dictionary.h @@ -60,11 +60,14 @@ public : void Remove(Node* node); void Remove(const std::string& key); std::string GetNodeKey(Node* node); + template + T* Get(const std::string& key) + { + return (T*)(_map[key]); + } private : std::map _map; - - }; }; -- cgit v1.1-32-gdbae