File system class. More...
#include <cmsis-plus/posix-io/file-system.h>
Public Member Functions | |
Constructors & Destructor | |
file_system (file_system_impl &impl, const char *name) | |
virtual | ~file_system () |
Public Member Functions | |
using | deferred_files_list_t = utils::intrusive_list< file, utils::double_list_links, &file::deferred_links_ > |
using | deferred_directories_list_t = utils::intrusive_list< directory, utils::double_list_links, &directory::deferred_links_ > |
int | mkfs (int options,...) |
virtual int | vmkfs (int options, std::va_list args) |
int | mount (const char *path=nullptr, unsigned int flags=0,...) |
virtual int | vmount (const char *path, unsigned int flags, std::va_list args) |
Mount file system. | |
virtual int | umount (int unsigned flags=0) |
Unmount file system. | |
file * | open (const char *path=nullptr, int oflag=0,...) |
virtual file * | vopen (const char *path, int oflag, std::va_list args) |
virtual directory * | opendir (const char *dirpath) |
virtual int | mkdir (const char *path, mode_t mode) |
virtual int | rmdir (const char *path) |
virtual void | sync (void) |
virtual int | chmod (const char *path, mode_t mode) |
virtual int | stat (const char *path, struct stat *buf) |
virtual int | truncate (const char *path, off_t length) |
virtual int | rename (const char *existing, const char *_new) |
virtual int | unlink (const char *path) |
virtual int | utime (const char *path, const struct utimbuf *times) |
virtual int | statvfs (struct statvfs *buf) |
const char * | mounted_path (void) |
const char * | name (void) const |
void | add_deferred_file (file *fil) |
void | add_deferred_directory (directory *dir) |
deferred_files_list_t & | deferred_files_list (void) |
deferred_directories_list_t & | deferred_directories_list (void) |
template<typename T > | |
T * | allocate_file (void) |
template<typename T > | |
T * | allocate_directory (void) |
template<typename T , typename L > | |
T * | allocate_file (L &locker) |
template<typename T , typename L > | |
T * | allocate_directory (L &locker) |
template<typename T > | |
void | deallocate_files (void) |
template<typename T > | |
void | deallocate_directories (void) |
block_device & | device (void) const |
file_system_impl & | impl (void) const |
static file_system * | identify_mounted (const char **path1, const char **path2=nullptr) |
File system class.
Definition at line 138 of file file-system.h.
using os::posix::file_system::deferred_directories_list_t = utils::intrusive_list<directory, utils::double_list_links, &directory::deferred_links_> |
Definition at line 324 of file file-system.h.
using os::posix::file_system::deferred_files_list_t = utils::intrusive_list<file, utils::double_list_links, &file::deferred_links_> |
Definition at line 321 of file file-system.h.
os::posix::file_system::file_system | ( | file_system_impl & | impl, |
const char * | name | ||
) |
Definition at line 452 of file file-system.cpp.
|
virtual |
Definition at line 463 of file file-system.cpp.
|
inline |
Definition at line 811 of file file-system.h.
|
inline |
Definition at line 805 of file file-system.h.
T * os::posix::file_system::allocate_directory | ( | L & | locker | ) |
Definition at line 929 of file file-system.h.
T * os::posix::file_system::allocate_directory | ( | void | ) |
Definition at line 901 of file file-system.h.
T * os::posix::file_system::allocate_file | ( | L & | locker | ) |
Definition at line 857 of file file-system.h.
T * os::posix::file_system::allocate_file | ( | void | ) |
Definition at line 830 of file file-system.h.
|
virtual |
Reimplemented in os::posix::file_system_lockable< T, L >.
Definition at line 814 of file file-system.cpp.
void os::posix::file_system::deallocate_directories | ( | void | ) |
Definition at line 957 of file file-system.h.
void os::posix::file_system::deallocate_files | ( | void | ) |
Definition at line 884 of file file-system.h.
|
inline |
Definition at line 823 of file file-system.h.
|
inline |
Definition at line 817 of file file-system.h.
|
inline |
Definition at line 799 of file file-system.h.
|
static |
Definition at line 618 of file file-system.cpp.
|
inline |
Definition at line 793 of file file-system.h.
|
virtual |
Reimplemented in os::posix::file_system_lockable< T, L >.
Definition at line 734 of file file-system.cpp.
int os::posix::file_system::mkfs | ( | int | options, |
... | |||
) |
Definition at line 473 of file file-system.cpp.
int os::posix::file_system::mount | ( | const char * | path = nullptr , |
unsigned int | flags = 0 , |
||
... | |||
) |
Definition at line 507 of file file-system.cpp.
const char * os::posix::file_system::mounted_path | ( | void | ) |
|
inline |
Definition at line 787 of file file-system.h.
file * os::posix::file_system::open | ( | const char * | path = nullptr , |
int | oflag = 0 , |
||
... | |||
) |
Definition at line 663 of file file-system.cpp.
|
virtual |
Reimplemented in os::posix::file_system_lockable< T, L >.
Definition at line 705 of file file-system.cpp.
|
virtual |
Reimplemented in os::posix::file_system_lockable< T, L >.
Definition at line 907 of file file-system.cpp.
|
virtual |
Reimplemented in os::posix::file_system_lockable< T, L >.
Definition at line 764 of file file-system.cpp.
|
virtual |
Reimplemented in os::posix::file_system_lockable< T, L >.
Definition at line 845 of file file-system.cpp.
|
virtual |
Reimplemented in os::posix::file_system_lockable< T, L >.
Definition at line 1015 of file file-system.cpp.
|
virtual |
Reimplemented in os::posix::file_system_lockable< T, L >.
Definition at line 794 of file file-system.cpp.
|
virtual |
Reimplemented in os::posix::file_system_lockable< T, L >.
Definition at line 876 of file file-system.cpp.
|
virtual |
Unmount file system.
flags | File system specific flags. |
0 | if successful, |
-1 | otherwise and the variable errno is set to indicate the error. |
The root file system must be unmounted last, it cannot be unmounted if other mount points exists.
Reimplemented in os::posix::file_system_lockable< T, L >.
Definition at line 586 of file file-system.cpp.
|
virtual |
Reimplemented in os::posix::file_system_lockable< T, L >.
Definition at line 939 of file file-system.cpp.
|
virtual |
Reimplemented in os::posix::file_system_lockable< T, L >.
Definition at line 971 of file file-system.cpp.
|
virtual |
Definition at line 485 of file file-system.cpp.
|
virtual |
Mount file system.
path | Path, terminated in / . If / or nullptr, the file system is mounted as root, i.e. the default if no other mount point matches. |
flags | File system specific flags. |
args | Optional arguments. |
0 | if successful, |
-1 | otherwise and the variable errno is set to indicate the error. |
Reimplemented in os::posix::file_system_lockable< T, L >.
Definition at line 519 of file file-system.cpp.
|
virtual |
Reimplemented in os::posix::file_system_lockable< T, L >.
Definition at line 675 of file file-system.cpp.