| 256 | } |
| 257 | |
| 258 | QByteArray Platform::readFile(const QString &fileName, bool &ok) const |
| 259 | { |
| 260 | ok = true; |
| 261 | |
| 262 | std::ifstream file(fileName.toStdString(), std::ios::binary); |
| 263 | if (!file.is_open()) { |
| 264 | KDDW_ERROR("Failed to open {}", fileName); |
| 265 | ok = false; |
| 266 | return {}; |
| 267 | } |
| 268 | |
| 269 | QByteArray data; |
| 270 | |
| 271 | file.seekg(0, std::ios::end); |
| 272 | std::streampos fileSize = file.tellg(); |
| 273 | file.seekg(0, std::ios::beg); |
| 274 | |
| 275 | data.resize(int(fileSize)); |
| 276 | |
| 277 | file.read(data.data(), fileSize); |
| 278 | file.close(); |
| 279 | |
| 280 | return data; |
| 281 | } |
| 282 | |
| 283 | bool Platform::supportsAeroSnap() const |
| 284 | { |
no test coverage detected