mbed-drivers
Public Member Functions | Static Public Member Functions | Friends | List of all members
mbed::FileSystemLike Class Referenceabstract

#include <FileSystemLike.h>

Inheritance diagram for mbed::FileSystemLike:
mbed::FileBase

Public Member Functions

 FileSystemLike (const char *name)
 
virtual FileHandleopen (const char *filename, int flags)=0
 
virtual int remove (const char *filename)
 
virtual int rename (const char *oldname, const char *newname)
 
virtual DirHandleopendir (const char *name)
 
virtual int mkdir (const char *name, mode_t mode)
 
- Public Member Functions inherited from mbed::FileBase
 FileBase (const char *name, PathType t)
 
const char * getName (void)
 
PathType getPathType (void)
 

Static Public Member Functions

static DirHandleopendir ()
 
- Static Public Member Functions inherited from mbed::FileBase
static FileBaselookup (const char *name, unsigned int len)
 
static FileBaseget (int n)
 

Friends

class BaseDirHandle
 

Additional Inherited Members

- Protected Attributes inherited from mbed::FileBase
FileBase_next
 
const char * _name
 
PathType _path_type
 
- Static Protected Attributes inherited from mbed::FileBase
static FileBase_head = NULL
 

Detailed Description

A filesystem-like object is one that can be used to open files though it by fopen("/name/filename", mode)

Implementations must define at least open (the default definitions of the rest of the functions just return error values).

Constructor & Destructor Documentation

mbed::FileSystemLike::FileSystemLike ( const char *  name)

FileSystemLike constructor

Parameters
nameThe name to use for the filesystem.

Member Function Documentation

virtual int mbed::FileSystemLike::mkdir ( const char *  name,
mode_t  mode 
)
inlinevirtual

Creates a directory in the filesystem.

Parameters
nameThe name of the directory to create.
modeThe permissions to create the directory with.
Returns
0 on success, -1 on failure.
virtual FileHandle* mbed::FileSystemLike::open ( const char *  filename,
int  flags 
)
pure virtual

Opens a file from the filesystem

Parameters
filenameThe name of the file to open.
flagsOne of O_RDONLY, O_WRONLY, or O_RDWR, OR'd with zero or more of O_CREAT, O_TRUNC, or O_APPEND.
Returns
A pointer to a FileHandle object representing the file on success, or NULL on failure.
virtual DirHandle* mbed::FileSystemLike::opendir ( const char *  name)
inlinevirtual

Opens a directory in the filesystem and returns a DirHandle representing the directory stream.

Parameters
nameThe name of the directory to open.
Returns
A DirHandle representing the directory stream, or NULL on failure.
virtual int mbed::FileSystemLike::remove ( const char *  filename)
inlinevirtual

Remove a file from the filesystem.

Parameters
filenamethe name of the file to remove.
returns0 on success, -1 on failure.
virtual int mbed::FileSystemLike::rename ( const char *  oldname,
const char *  newname 
)
inlinevirtual

Rename a file in the filesystem.

Parameters
oldnamethe name of the file to rename.
newnamethe name to rename it to.
Returns
0 on success, -1 on failure.

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