FileDevice.h
Go to the documentation of this file.
40 FileDevice(const String& name, IFS::IFileSystem& fileSys, IFS::FileHandle file, storage_size_t size)
Class to manage a NUL-terminated C-style string When storing persistent strings in RAM the regular St...
Definition: CString.h:27
static constexpr FileSystem & cast(IFileSystem &fs)
Definition: Components/IFS/src/include/IFS/FileSystem.h:42
Represents a storage device (e.g. flash memory)
Definition: Components/Storage/src/include/Storage/Device.h:34
Type
Storage type.
Definition: Components/Storage/src/include/Storage/Device.h:42
FileDevice(const String &name, IFS::IFileSystem &fileSys, IFS::FileHandle file)
Construct a device using existing file.
Definition: FileDevice.h:53
bool read(storage_size_t address, void *buffer, size_t len) override
Read data from the storage device.
bool erase_range(storage_size_t address, storage_size_t len) override
Erase a region of storage in preparation for writing.
size_t getBlockSize() const override
Obtain smallest allocation unit for erase operations.
Definition: FileDevice.h:82
FileDevice(const String &name, IFS::IFileSystem &fileSys, IFS::FileHandle file, storage_size_t size)
Construct a file device with custom size.
Definition: FileDevice.h:40
storage_size_t getSize() const override
Obtain addressable size of this device.
Definition: FileDevice.h:77
Type getType() const override
Obtain device type.
Definition: FileDevice.h:72
bool write(storage_size_t address, const void *data, size_t len) override
Write data to the storage device.
String getName() const override
Obtain unique device name.
Definition: FileDevice.h:67
Definition: FileDevice.h:26