| 213 | } |
| 214 | |
| 215 | void append(const QString& filename, const QByteArray& data) |
| 216 | { |
| 217 | ensureExists(QFileInfo(filename).dir()); |
| 218 | QFile file(filename); |
| 219 | if (!file.open(QFile::Append)) { |
| 220 | throw FileSystemException("Couldn't open " + filename + " for writing: " + file.errorString()); |
| 221 | } |
| 222 | if (data.size() != file.write(data)) { |
| 223 | throw FileSystemException("Error writing data to " + filename + ": " + file.errorString()); |
| 224 | } |
| 225 | } |
| 226 | |
| 227 | QByteArray read(const QString& filename) |
| 228 | { |
no test coverage detected