Files
ratdeck/src/storage/SDStore.h
T
DeFiDude 1e22924159 v1.5.4: Hop-based eviction, first-boot data cleanup, message performance
- Evict highest-hop unsaved nodes first when peer list is full (nearby peers survive)
- Add first-boot SD data cleanup screen before name input
- Conversation summaries cache for faster message list rendering
- Optimize message view refresh with summary-based change detection
- Streamline unread tracking through MessageStore instead of LXMFManager
2026-03-08 17:53:43 -06:00

36 lines
938 B
C++

#pragma once
#include <Arduino.h>
#include <SD.h>
#include <SPI.h>
class SDStore {
public:
bool begin(SPIClass* spi, int csPin);
void end();
bool writeAtomic(const char* path, const uint8_t* data, size_t len);
bool writeSimple(const char* path, const uint8_t* data, size_t len);
bool writeString(const char* path, const String& data);
String readString(const char* path);
bool ensureDir(const char* path);
bool exists(const char* path);
bool remove(const char* path);
File openDir(const char* path);
bool removeDir(const char* path);
bool readFile(const char* path, uint8_t* buffer, size_t maxLen, size_t& bytesRead);
bool isReady() const { return _ready; }
uint64_t totalBytes() const;
uint64_t usedBytes() const;
bool formatForRatputer();
bool wipeRatputer();
bool hasExistingData();
private:
void wipeDir(const char* path);
bool _ready = false;
};