mirror of
https://github.com/ratspeak/ratdeck.git
synced 2026-10-15 05:59:52 +00:00
- 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
36 lines
938 B
C++
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;
|
|
};
|