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

Method clearCache

lib/Epub/Epub/Section.cpp:137–150  ·  view source on GitHub ↗

Your updated class method (assuming you are using the 'SD' object, which is a wrapper for a specific filesystem)

Source from the content-addressed store, hash-verified

135
136// Your updated class method (assuming you are using the 'SD' object, which is a wrapper for a specific filesystem)
137bool Section::clearCache() const {
138 if (!Storage.exists(filePath.c_str())) {
139 LOG_DBG("SCT", "Cache does not exist, no action needed");
140 return true;
141 }
142
143 if (!Storage.remove(filePath.c_str())) {
144 LOG_ERR("SCT", "Failed to clear cache");
145 return false;
146 }
147
148 LOG_DBG("SCT", "Cache cleared successfully");
149 return true;
150}
151
152bool Section::createSectionFile(const int fontId, const float lineCompression, const bool extraParagraphSpacing,
153 const uint8_t paragraphAlignment, const uint16_t viewportWidth,

Callers

nothing calls this directly

Calls 2

existsMethod · 0.80
removeMethod · 0.80

Tested by

no test coverage detected