Your updated class method (assuming you are using the 'SD' object, which is a wrapper for a specific filesystem)
| 135 | |
| 136 | // Your updated class method (assuming you are using the 'SD' object, which is a wrapper for a specific filesystem) |
| 137 | bool 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 | |
| 152 | bool Section::createSectionFile(const int fontId, const float lineCompression, const bool extraParagraphSpacing, |
| 153 | const uint8_t paragraphAlignment, const uint16_t viewportWidth, |