MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / read

Function read

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

Source from the content-addressed store, hash-verified

238}
239
240QByteArray read(const QString& filename)
241{
242 QFile file(filename);
243 if (!file.open(QFile::ReadOnly)) {
244 throw FileSystemException("Unable to open " + filename + " for reading: " + file.errorString());
245 }
246 const qint64 size = file.size();
247 QByteArray data(int(size), 0);
248 const qint64 ret = file.read(data.data(), size);
249 if (ret == -1 || ret != size) {
250 throw FileSystemException("Error reading data from " + filename + ": " + file.errorString());
251 }
252 return data;
253}
254
255bool updateTimestamp(const QString& filename)
256{

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
openMethod · 0.80
errorStringMethod · 0.80
sizeMethod · 0.45
readMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected