| 121 | } |
| 122 | |
| 123 | QByteArray read(const QString& filename) |
| 124 | { |
| 125 | QFile file(filename); |
| 126 | if (!file.open(QFile::ReadOnly)) { |
| 127 | throw FileSystemException("Unable to open " + filename + " for reading: " + file.errorString()); |
| 128 | } |
| 129 | const qint64 size = file.size(); |
| 130 | QByteArray data(int(size), 0); |
| 131 | const qint64 ret = file.read(data.data(), size); |
| 132 | if (ret == -1 || ret != size) { |
| 133 | throw FileSystemException("Error reading data from " + filename + ": " + file.errorString()); |
| 134 | } |
| 135 | return data; |
| 136 | } |
| 137 | |
| 138 | bool updateTimestamp(const QString& filename) |
| 139 | { |
no test coverage detected