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

Method loadEpub

src/activities/reader/ReaderActivity.cpp:27–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25bool ReaderActivity::isBmpFile(const std::string& path) { return FsHelpers::hasBmpExtension(path); }
26
27std::unique_ptr<Epub> ReaderActivity::loadEpub(const std::string& path) {
28 if (!Storage.exists(path.c_str())) {
29 LOG_ERR("READER", "File does not exist: %s", path.c_str());
30 return nullptr;
31 }
32
33 auto epub = makeUniqueNoThrow<Epub>(path, "/.crosspoint");
34 if (!epub) {
35 LOG_ERR("READER", "Failed to allocate EPUB object");
36 return nullptr;
37 }
38 if (epub->load(true, SETTINGS.embeddedStyle == 0)) {
39 return epub;
40 }
41
42 LOG_ERR("READER", "Failed to load epub");
43 return nullptr;
44}
45
46std::unique_ptr<Xtc> ReaderActivity::loadXtc(const std::string& path) {
47 if (!Storage.exists(path.c_str())) {

Callers

nothing calls this directly

Calls 2

existsMethod · 0.80
loadMethod · 0.45

Tested by

no test coverage detected