LittleFileSystem
Loading...
Searching...
No Matches
ntdv::LittleFileSystem Class Reference

LittleFileSystem class provides a high-level interface for LittleFS file system operations. More...

#include <LittleFileSystem.h>

Inheritance diagram for ntdv::LittleFileSystem:
ntdv::FileSystem

Public Member Functions

 LittleFileSystem ()
 Default constructor.
 
 ~LittleFileSystem ()
 Destructor.
 
bool Begin (bool formatOnFail=false, const char *basePath="/littlefs", const char *partitionLabel="spiffs")
 
bool Format () const
 
size_t TotalBytes () const
 
size_t UsedBytes () const
 
void End () const
 Unmount the file system.
 
- Public Member Functions inherited from ntdv::FileSystem
 FileSystem (FileSystemPtr impl)
 
FileStream Open (const char *path, const char *mode=FILE_READ, bool create=false) const
 
FileStream Open (const String &path, const char *mode=FILE_READ, bool create=false) const
 
bool Exists (const char *path) const
 
bool Exists (const String &path) const
 
bool Remove (const char *path) const
 
bool Remove (const String &path) const
 
bool Rename (const char *pathFrom, const char *pathTo) const
 
bool Rename (const String &pathFrom, const String &pathTo) const
 
bool CreateDirectory (const char *path) const
 
bool CreateDirectory (const String &path) const
 
bool RemoveDirectory (const char *path) const
 
bool RemoveDirectory (const String &path) const
 
const char * Mountpoint () const
 

Additional Inherited Members

- Protected Attributes inherited from ntdv::FileSystem
FileSystemPtr _impl
 Shared pointer to an IFileSystem object.
 

Detailed Description

LittleFileSystem class provides a high-level interface for LittleFS file system operations.

Constructor & Destructor Documentation

◆ LittleFileSystem()

LittleFileSystem::LittleFileSystem ( )

Default constructor.

◆ ~LittleFileSystem()

LittleFileSystem::~LittleFileSystem ( )

Destructor.

Member Function Documentation

◆ Begin()

bool LittleFileSystem::Begin ( bool formatOnFail = false,
const char * basePath = "/littlefs",
const char * partitionLabel = "spiffs" )

Initialize the file system

Parameters
formatOnFail- whether to format the file system if initialization fails (default is false)
basePath- base path for the file system (default is "/littlefs")
partitionLabel- label for the partition (default is "spiffs")
Returns
true if successful, false otherwise

◆ End()

void LittleFileSystem::End ( ) const

Unmount the file system.

◆ Format()

bool LittleFileSystem::Format ( ) const

Format the file system

Returns
true if successful, false otherwise

◆ TotalBytes()

size_t LittleFileSystem::TotalBytes ( ) const

Get the total size of the file system

Returns
the total size in bytes

◆ UsedBytes()

size_t LittleFileSystem::UsedBytes ( ) const

Get the used size of the file system

Returns
the used size in bytes

The documentation for this class was generated from the following files: