Abstract base class for storage access and file operations. More...
#include <StorageManager.h>
Public Member Functions | |
virtual | ~StorageManager ()=default |
virtual bool | mount ()=0 |
Mount the underlying storage. | |
virtual bool | unmount ()=0 |
Unmount the storage. | |
virtual bool | isMounted () const =0 |
Check mounted. | |
virtual bool | exists (const std::string &path)=0 |
Check whether a file or directory exists at the given path. | |
virtual bool | remove (const std::string &path)=0 |
Remove a file or directory. | |
virtual bool | rename (const std::string &from, const std::string &to)=0 |
Rename a file or directory. | |
virtual bool | readFile (const std::string &path, std::vector< uint8_t > &buffer)=0 |
Read a file into a memory buffer. | |
virtual bool | readFileString (const std::string &path, uint32_t startPosition, uint32_t length, std::string &buffer)=0 |
Read a file string into a memory buffer. | |
virtual bool | writeFile (const std::string &path, const std::vector< uint8_t > &data)=0 |
Write a memory buffer to a file. | |
virtual bool | writeFile (const std::string &path, const unsigned char *data, size_t size)=0 |
Write from a raw buffer. | |
virtual bool | streamFile (const std::string &path, std::function< void(const uint8_t *, size_t)> chunkCallback)=0 |
Stream a file in chunks via callback. | |
virtual bool | listDirectory (const std::string &path, std::vector< FileInfo > &out)=0 |
List all entries in the given directory. | |
virtual bool | createDirectory (const std::string &path)=0 |
Create a directory at the given path (recursive if needed). | |
virtual bool | removeDirectory (const std::string &path)=0 |
Remove a directory (must be empty, or recursively if supported). | |
virtual size_t | getFileSize (const std::string &path)=0 |
Get the size of a file. | |
virtual bool | appendToFile (const std::string &path, const uint8_t *data, size_t size)=0 |
Append data to a file. | |
virtual bool | formatStorage ()=0 |
Format the storage (if applicable). | |
virtual std::unique_ptr< StorageFileReader > | openReader (const std::string &path)=0 |
Open a file for streaming read access. | |
Definition at line 47 of file StorageManager.h.
|
virtualdefault |
|
pure virtual |
Implemented in FatFsStorageManager, and LittleFsStorageManager.
Referenced by traceLog().
|
pure virtual |
Implemented in FatFsStorageManager, and LittleFsStorageManager.
|
pure virtual |
Implemented in FatFsStorageManager, and LittleFsStorageManager.
Referenced by MultipartParser::file_exists(), and FileHandler::serveFile().
|
pure virtual |
Implemented in FatFsStorageManager, and LittleFsStorageManager.
|
pure virtual |
Implemented in FatFsStorageManager, and LittleFsStorageManager.
Referenced by FileHandler::serveFile().
|
pure virtual |
Implemented in FatFsStorageManager, and LittleFsStorageManager.
Referenced by JsonService::load(), JsonService::save(), and FileHandler::serveFile().
|
pure virtual |
Implemented in FatFsStorageManager, and LittleFsStorageManager.
|
pure virtual |
Implemented in FatFsStorageManager, and LittleFsStorageManager.
Referenced by FileHandler::init(), JsonService::load(), JsonService::save(), and FileHandler::serveFile().
|
pure virtual |
path | The file path |
Implemented in FatFsStorageManager, and LittleFsStorageManager.
|
pure virtual |
Implemented in FatFsStorageManager, and LittleFsStorageManager.
Referenced by JsonService::load().
|
pure virtual |
Implemented in FatFsStorageManager, and LittleFsStorageManager.
Referenced by FileHandler::serveFile().
|
pure virtual |
Implemented in FatFsStorageManager, and LittleFsStorageManager.
|
pure virtual |
Implemented in FatFsStorageManager, and LittleFsStorageManager.
|
pure virtual |
Implemented in FatFsStorageManager, and LittleFsStorageManager.
|
pure virtual |
Implemented in FatFsStorageManager, and LittleFsStorageManager.
Referenced by FileHandler::serveFile().
|
pure virtual |
Implemented in FatFsStorageManager, and LittleFsStorageManager.
|
pure virtual |
Implemented in FatFsStorageManager, and LittleFsStorageManager.
Referenced by JsonService::save(), and HttpResponse::toFile().
|
pure virtual |
Implemented in FatFsStorageManager, and LittleFsStorageManager.