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

Method insertDocumentTag

src/database/WizIndex.cpp:1307–1336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1305}
1306
1307bool WizIndex::insertDocumentTag(WIZDOCUMENTDATA& data,
1308 const CString& strTagGUID,
1309 bool bReset /* = true */)
1310{
1311 if (strTagGUID.isEmpty()) {
1312 TOLOG("NULL Pointer or empty tag guid: insert into wiz_document_tag,!");
1313 return false;
1314 }
1315
1316 CString strFormat = formatInsertSQLFormat(TABLE_NAME_WIZ_DOCUMENT_TAG,
1317 FIELD_LIST_WIZ_DOCUMENT_TAG,
1318 PARAM_LIST_WIZ_DOCUMENT_TAG);
1319
1320 CString strSQL;
1321 strSQL.format(strFormat,
1322 STR2SQL(data.strGUID).utf16(),
1323 STR2SQL(strTagGUID).utf16()
1324 );
1325
1326 if (!execSQL(strSQL))
1327 return false;
1328
1329 bool bRet = true;
1330 if (bReset)
1331 bRet = updateDocumentInfoMD5(data);
1332
1333 Q_EMIT documentTagModified(data);
1334
1335 return bRet;
1336}
1337
1338bool WizIndex::deleteDocumentTag(WIZDOCUMENTDATA& data, const CString& strTagGUID)
1339{

Callers 3

copyToMethod · 0.80
addTagMethod · 0.80

Calls 3

TOLOGFunction · 0.85
isEmptyMethod · 0.80
formatMethod · 0.45

Tested by

no test coverage detected