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

Function read

launcher/FileSystem.cpp:60–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60QByteArray read(const QString &filename)
61{
62 QFile file(filename);
63 if (!file.open(QFile::ReadOnly))
64 {
65 throw FileSystemException("Unable to open " + filename + " for reading: " +
66 file.errorString());
67 }
68 const qint64 size = file.size();
69 QByteArray data(int(size), 0);
70 const qint64 ret = file.read(data.data(), size);
71 if (ret == -1 || ret != size)
72 {
73 throw FileSystemException("Error reading data from " + filename + ": " +
74 file.errorString());
75 }
76 return data;
77}
78
79bool updateTimestamp(const QString& filename)
80{

Callers 10

readElementValueMethod · 0.85
classfileMethod · 0.85
installUpdatesMethod · 0.85
requireDocumentFunction · 0.85
loadGroupListMethod · 0.85
loadMethod · 0.85
readIndexFunction · 0.85
parseServersDatFunction · 0.85
CustomThemeMethod · 0.85
on_buttonBox_acceptedMethod · 0.85

Calls 5

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

Tested by

no test coverage detected