diff --git a/toolkit/tmap.h b/toolkit/tmap.h index d176c8f2..f67bcbaa 100644 --- a/toolkit/tmap.h +++ b/toolkit/tmap.h @@ -111,11 +111,26 @@ namespace TagLib { */ bool isEmpty() const; + /*! + * Find the first occurance of \a key. + */ + Iterator find(const Key &key); + + /*! + * Find the first occurance of \a key. + */ + ConstIterator find(const Key &key) const; + /*! * Returns true if the map contains an instance of \a key. */ bool contains(const Key &key) const; + /*! + * Erase the item at \a it from the list. + */ + void erase(Iterator it); + /*! * Returns a reference to the value associated with \a key. * diff --git a/toolkit/tmap.tcc b/toolkit/tmap.tcc index e634dea6..fff5f664 100644 --- a/toolkit/tmap.tcc +++ b/toolkit/tmap.tcc @@ -101,12 +101,30 @@ bool Map::isEmpty() const return d->map.empty(); } +template +typename Map::Iterator Map::find(const Key &key) +{ + return d->map.find(key); +} + +template +typename Map::ConstIterator Map::find(const Key &key) const +{ + return d->map.find(key); +} + template bool Map::contains(const Key &key) const { return d->map.find(key) != d->map.end(); } +template +void Map::erase(Iterator it) +{ + d->map.erase(it); +} + template TagLib::uint Map::size() const {