12 #ifndef INCLUDE_DISTORTOS_FILESYSTEM_FILESYSTEM_HPP_ 13 #define INCLUDE_DISTORTOS_FILESYSTEM_FILESYSTEM_HPP_ 73 virtual int getFileStatus(
const char* path,
struct stat& status) = 0;
104 virtual void lock() = 0;
126 virtual int makeDirectory(
const char* path, mode_t mode) = 0;
138 virtual int mount() = 0;
158 virtual std::pair<int, std::unique_ptr<Directory>>
openDirectory(
const char* path) = 0;
188 virtual std::pair<int, std::unique_ptr<File>>
openFile(
const char* path,
int flags) = 0;
208 virtual int remove(
const char* path) = 0;
233 virtual int rename(
const char* path,
const char* newPath) = 0;
245 virtual void unlock() = 0;
268 #endif // INCLUDE_DISTORTOS_FILESYSTEM_FILESYSTEM_HPP_ Standard sys/statvfs.h, which is not provided by newlib.
virtual int unmount()=0
Unmounts file system from associated device.
virtual void lock()=0
Locks the file system for exclusive use by current thread.
virtual void unlock()=0
Unlocks the file system which was previously locked by current thread.
virtual int format()=0
Formats associated device with the file system.
virtual int mount()=0
Mounts file system on associated device.
Top-level namespace of distortos project.
Definition: buttons.hpp:33
virtual int getFileStatus(const char *path, struct stat &status)=0
Returns status of file.
virtual std::pair< int, std::unique_ptr< Directory > > openDirectory(const char *path)=0
Opens directory.
virtual ~FileSystem()=default
FileSystem's destructor.
Definition: FileSystem.hpp:34
virtual int remove(const char *path)=0
Removes file or directory.
virtual std::pair< int, std::unique_ptr< File > > openFile(const char *path, int flags)=0
Opens file.
virtual int getStatus(struct statvfs &status)=0
Returns status of file system.
virtual int rename(const char *path, const char *newPath)=0
Renames file or directory.
virtual int makeDirectory(const char *path, mode_t mode)=0
Makes a directory.