|
ESP32 PSRAM Library
|
Base class for memory-based file systems like PSRAM and HIMEM. More...
#include <InMemoryFS.h>
Public Member Functions | |
| virtual bool | begin ()=0 |
| Initialize the file system. More... | |
| bool | exists (const char *filename) |
| Check if a file exists. More... | |
| size_t | fileCount () const |
| Get the total number of files. More... | |
| virtual uint64_t | freeBytes ()=0 |
| Get free space. More... | |
| String | getFirstFileName () |
| Get the first file in the filesystem. More... | |
| String | getNextFileName (const char *currentFileName) |
| Get the name of the next file after the specified file. More... | |
| bool | mkdir (const char *dirname) |
| Create a directory (no-op for compatibility) More... | |
| FileType | open (const char *filename, uint8_t mode) |
| Open a file. More... | |
| bool | remove (const char *filename) |
| Remove a file. More... | |
| bool | rmdir (const char *dirname) |
| Remove a directory (no-op for compatibility) More... | |
| virtual uint64_t | totalBytes ()=0 |
| Get total space. More... | |
Protected Attributes | |
| std::map< std::string, VectorType > | fileData |
| bool | initialized = false |
Base class for memory-based file systems like PSRAM and HIMEM.
This class provides a common interface for in-memory file systems, with methods for file management and traversal.
| VectorType | The vector implementation to use (VectorPSRAM or VectorHIMEM) |
| FileType | The file implementation to return (FilePSRAM or FileHIMEM) |
|
pure virtual |
Initialize the file system.
Implemented in esp32_psram::PSRAMClass, and esp32_psram::HIMEMClass.
|
inline |
Check if a file exists.
| filename | Name of the file to check |
|
inline |
Get the total number of files.
|
pure virtual |
Get free space.
Implemented in esp32_psram::PSRAMClass, and esp32_psram::HIMEMClass.
|
inline |
Get the first file in the filesystem.
|
inline |
Get the name of the next file after the specified file.
| currentFileName | Name of the current file |
|
inline |
Create a directory (no-op for compatibility)
| dirname | Name of the directory |
|
inline |
Open a file.
| filename | Name of the file to open |
| mode | Mode to open the file in (FILE_READ, FILE_WRITE, etc.) |
|
inline |
Remove a file.
| filename | Name of the file to remove |
|
inline |
Remove a directory (no-op for compatibility)
| dirname | Name of the directory |
|
pure virtual |
Get total space.
Implemented in esp32_psram::PSRAMClass, and esp32_psram::HIMEMClass.