mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +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
|
return *this; // At end
|
||||||
}
|
}
|
||||||
|
|
||||||
TKey GetKey()
|
TKey& GetKey()
|
||||||
{
|
{
|
||||||
return this->mDict->mEntries[this->mCurEntry].mKey;
|
return this->mDict->mEntries[this->mCurEntry].mKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
TValue GetValue()
|
TValue& GetValue()
|
||||||
{
|
{
|
||||||
return this->mDict->mEntries[this->mCurEntry].mValue;
|
return this->mDict->mEntries[this->mCurEntry].mValue;
|
||||||
}
|
}
|
||||||
|
@ -468,6 +468,21 @@ public:
|
||||||
return end();
|
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>
|
template <typename TKey>
|
||||||
bool Remove(const TKey& key)
|
bool Remove(const TKey& key)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue