Commit 7d6b42c9 authored by Alexander Böhn's avatar Alexander Böhn Committed by Nikias Bassen

Add PList::Dictionary::const_iterator

... and const versions of three member functions, each returning const_iterator:
* Plist::Dictionary::Begin()
* PList::Dictionary::End()
* PList::Dictionary::Find()
parent ec957fb8
......@@ -41,11 +41,15 @@ public :
Node* Clone() const;
typedef std::map<std::string,Node*>::iterator iterator;
typedef std::map<std::string,Node*>::const_iterator const_iterator;
Node* operator[](const std::string& key);
iterator Begin();
iterator End();
iterator Find(const std::string& key);
const_iterator Begin() const;
const_iterator End() const;
const_iterator Find(const std::string& key) const;
iterator Set(const std::string& key, const Node* node);
iterator Set(const std::string& key, const Node& node);
iterator Insert(const std::string& key, Node* node) PLIST_WARN_DEPRECATED("use Set() instead");
......
......@@ -104,11 +104,26 @@ Dictionary::iterator Dictionary::End()
return _map.end();
}
Dictionary::const_iterator Dictionary::Begin() const
{
return _map.begin();
}
Dictionary::const_iterator Dictionary::End() const
{
return _map.end();
}
Dictionary::iterator Dictionary::Find(const std::string& key)
{
return _map.find(key);
}
Dictionary::const_iterator Dictionary::Find(const std::string& key) const
{
return _map.find(key);
}
Dictionary::iterator Dictionary::Set(const std::string& key, const Node* node)
{
if (node)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment