diff options
| author | 2025-02-28 00:17:57 +0800 | |
|---|---|---|
| committer | 2025-03-01 23:42:06 +0100 | |
| commit | d40f03e4090edafea75f04a1697ef0384231d333 (patch) | |
| tree | e3915131a791b3ce5669ee7938ff4eb4f2c5bbba /include/plist/Dictionary.h | |
| parent | 02be84957d44ce68dcf81bada0d3250d4d81395a (diff) | |
| download | libplist-d40f03e4090edafea75f04a1697ef0384231d333.tar.gz libplist-d40f03e4090edafea75f04a1697ef0384231d333.tar.bz2 | |
C++: Add more convenience functions to the interface
Diffstat (limited to 'include/plist/Dictionary.h')
| -rw-r--r-- | include/plist/Dictionary.h | 7 |
1 files changed, 5 insertions, 2 deletions
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 : | |||
| 60 | void Remove(Node* node); | 60 | void Remove(Node* node); |
| 61 | void Remove(const std::string& key); | 61 | void Remove(const std::string& key); |
| 62 | std::string GetNodeKey(Node* node); | 62 | std::string GetNodeKey(Node* node); |
| 63 | template <typename T> | ||
| 64 | T* Get(const std::string& key) | ||
| 65 | { | ||
| 66 | return (T*)(_map[key]); | ||
| 67 | } | ||
| 63 | 68 | ||
| 64 | private : | 69 | private : |
| 65 | std::map<std::string,Node*> _map; | 70 | std::map<std::string,Node*> _map; |
| 66 | |||
| 67 | |||
| 68 | }; | 71 | }; |
| 69 | 72 | ||
| 70 | }; | 73 | }; |
