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

Method load

lib/Xtc/Xtc.cpp:14–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12#include <Logging.h>
13
14bool Xtc::load() {
15 LOG_DBG("XTC", "Loading XTC: %s", filepath.c_str());
16
17 // Initialize parser
18 parser.reset(new xtc::XtcParser());
19
20 // Open XTC file
21 xtc::XtcError err = parser->open(filepath.c_str());
22 if (err != xtc::XtcError::OK) {
23 LOG_ERR("XTC", "Failed to load: %s", xtc::errorToString(err));
24 parser.reset();
25 return false;
26 }
27
28 loaded = true;
29 LOG_DBG("XTC", "Loaded XTC: %s (%lu pages)", filepath.c_str(), parser->getPageCount());
30 return true;
31}
32
33bool Xtc::clearCache() const {
34 if (!Storage.exists(cachePath.c_str())) {

Callers 8

getDataFromBookMethod · 0.45
jszip.min.jsFile · 0.45
loadEpubMethod · 0.45
loadXtcMethod · 0.45
loadTxtMethod · 0.45
ensureEpubLoadedMethod · 0.45
loadRecentCoversMethod · 0.45

Calls 4

errorToStringFunction · 0.85
resetMethod · 0.45
openMethod · 0.45
getPageCountMethod · 0.45

Tested by

no test coverage detected