MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / getObjectLocalVersionEx

Method getObjectLocalVersionEx

src/database/WizIndex.cpp:2129–2163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2127}
2128
2129qint64 WizIndex::getObjectLocalVersionEx(const QString& strGUID, const QString& strType, bool& bObjectExists)
2130{
2131 CString strTableName;
2132 CString strKeyFieldName;
2133
2134 if (!getObjectTableInfo(strType, strTableName, strKeyFieldName))
2135 return false;
2136
2137 CString strSQL;
2138 strSQL = WizFormatString3("select WIZ_VERSION from %1 where %2=%3",
2139 strTableName,
2140 strKeyFieldName,
2141 STR2SQL(strGUID));
2142
2143 try
2144 {
2145 CppSQLite3Query query = m_db.execQuery(strSQL);
2146
2147 if (!query.eof())
2148 {
2149 bObjectExists = true;
2150 return query.getInt64Field(0);
2151 }
2152 else
2153 {
2154 return -1;
2155 }
2156 }
2157 catch (const CppSQLite3Exception& e)
2158 {
2159 return -1;
2160 //return LogSQLException(e, strSQL);
2161 }
2162 return -1;
2163}
2164
2165bool WizIndex::modifyObjectVersion(const CString& strGUID, const CString& strType, qint64 nVersion)
2166{

Callers

nothing calls this directly

Calls 4

WizFormatString3Function · 0.85
execQueryMethod · 0.80
eofMethod · 0.80
getInt64FieldMethod · 0.80

Tested by

no test coverage detected