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

Function WizSaveDataToFile

src/share/WizMisc.cpp:2274–2293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2272}
2273
2274bool WizSaveDataToFile(const QString& strFileName, const QByteArray& arrayData)
2275{
2276 QFile file(strFileName);
2277 if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
2278 TOLOG("Can't open file when save data to file");
2279 return false;
2280 }
2281
2282 QDataStream out(&file);
2283 int retLen = out.writeRawData(arrayData.constData(), arrayData.length());
2284 if (retLen == -1) {
2285 TOLOG("Error occured when save data to file");
2286 return false;
2287 } else if (retLen != arrayData.length()) {
2288 TOLOG("not all data saved when save data to file");
2289 return false;
2290 }
2291
2292 return true;
2293}
2294
2295bool WizLoadDataFromFile(const QString& strFileName, QByteArray& arrayData)
2296{

Callers 3

iconMethod · 0.85

Calls 3

TOLOGFunction · 0.85
lengthMethod · 0.80
openMethod · 0.45

Tested by

no test coverage detected