| 225 | } |
| 226 | |
| 227 | QByteArray read(const QString& filename) |
| 228 | { |
| 229 | QFile file(filename); |
| 230 | if (!file.open(QFile::ReadOnly)) { |
| 231 | throw FileSystemException("Unable to open " + filename + " for reading: " + file.errorString()); |
| 232 | } |
| 233 | const qint64 size = file.size(); |
| 234 | QByteArray data(int(size), 0); |
| 235 | const qint64 ret = file.read(data.data(), size); |
| 236 | if (ret == -1 || ret != size) { |
| 237 | throw FileSystemException("Error reading data from " + filename + ": " + file.errorString()); |
| 238 | } |
| 239 | return data; |
| 240 | } |
| 241 | |
| 242 | bool updateTimestamp(const QString& filename) |
| 243 | { |
no test coverage detected