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

Method decryptFileToFile

src/share/WizZiwReader.cpp:294–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292}
293
294bool WizZiwReader::decryptFileToFile(const QString& strEncryptedFileName, const QString& destFileName)
295{
296 QByteArray plainData;
297 if (!decryptFileToData(strEncryptedFileName, plainData))
298 return false;
299 //
300 QFile file(destFileName);
301 if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
302 TOLOG("can't open dest file while decrypt to temp file");
303 return false;
304 }
305 //
306
307 QDataStream out(&file);
308 if (plainData.length() != out.writeRawData(plainData.constData(), plainData.length())) {
309 TOLOG("write data failed while decrypt to temp file");
310 file.remove();
311 return false;
312 }
313
314 file.close();
315
316 return true;
317}
318
319bool WizZiwReader::initZiwHeader(WIZZIWHEADER& header, const QString& ziwPassword)
320{

Callers 2

Calls 5

TOLOGFunction · 0.85
lengthMethod · 0.80
openMethod · 0.45
removeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected