| 12 | } |
| 13 | |
| 14 | bool 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 | |
| 38 | std::string Txt::getTitle() const { |
| 39 | // Extract filename without path and extension |
nothing calls this directly
no test coverage detected