MCPcopy Create free account
hub / github.com/crosspoint-reader/crosspoint-reader / discoverCssFilesFromZip

Method discoverCssFilesFromZip

lib/Epub/Epub.cpp:261–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259}
260
261void 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
285void Epub::parseCssFiles() const {
286 // Maximum CSS file size we'll attempt to parse (uncompressed)

Callers

nothing calls this directly

Calls 7

enumerateFilePathsMethod · 0.80
endMethod · 0.80
push_backMethod · 0.80
hasCssExtensionFunction · 0.50
emptyMethod · 0.45
beginMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected