Ref T658, model list utility functions (to be exposed as Js object)

This commit is contained in:
Klaus Basan
2019-06-04 23:45:09 +02:00
parent f2426aeea1
commit e9dffaf261
4 changed files with 48 additions and 1 deletions

View File

@@ -261,6 +261,17 @@ namespace BlackMisc
return false;
}
template<class OBJ, class CONTAINER, typename KEYTYPE>
bool IDatastoreObjectList<OBJ, CONTAINER, KEYTYPE>::containsDbKey(KEYTYPE key) const
{
for (const OBJ &obj : ITimestampObjectList<OBJ, CONTAINER>::container())
{
if (!obj.hasValidDbKey()) { continue; }
if (obj.getDbKey() == key) { return true; }
}
return false;
}
template<class OBJ, class CONTAINER, typename KEYTYPE>
CONTAINER IDatastoreObjectList<OBJ, CONTAINER, KEYTYPE>::fromMultipleJsonFormats(const QJsonObject &jsonObject)
{