mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
More utility methods
This commit is contained in:
parent
2f89450493
commit
35779edc14
1 changed files with 17 additions and 2 deletions
|
@ -117,12 +117,12 @@ public:
|
|||
return *this; // At end
|
||||
}
|
||||
|
||||
TKey GetKey()
|
||||
TKey& GetKey()
|
||||
{
|
||||
return this->mDict->mEntries[this->mCurEntry].mKey;
|
||||
}
|
||||
|
||||
TValue GetValue()
|
||||
TValue& GetValue()
|
||||
{
|
||||
return this->mDict->mEntries[this->mCurEntry].mValue;
|
||||
}
|
||||
|
@ -468,6 +468,21 @@ public:
|
|||
return end();
|
||||
}
|
||||
|
||||
template <typename TKey>
|
||||
bool Contains(const TKey& key)
|
||||
{
|
||||
return TryGet(key) != end();
|
||||
}
|
||||
|
||||
template <typename TKey>
|
||||
int GetCount(const TKey& key)
|
||||
{
|
||||
int count = 0;
|
||||
for (auto itr = TryGet(key); itr != end(); ++itr)
|
||||
count++;
|
||||
return count;
|
||||
}
|
||||
|
||||
template <typename TKey>
|
||||
bool Remove(const TKey& key)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue