MCPcopy Create free account
hub / github.com/PrismLauncher/PrismLauncher / write

Function write

launcher/FileSystem.cpp:178–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176}
177
178void write(const QString& filename, const QByteArray& data)
179{
180 ensureExists(QFileInfo(filename).dir());
181 PSaveFile file(filename);
182 if (!file.open(PSaveFile::WriteOnly)) {
183 throw FileSystemException("Couldn't open " + filename + " for writing: " + file.errorString());
184 }
185 if (data.size() != file.write(data)) {
186 throw FileSystemException("Error writing data to " + filename + ": " + file.errorString());
187 }
188 if (!file.commit()) {
189 throw FileSystemException("Error while committing data to " + filename + ": " + file.errorString());
190 }
191}
192
193void appendSafe(const QString& filename, const QByteArray& data)
194{

Callers

nothing calls this directly

Calls 8

ensureExistsFunction · 0.85
QFileInfoClass · 0.85
FileSystemExceptionClass · 0.85
dirMethod · 0.80
errorStringMethod · 0.80
openMethod · 0.45
sizeMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected