diff options
| author | 2009-11-04 20:21:54 +0100 | |
|---|---|---|
| committer | 2009-11-04 20:21:54 +0100 | |
| commit | 84596548e5d0cb14dfd7d2a74156331ab36a8909 (patch) | |
| tree | a98e7aeeb8864a946aaf52dc022af4bb8d381dda /src/Dictionary.cpp | |
| parent | c8c9cfa77f0c0fdb895dfdbfc177db3c26dcedcc (diff) | |
| download | libplist-84596548e5d0cb14dfd7d2a74156331ab36a8909.tar.gz libplist-84596548e5d0cb14dfd7d2a74156331ab36a8909.tar.bz2 | |
Add GetNodeIdex and GetNodeKey methods.
Diffstat (limited to 'src/Dictionary.cpp')
| -rw-r--r-- | src/Dictionary.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Dictionary.cpp b/src/Dictionary.cpp index fedce2e..62ed433 100644 --- a/src/Dictionary.cpp +++ b/src/Dictionary.cpp | |||
| @@ -177,4 +177,14 @@ void Dictionary::Remove(const std::string& key) | |||
| 177 | _map.erase(key); | 177 | _map.erase(key); |
| 178 | } | 178 | } |
| 179 | 179 | ||
| 180 | std::string Dictionary::GetNodeKey(Node* node) | ||
| 181 | { | ||
| 182 | for (iterator it = _map.begin(); it != _map.end(); ++it) | ||
| 183 | { | ||
| 184 | if (it->second == node) | ||
| 185 | return it->first; | ||
| 186 | } | ||
| 187 | return ""; | ||
| 188 | } | ||
| 189 | |||
| 180 | }; | 190 | }; |
