distortos
v0.7.0
object-oriented C++ RTOS for microcontrollers
|
#include "distortos/FileSystem/FileSystem.hpp"
Public Member Functions | |
virtual | ~FileSystem ()=default |
FileSystem's destructor. More... | |
virtual int | format ()=0 |
Formats associated device with the file system. More... | |
virtual int | getFileStatus (const char *path, struct stat &status)=0 |
Returns status of file. More... | |
virtual int | getStatus (struct statvfs &status)=0 |
Returns status of file system. More... | |
virtual void | lock ()=0 |
Locks the file system for exclusive use by current thread. More... | |
virtual int | makeDirectory (const char *path, mode_t mode)=0 |
Makes a directory. More... | |
virtual int | mount ()=0 |
Mounts file system on associated device. More... | |
virtual std::pair< int, std::unique_ptr< Directory > > | openDirectory (const char *path)=0 |
Opens directory. More... | |
virtual std::pair< int, std::unique_ptr< File > > | openFile (const char *path, int flags)=0 |
Opens file. More... | |
virtual int | remove (const char *path)=0 |
Removes file or directory. More... | |
virtual int | rename (const char *path, const char *newPath)=0 |
Renames file or directory. More... | |
virtual void | unlock ()=0 |
Unlocks the file system which was previously locked by current thread. More... | |
virtual int | unmount ()=0 |
Unmounts file system from associated device. More... | |
FileSystem (const FileSystem &)=delete | |
FileSystem & | operator= (const FileSystem &)=delete |
FileSystem class is an interface for a file system.
|
virtualdefault |
FileSystem's destructor.
|
pure virtual |
Formats associated device with the file system.
Implemented in distortos::Littlefs1FileSystem.
|
pure virtual |
Returns status of file.
Similar to stat()
[in] | path | is the path to file for which status should be returned, must be valid |
[out] | status | is a reference to stat struct into which status of file will be written |
Implemented in distortos::Littlefs1FileSystem.
|
pure virtual |
Returns status of file system.
Similar to statvfs()
[out] | status | is a reference to statvfs struct into which status of file system will be written |
Implemented in distortos::Littlefs1FileSystem.
|
pure virtual |
Locks the file system for exclusive use by current thread.
When the object is locked, any call to any member function from other thread will be blocked until the object is unlocked. Locking is optional, but may be useful when more than one operation must be done atomically.
Implemented in distortos::Littlefs1FileSystem.
|
pure virtual |
Makes a directory.
Similar to mkdir()
[in] | path | is the path of the directory that will be created, must be valid |
[in] | mode | is the value of permission bits of the created directory |
Implemented in distortos::Littlefs1FileSystem.
|
pure virtual |
Mounts file system on associated device.
Implemented in distortos::Littlefs1FileSystem.
|
pure virtual |
Opens directory.
Similar to opendir()
[in] | path | is the path of directory that will be opened, must be valid |
std::unique_ptr
with opened directory; error codes:Implemented in distortos::Littlefs1FileSystem.
|
pure virtual |
Opens file.
Similar to open()
[in] | path | is the path of file that will be opened, must be valid |
[in] | flags | are file status flags, must be valid, for list of available flags and valid combinations see open() |
std::unique_ptr
with opened file; error codes:O_CREAT
and O_EXCL
are set, and file named by path exists;O_CREAT
is not set and path does not name an existing file or O_CREAT
is set and prefix component of path does not name an existing directory;O_CREAT
is set, file named by path does not exist and no space is left on the device containing the file system; *O_WRONLY
, O_RDWR
, O_CREAT
(and file named by path does not exist), or O_TRUNC
are set and file system is read-only; Implemented in distortos::Littlefs1FileSystem.
|
pure virtual |
Removes file or directory.
Similar to remove()
[in] | path | is the path of file or directory that will be removed, must be valid |
Implemented in distortos::Littlefs1FileSystem.
|
pure virtual |
Renames file or directory.
Similar to rename()
[in] | path | is the path of file or directory that will be renamed, must be valid |
[in] | newPath | is the new path of file or directory, must be valid |
Implemented in distortos::Littlefs1FileSystem.
|
pure virtual |
Unlocks the file system which was previously locked by current thread.
Implemented in distortos::Littlefs1FileSystem.
|
pure virtual |
Unmounts file system from associated device.
Implemented in distortos::Littlefs1FileSystem.