MCPcopy Create free account
hub / github.com/ElyPrismLauncher/Launcher / read

Function read

launcher/FileSystem.cpp:227–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227QByteArray read(const QString& filename)
228{
229 QFile file(filename);
230 if (!file.open(QFile::ReadOnly)) {
231 throw FileSystemException("Unable to open " + filename + " for reading: " + file.errorString());
232 }
233 const qint64 size = file.size();
234 QByteArray data(int(size), 0);
235 const qint64 ret = file.read(data.data(), size);
236 if (ret == -1 || ret != size) {
237 throw FileSystemException("Error reading data from " + filename + ": " + file.errorString());
238 }
239 return data;
240}
241
242bool updateTimestamp(const QString& filename)
243{

Callers 15

read_lock_FileFunction · 0.85
ApplicationMethod · 0.85
requireDocumentFunction · 0.85
copyFinishedMethod · 0.85
appendSafeFunction · 0.85
loadGroupListMethod · 0.85
loadMethod · 0.85
readIndexFunction · 0.85
PrismUpdaterAppMethod · 0.85
moveAndFinishUpdateMethod · 0.85
read_lock_FileFunction · 0.85
backupAppDirMethod · 0.85

Calls 6

FileSystemExceptionClass · 0.85
errorStringMethod · 0.80
openMethod · 0.45
sizeMethod · 0.45
readMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected