mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 23:25:53 +08:00
Ref T658, model list utility functions (to be exposed as Js object)
This commit is contained in:
committed by
Mat Sutcliffe
parent
ef2398f6a9
commit
6eb6cea9ad
@@ -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)
|
||||
{
|
||||
|
||||
@@ -84,6 +84,9 @@ namespace BlackMisc
|
||||
//! Any object without key?
|
||||
bool containsAnyObjectWithoutKey() const;
|
||||
|
||||
//! Contains object with key?
|
||||
bool containsDbKey(KEYTYPE key) const;
|
||||
|
||||
//! From multiple JSON formats
|
||||
//! \remark supports native swift C++ format, DB format, and cache format
|
||||
static CONTAINER fromMultipleJsonFormats(const QJsonObject &jsonObject);
|
||||
|
||||
Reference in New Issue
Block a user