µ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_implementable< T > Class Template Reference

#include <file-system.h>

+ Inheritance diagram for os::posix::file_system_implementable< T >:

Public Types

using value_type = T
 

Public Member Functions

Constructors & Destructor
template<typename ... Args>
 file_system_implementable (const char *name, block_device &device, Args &&... args)
 
virtual ~file_system_implementable () override
 
Public Member Functions
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,...)
 
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.
 
fileopen (const char *path=nullptr, int oflag=0,...)
 
virtual filevopen (const char *path, int oflag, std::va_list args)
 
virtual directoryopendir (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 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_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>
class os::posix::file_system_implementable< T >

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

Member Typedef Documentation

◆ deferred_directories_list_t

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

◆ deferred_files_list_t

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

◆ value_type

template<typename T >
using os::posix::file_system_implementable< T >::value_type = T

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

Constructor & Destructor Documentation

◆ file_system_implementable()

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

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

◆ ~file_system_implementable()

template<typename T >
os::posix::file_system_implementable< T >::~file_system_implementable
overridevirtual

Definition at line 1016 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 824 of file file-system.h.

◆ add_deferred_file()

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

Definition at line 818 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 942 of file file-system.h.

◆ allocate_directory() [2/2]

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

Definition at line 914 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 870 of file file-system.h.

◆ allocate_file() [2/2]

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

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

◆ chmod()

int os::posix::file_system::chmod ( const char *  path,
mode_t  mode 
)
virtualinherited

Reimplemented in os::posix::file_system_lockable< T, L >.

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

◆ deallocate_directories()

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

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

◆ deallocate_files()

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

Definition at line 897 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 836 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 830 of file file-system.h.

◆ device()

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

Definition at line 812 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 621 of file file-system.cpp.

◆ impl()

template<typename T >
file_system_implementable< T >::value_type & os::posix::file_system_implementable< T >::impl ( void  ) const

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

◆ mkdir()

int os::posix::file_system::mkdir ( const char *  path,
mode_t  mode 
)
virtualinherited

Reimplemented in os::posix::file_system_lockable< T, L >.

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

◆ mkfs()

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

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

◆ mount()

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

Definition at line 504 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 792 of file file-system.h.

◆ open()

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

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

◆ opendir()

directory * os::posix::file_system::opendir ( const char *  dirpath)
virtualinherited

Reimplemented in os::posix::file_system_lockable< T, L >.

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

◆ rename()

int os::posix::file_system::rename ( const char *  existing,
const char *  _new 
)
virtualinherited

Reimplemented in os::posix::file_system_lockable< T, L >.

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

◆ rmdir()

int os::posix::file_system::rmdir ( const char *  path)
virtualinherited

Reimplemented in os::posix::file_system_lockable< T, L >.

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

◆ stat()

int os::posix::file_system::stat ( const char *  path,
struct stat *  buf 
)
virtualinherited

Reimplemented in os::posix::file_system_lockable< T, L >.

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

◆ statvfs()

int os::posix::file_system::statvfs ( struct statvfs buf)
virtualinherited

Reimplemented in os::posix::file_system_lockable< T, L >.

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

◆ sync()

void os::posix::file_system::sync ( void  )
virtualinherited

Reimplemented in os::posix::file_system_lockable< T, L >.

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

◆ truncate()

int os::posix::file_system::truncate ( const char *  path,
off_t  length 
)
virtualinherited

Reimplemented in os::posix::file_system_lockable< T, L >.

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

◆ umount()

int os::posix::file_system::umount ( int unsigned  flags = 0)
virtualinherited

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 in os::posix::file_system_lockable< T, L >.

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

◆ unlink()

int os::posix::file_system::unlink ( const char *  path)
virtualinherited

Reimplemented in os::posix::file_system_lockable< T, L >.

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

◆ utime()

int os::posix::file_system::utime ( const char *  path,
const utimbuf *  times 
)
virtualinherited

Reimplemented in os::posix::file_system_lockable< T, L >.

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

◆ vmkfs()

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

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

◆ vmount()

int os::posix::file_system::vmount ( const char *  path,
unsigned int  flags,
std::va_list  args 
)
virtualinherited

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 in os::posix::file_system_lockable< T, L >.

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

◆ vopen()

file * os::posix::file_system::vopen ( const char *  path,
int  oflag,
std::va_list  args 
)
virtualinherited

Reimplemented in os::posix::file_system_lockable< T, L >.

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


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