Added filter function.
This commit is contained in:
parent
3196c5021e
commit
2734cc00fb
@ -46,6 +46,10 @@ namespace ehs
|
||||
|
||||
DbObject *CreateObject();
|
||||
|
||||
DbObject *GetObject(UInt_64 variableHashId, const Str_8 &value) const;
|
||||
|
||||
DbObject *GetObject(const Str_8 &variable, const Str_8 &value) const;
|
||||
|
||||
DbObject *GetObject(UInt_64 id) const;
|
||||
|
||||
private:
|
||||
|
@ -119,6 +119,27 @@ namespace ehs
|
||||
return obj;
|
||||
}
|
||||
|
||||
DbObject* DbTable::GetObject(UInt_64 variableHashId, const Str_8& value) const
|
||||
{
|
||||
for (UInt_64 i = 0; i < objects.Size(); ++i)
|
||||
{
|
||||
objects[i].Load();
|
||||
|
||||
const DbVar * const var = objects[i].GetVariable(variableHashId);
|
||||
if (var->GetValueStr() == value)
|
||||
return &objects[i];
|
||||
|
||||
objects[i].Free();
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
DbObject* DbTable::GetObject(const Str_8& variable, const Str_8& value) const
|
||||
{
|
||||
return GetObject(variable.Hash_64(), value);
|
||||
}
|
||||
|
||||
DbObject* DbTable::GetObject(const UInt_64 id) const
|
||||
{
|
||||
for (UInt_64 i = 0; i < objects.Size(); ++i)
|
||||
|
Loading…
Reference in New Issue
Block a user