mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-04-25 12:29:46 -06:00
added psf::object::get
This commit is contained in:
parent
220aab1fd0
commit
290bdc4566
@ -365,4 +365,16 @@ namespace psf
|
||||
{
|
||||
return m_entries.at(key);
|
||||
}
|
||||
|
||||
const entry* object::get(const std::string &key) const
|
||||
{
|
||||
auto found = m_entries.find(key);
|
||||
|
||||
if (found == m_entries.end())
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return &found->second;
|
||||
}
|
||||
}
|
||||
|
||||
@ -81,6 +81,9 @@ namespace psf
|
||||
entry& operator[](const std::string &key);
|
||||
const entry& operator[](const std::string &key) const;
|
||||
|
||||
//returns pointer to entry or null, if not exists
|
||||
const entry *get(const std::string &key) const;
|
||||
|
||||
bool exists(const std::string &key) const
|
||||
{
|
||||
return m_entries.find(key) != m_entries.end();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user