From 84596548e5d0cb14dfd7d2a74156331ab36a8909 Mon Sep 17 00:00:00 2001 From: Jonathan Beck Date: Wed, 4 Nov 2009 20:21:54 +0100 Subject: Add GetNodeIdex and GetNodeKey methods. --- src/Dictionary.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/Dictionary.cpp') 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) _map.erase(key); } +std::string Dictionary::GetNodeKey(Node* node) +{ + for (iterator it = _map.begin(); it != _map.end(); ++it) + { + if (it->second == node) + return it->first; + } + return ""; +} + }; -- cgit v1.1-32-gdbae