| 58 | } |
| 59 | |
| 60 | QByteArray read(const QString &filename) |
| 61 | { |
| 62 | QFile file(filename); |
| 63 | if (!file.open(QFile::ReadOnly)) |
| 64 | { |
| 65 | throw FileSystemException("Unable to open " + filename + " for reading: " + |
| 66 | file.errorString()); |
| 67 | } |
| 68 | const qint64 size = file.size(); |
| 69 | QByteArray data(int(size), 0); |
| 70 | const qint64 ret = file.read(data.data(), size); |
| 71 | if (ret == -1 || ret != size) |
| 72 | { |
| 73 | throw FileSystemException("Error reading data from " + filename + ": " + |
| 74 | file.errorString()); |
| 75 | } |
| 76 | return data; |
| 77 | } |
| 78 | |
| 79 | bool updateTimestamp(const QString& filename) |
| 80 | { |
no test coverage detected