PIBinaryLog createIndexOnFly, loadIndex, saveIndex features
PIFile readAll and writeAll static methods
This commit is contained in:
@@ -622,3 +622,18 @@ bool PIFile::applyFileInfo(const PIString & path, const PIFile::FileInfo & info)
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
PIByteArray PIFile::readAll(const PIString & path, bool forceRead) {
|
||||
PIFile f(path, PIIODevice::ReadOnly);
|
||||
if (!f.isOpened()) return PIByteArray();
|
||||
return f.readAll(forceRead);
|
||||
}
|
||||
|
||||
|
||||
int PIFile::writeAll(const PIString & path, const PIByteArray & data) {
|
||||
PIFile f(path, PIIODevice::ReadWrite);
|
||||
if (!f.isOpened()) return 0;
|
||||
f.clear();
|
||||
return f.write(data.data(), data.size_s());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user