Arduino Posix Filesystems
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
file_systems::FileSystemBase Class Reference

Abstract file system which can be identified by a prefix: E.g. /Memory. Implements all privided file operations. More...

#include <FileSystemBase.h>

Inheritance diagram for file_systems::FileSystemBase:
file_systems::FileSystemMemory file_systems::FileSystemSD

Public Member Functions

 FileSystemBase (const char *path)
 Constructor for a new file system. More...
 
virtual const char * pathPrefix ()
 Provides the path for all relevant files managed by this file system.
 
virtual bool isValidFile (const char *path)
 Checks if the file is managed by this file system. More...
 
 operator bool ()
 
virtual const char * name ()
 
virtual int open (const char *path, int flags, int mode)
 
virtual ssize_t write (int fd, const void *data, size_t size)
 
virtual ssize_t read (int fd, void *data, size_t size)
 
virtual int close (int fd)
 
virtual int fstat (int fd, struct stat *st)
 
virtual int stat (const char *pathname, struct stat *statbuf)
 
virtual off_t lseek (int fd, off_t offset, int mode)
 
virtual off_t tell (int fd)
 
virtual DIRopendir (const char *name)
 
virtual direntreaddir (DIR *pdir)
 
virtual int closedir (DIR *pdir)
 
virtual int unlink (const char *path)
 
virtual void * mem_map (const char *path, size_t *p_size)
 
virtual bool is_readonly ()
 

Static Public Member Functions

static const char * standardName (const char *name)
 file name w/o leading /
 

Protected Member Functions

virtual int filenameOffset ()
 The ESP32 is removing the path prefix for all file processing.
 
const char * internalFileName (const char *name, bool withPrefix)
 

Protected Attributes

const char * path_prefix = "@"
 
int filename_offset = 0
 
esp_vfs_t myfs
 

Detailed Description

Abstract file system which can be identified by a prefix: E.g. /Memory. Implements all privided file operations.

Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ FileSystemBase()

file_systems::FileSystemBase::FileSystemBase ( const char *  path)
inline

Constructor for a new file system.

Parameters
pathpath prefix for all files

Member Function Documentation

◆ isValidFile()

virtual bool file_systems::FileSystemBase::isValidFile ( const char *  path)
inlinevirtual

Checks if the file is managed by this file system.

Reimplemented in file_systems::FileSystemMemory.

◆ open()

virtual int file_systems::FileSystemBase::open ( const char *  path,
int  flags,
int  mode 
)
inlinevirtual

Reimplemented in file_systems::FileSystemMemory.

◆ write()

virtual ssize_t file_systems::FileSystemBase::write ( int  fd,
const void *  data,
size_t  size 
)
inlinevirtual

Reimplemented in file_systems::FileSystemMemory.


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