µOS++ IIIe Reference 7.0.0
The third edition of µOS++, a POSIX inspired open source framework, written in C++
Loading...
Searching...
No Matches
os::posix::file_system_lockable< T, L > Class Template Reference

#include <file-system.h>

+ Inheritance diagram for os::posix::file_system_lockable< T, L >:

Public Types

using lockable_type = L
 
using value_type = T
 

Public Member Functions

Constructors & Destructor
template<typename ... Args>
 file_system_lockable (const char *name, block_device &device, lockable_type &locker, Args &&... args)
 
virtual ~file_system_lockable () override
 
Public Member Functions
virtual int vmount (const char *path, unsigned int flags, std::va_list args) override
 Mount file system.
 
virtual int umount (int unsigned flags=0) override
 Unmount file system.
 
virtual filevopen (const char *path, int oflag, std::va_list args) override
 
virtual directoryopendir (const char *dirpath) override
 
virtual int mkdir (const char *path, mode_t mode) override
 
virtual int rmdir (const char *path) override
 
virtual void sync (void) override
 
virtual int chmod (const char *path, mode_t mode) override
 
virtual int stat (const char *path, struct stat *buf) override
 
virtual int truncate (const char *path, off_t length) override
 
virtual int rename (const char *existing, const char *_new) override
 
virtual int unlink (const char *path) override
 
virtual int utime (const char *path, const struct utimbuf *times) override
 
virtual int statvfs (struct statvfs *buf) override
 
value_typeimpl (void) const
 

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,...)
 
fileopen (const char *path=nullptr, int oflag=0,...)
 
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_tdeferred_files_list (void)
 
deferred_directories_list_tdeferred_directories_list (void)
 
template<typename T >
T * allocate_file (void)
 
template<typename T , typename L >
T * allocate_file (L &locker)
 
template<typename T >
T * allocate_directory (void)
 
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_devicedevice (void) const
 
static file_systemidentify_mounted (const char **path1, const char **path2=nullptr)
 

Detailed Description

template<typename T, typename L>
class os::posix::file_system_lockable< T, L >

Definition at line 629 of file file-system.h.

Member Typedef Documentation

◆ deferred_directories_list_t

Definition at line 324 of file file-system.h.

◆ deferred_files_list_t

Definition at line 321 of file file-system.h.

◆ lockable_type

template<typename T , typename L >
using os::posix::file_system_lockable< T, L >::lockable_type = L

Definition at line 636 of file file-system.h.

◆ value_type

template<typename T , typename L >
using os::posix::file_system_lockable< T, L >::value_type = T

Definition at line 635 of file file-system.h.

Constructor & Destructor Documentation

◆ file_system_lockable()

template<typename T , typename L >
template<typename ... Args>
os::posix::file_system_lockable< T, L >::file_system_lockable ( const char *  name,
block_device device,
lockable_type locker,
Args &&...  args 
)

Definition at line 1017 of file file-system.h.

◆ ~file_system_lockable()

template<typename T , typename L >
os::posix::file_system_lockable< T, L >::~file_system_lockable
overridevirtual

Definition at line 1032 of file file-system.h.

Member Function Documentation

◆ add_deferred_directory()

void os::posix::file_system::add_deferred_directory ( directory dir)
inlineinherited

Definition at line 811 of file file-system.h.

◆ add_deferred_file()

void os::posix::file_system::add_deferred_file ( file fil)
inlineinherited

Definition at line 805 of file file-system.h.

◆ allocate_directory() [1/2]

template<typename T , typename L >
T * os::posix::file_system::allocate_directory ( L &  locker)
inherited

Definition at line 929 of file file-system.h.

◆ allocate_directory() [2/2]

template<typename T >
T * os::posix::file_system::allocate_directory ( void  )
inherited

Definition at line 901 of file file-system.h.

◆ allocate_file() [1/2]

template<typename T , typename L >
T * os::posix::file_system::allocate_file ( L &  locker)
inherited

Definition at line 857 of file file-system.h.

◆ allocate_file() [2/2]

template<typename T >
T * os::posix::file_system::allocate_file ( void  )
inherited

Definition at line 830 of file file-system.h.

◆ chmod()

template<typename T , typename L >
int os::posix::file_system_lockable< T, L >::chmod ( const char *  path,
mode_t  mode 
)
overridevirtual

Reimplemented from os::posix::file_system.

Definition at line 1126 of file file-system.h.

◆ deallocate_directories()

template<typename T >
void os::posix::file_system::deallocate_directories ( void  )
inherited

Definition at line 957 of file file-system.h.

◆ deallocate_files()

template<typename T >
void os::posix::file_system::deallocate_files ( void  )
inherited

Definition at line 884 of file file-system.h.

◆ deferred_directories_list()

file_system::deferred_directories_list_t & os::posix::file_system::deferred_directories_list ( void  )
inlineinherited

Definition at line 823 of file file-system.h.

◆ deferred_files_list()

file_system::deferred_files_list_t & os::posix::file_system::deferred_files_list ( void  )
inlineinherited

Definition at line 817 of file file-system.h.

◆ device()

block_device & os::posix::file_system::device ( void  ) const
inlineinherited

Definition at line 799 of file file-system.h.

◆ identify_mounted()

file_system * os::posix::file_system::identify_mounted ( const char **  path1,
const char **  path2 = nullptr 
)
staticinherited

Definition at line 618 of file file-system.cpp.

◆ impl()

template<typename T , typename L >
file_system_lockable< T, L >::value_type & os::posix::file_system_lockable< T, L >::impl ( void  ) const

Definition at line 1199 of file file-system.h.

◆ mkdir()

template<typename T , typename L >
int os::posix::file_system_lockable< T, L >::mkdir ( const char *  path,
mode_t  mode 
)
overridevirtual

Reimplemented from os::posix::file_system.

Definition at line 1094 of file file-system.h.

◆ mkfs()

int os::posix::file_system::mkfs ( int  options,
  ... 
)
inherited

Definition at line 473 of file file-system.cpp.

◆ mount()

int os::posix::file_system::mount ( const char *  path = nullptr,
unsigned int  flags = 0,
  ... 
)
inherited

Definition at line 507 of file file-system.cpp.

◆ mounted_path()

const char * os::posix::file_system::mounted_path ( void  )
inherited

◆ name()

const char * os::posix::file_system::name ( void  ) const
inlineinherited

Definition at line 787 of file file-system.h.

◆ open()

file * os::posix::file_system::open ( const char *  path = nullptr,
int  oflag = 0,
  ... 
)
inherited

Definition at line 663 of file file-system.cpp.

◆ opendir()

template<typename T , typename L >
directory * os::posix::file_system_lockable< T, L >::opendir ( const char *  dirpath)
overridevirtual

Reimplemented from os::posix::file_system.

Definition at line 1082 of file file-system.h.

◆ rename()

template<typename T , typename L >
int os::posix::file_system_lockable< T, L >::rename ( const char *  existing,
const char *  _new 
)
overridevirtual

Reimplemented from os::posix::file_system.

Definition at line 1156 of file file-system.h.

◆ rmdir()

template<typename T , typename L >
int os::posix::file_system_lockable< T, L >::rmdir ( const char *  path)
overridevirtual

Reimplemented from os::posix::file_system.

Definition at line 1104 of file file-system.h.

◆ stat()

template<typename T , typename L >
int os::posix::file_system_lockable< T, L >::stat ( const char *  path,
struct stat *  buf 
)
overridevirtual

Reimplemented from os::posix::file_system.

Definition at line 1136 of file file-system.h.

◆ statvfs()

template<typename T , typename L >
int os::posix::file_system_lockable< T, L >::statvfs ( struct statvfs buf)
overridevirtual

Reimplemented from os::posix::file_system.

Definition at line 1189 of file file-system.h.

◆ sync()

template<typename T , typename L >
void os::posix::file_system_lockable< T, L >::sync ( void  )
overridevirtual

Reimplemented from os::posix::file_system.

Definition at line 1114 of file file-system.h.

◆ truncate()

template<typename T , typename L >
int os::posix::file_system_lockable< T, L >::truncate ( const char *  path,
off_t  length 
)
overridevirtual

Reimplemented from os::posix::file_system.

Definition at line 1146 of file file-system.h.

◆ umount()

template<typename T , typename L >
int os::posix::file_system_lockable< T, L >::umount ( int unsigned  flags = 0)
overridevirtual

Unmount file system.

Parameters
flagsFile system specific flags.
Return values
0if successful,
-1otherwise 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 from os::posix::file_system.

Definition at line 1059 of file file-system.h.

◆ unlink()

template<typename T , typename L >
int os::posix::file_system_lockable< T, L >::unlink ( const char *  path)
overridevirtual

Reimplemented from os::posix::file_system.

Definition at line 1167 of file file-system.h.

◆ utime()

template<typename T , typename L >
int os::posix::file_system_lockable< T, L >::utime ( const char *  path,
const struct utimbuf *  times 
)
overridevirtual

Reimplemented from os::posix::file_system.

Definition at line 1178 of file file-system.h.

◆ vmkfs()

int os::posix::file_system::vmkfs ( int  options,
std::va_list  args 
)
virtualinherited

Definition at line 485 of file file-system.cpp.

◆ vmount()

template<typename T , typename L >
int os::posix::file_system_lockable< T, L >::vmount ( const char *  path,
unsigned int  flags,
std::va_list  args 
)
overridevirtual

Mount file system.

Parameters
pathPath, terminated in /. If / or nullptr, the file system is mounted as root, i.e. the default if no other mount point matches.
flagsFile system specific flags.
argsOptional arguments.
Return values
0if successful,
-1otherwise and the variable errno is set to indicate the error.

Reimplemented from os::posix::file_system.

Definition at line 1043 of file file-system.h.

◆ vopen()

template<typename T , typename L >
file * os::posix::file_system_lockable< T, L >::vopen ( const char *  path,
int  oflag,
std::va_list  args 
)
overridevirtual

Reimplemented from os::posix::file_system.

Definition at line 1071 of file file-system.h.


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