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

Method load

lib/Txt/Txt.cpp:14–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12}
13
14bool Txt::load() {
15 if (loaded) {
16 return true;
17 }
18
19 if (!Storage.exists(filepath.c_str())) {
20 LOG_ERR("TXT", "File does not exist: %s", filepath.c_str());
21 return false;
22 }
23
24 HalFile file;
25 if (!Storage.openFileForRead("TXT", filepath, file)) {
26 LOG_ERR("TXT", "Failed to open file: %s", filepath.c_str());
27 return false;
28 }
29
30 fileSize = file.size();
31 file.close();
32
33 loaded = true;
34 LOG_DBG("TXT", "Loaded TXT file: %s (%zu bytes)", filepath.c_str(), fileSize);
35 return true;
36}
37
38std::string Txt::getTitle() const {
39 // Extract filename without path and extension

Callers

nothing calls this directly

Calls 4

existsMethod · 0.80
openFileForReadMethod · 0.80
sizeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected