StuBS
FileSystemInterface Class Referenceabstract

#include <fs/tool/fs_interface.h>

Inheritance diagram for FileSystemInterface:
[legend]

Classes

struct  DirEntry
 
struct  FileStats
 

Public Types

enum  FileType {
  FILE ,
  DIRECTORY ,
  SYMLINK ,
  OTHER
}
 
typedef void DirHandle
 

Public Member Functions

 FileSystemInterface ()
 
virtual ~FileSystemInterface ()
 
virtual int chdir (const char *path)=0
 
virtual int readlink (const char *pathname, char *buf, unsigned bufsiz)=0
 
virtual int open (const char *pathname, bool write=false)=0
 
virtual int close (int fd)=0
 
virtual int read (int fd, void *buf, unsigned count)=0
 
virtual int write (int fd, const void *buf, unsigned count)=0
 
virtual int link (const char *oldpath, const char *newpath)
 
virtual int symlink (const char *target, const char *linkpath)=0
 
virtual int unlink (const char *pathname)
 
virtual int rename (const char *oldpath, const char *newpath)
 
virtual int mkdir (const char *pathname)=0
 
virtual int rmdir (const char *pathname)
 
virtual int truncate (const char *path)
 
virtual DirHandleopendir (const char *name)=0
 
virtual DirEntry readdir (DirHandle *dirp)=0
 
virtual void rewinddir (DirHandle *dirp)=0
 
virtual int closedir (DirHandle *dirp)=0
 
virtual struct FileStats stat (const char *path, bool followSymlink=true)=0
 
virtual int getcwd (char *buf, unsigned bufsiz)=0
 
virtual void sync ()=0
 

Member Typedef Documentation

◆ DirHandle

Member Enumeration Documentation

◆ FileType

Enumerator
FILE 
DIRECTORY 
SYMLINK 
OTHER 

Constructor & Destructor Documentation

◆ FileSystemInterface()

FileSystemInterface::FileSystemInterface ( )
inline

◆ ~FileSystemInterface()

virtual FileSystemInterface::~FileSystemInterface ( )
inlinevirtual

Member Function Documentation

◆ chdir()

virtual int FileSystemInterface::chdir ( const char *  path)
pure virtual

Implemented in FileSystemHost, and FileSystemImage.

◆ readlink()

virtual int FileSystemInterface::readlink ( const char *  pathname,
char *  buf,
unsigned  bufsiz 
)
pure virtual

Implemented in FileSystemHost, and FileSystemImage.

◆ open()

virtual int FileSystemInterface::open ( const char *  pathname,
bool  write = false 
)
pure virtual

Implemented in FileSystemHost, and FileSystemImage.

◆ close()

virtual int FileSystemInterface::close ( int  fd)
pure virtual

Implemented in FileSystemHost, and FileSystemImage.

◆ read()

virtual int FileSystemInterface::read ( int  fd,
void *  buf,
unsigned  count 
)
pure virtual

Implemented in FileSystemHost, and FileSystemImage.

◆ write()

virtual int FileSystemInterface::write ( int  fd,
const void *  buf,
unsigned  count 
)
pure virtual

Implemented in FileSystemHost, and FileSystemImage.

◆ link()

virtual int FileSystemInterface::link ( const char *  oldpath,
const char *  newpath 
)
inlinevirtual

Reimplemented in FileSystemImage.

◆ symlink()

virtual int FileSystemInterface::symlink ( const char *  target,
const char *  linkpath 
)
pure virtual

Implemented in FileSystemHost, and FileSystemImage.

◆ unlink()

virtual int FileSystemInterface::unlink ( const char *  pathname)
inlinevirtual

Reimplemented in FileSystemImage.

◆ rename()

virtual int FileSystemInterface::rename ( const char *  oldpath,
const char *  newpath 
)
inlinevirtual

Reimplemented in FileSystemImage.

◆ mkdir()

virtual int FileSystemInterface::mkdir ( const char *  pathname)
pure virtual

Implemented in FileSystemHost, and FileSystemImage.

◆ rmdir()

virtual int FileSystemInterface::rmdir ( const char *  pathname)
inlinevirtual

Reimplemented in FileSystemImage.

◆ truncate()

virtual int FileSystemInterface::truncate ( const char *  path)
inlinevirtual

Reimplemented in FileSystemImage.

◆ opendir()

virtual DirHandle * FileSystemInterface::opendir ( const char *  name)
pure virtual

Implemented in FileSystemHost, and FileSystemImage.

◆ readdir()

virtual DirEntry FileSystemInterface::readdir ( DirHandle dirp)
pure virtual

Implemented in FileSystemHost, and FileSystemImage.

◆ rewinddir()

virtual void FileSystemInterface::rewinddir ( DirHandle dirp)
pure virtual

Implemented in FileSystemHost, and FileSystemImage.

◆ closedir()

virtual int FileSystemInterface::closedir ( DirHandle dirp)
pure virtual

Implemented in FileSystemHost, and FileSystemImage.

◆ stat()

virtual struct FileStats FileSystemInterface::stat ( const char *  path,
bool  followSymlink = true 
)
pure virtual

Implemented in FileSystemHost, and FileSystemImage.

◆ getcwd()

virtual int FileSystemInterface::getcwd ( char *  buf,
unsigned  bufsiz 
)
pure virtual

Implemented in FileSystemHost, and FileSystemImage.

◆ sync()

virtual void FileSystemInterface::sync ( )
pure virtual

Implemented in FileSystemHost, and FileSystemImage.


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