| 238 | } |
| 239 | |
| 240 | QByteArray 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 | |
| 255 | bool updateTimestamp(const QString& filename) |
| 256 | { |
no test coverage detected