MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / read

Function read

launcher/FileSystem.cpp:123–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123QByteArray read(const QString& filename)
124{
125 QFile file(filename);
126 if (!file.open(QFile::ReadOnly)) {
127 throw FileSystemException("Unable to open " + filename + " for reading: " + file.errorString());
128 }
129 const qint64 size = file.size();
130 QByteArray data(int(size), 0);
131 const qint64 ret = file.read(data.data(), size);
132 if (ret == -1 || ret != size) {
133 throw FileSystemException("Error reading data from " + filename + ": " + file.errorString());
134 }
135 return data;
136}
137
138bool updateTimestamp(const QString& filename)
139{

Callers 8

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 4

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

Tested by

no test coverage detected