#pragma once #include "StreamingMsgPackEncoder.h" #include class SpiffsStorageWriter { public: SpiffsStorageWriter(const String &fileName) : f_(SPIFFS.open(fileName, "w")), encoder_(&f_) {} StreamingMsgPackEncoder &encoder() { return encoder_; } private: File f_; StreamingMsgPackEncoder encoder_; }; class SpiffsStorageReader { public: SpiffsBackendReader(const String &fileName) : f_(SPIFFS.open(fileName, "w")) {} uint32_t readBytes(char *buffer, size_t length) { return f_.readBytes(buffer, length); } bool seek(uint32_t pos) { return f_.seek(pos); } private: File f_; };