| 259 | } |
| 260 | |
| 261 | void Epub::discoverCssFilesFromZip() { |
| 262 | const std::string& opfDir = contentBasePath; |
| 263 | ZipFile zf(filepath); |
| 264 | |
| 265 | if (!zf.enumerateFilePaths([&](std::string_view filePath) { |
| 266 | if (!opfDir.empty() && filePath.find(opfDir) != 0) { |
| 267 | return; |
| 268 | } |
| 269 | |
| 270 | if (!FsHelpers::hasCssExtension(filePath)) { |
| 271 | return; |
| 272 | } |
| 273 | |
| 274 | if (std::find(cssFiles.begin(), cssFiles.end(), filePath) != cssFiles.end()) { |
| 275 | return; |
| 276 | } |
| 277 | |
| 278 | LOG_DBG("EBP", "Discovered CSS file via ZIP enumeration: %.*s", (int)filePath.size(), filePath.data()); |
| 279 | cssFiles.push_back(std::string{filePath}); |
| 280 | })) { |
| 281 | LOG_ERR("EBP", "Failed to enumerate ZIP file paths for CSS discovery"); |
| 282 | } |
| 283 | } |
| 284 | |
| 285 | void Epub::parseCssFiles() const { |
| 286 | // Maximum CSS file size we'll attempt to parse (uncompressed) |
nothing calls this directly
no test coverage detected