F´ Flight Software - C/C++ Documentation
devel
A framework for building embedded system applications to NASA flight quality standards.
|
#include <Os/FileSystem.hpp>
Public Types | |
enum | Status { OP_OK , ALREADY_EXISTS , NO_SPACE , NO_PERMISSION , NOT_DIR , IS_DIR , NOT_EMPTY , INVALID_PATH , DOESNT_EXIST , FILE_LIMIT , BUSY , NO_MORE_FILES , BUFFER_TOO_SMALL , EXDEV_ERROR , OVERFLOW_ERROR , NOT_SUPPORTED , OTHER_ERROR } |
enum | PathType { FILE , DIRECTORY , NOT_EXIST } |
Public Member Functions | |
FileSystemInterface ()=default | |
default constructor More... | |
virtual | ~FileSystemInterface ()=default |
default virtual destructor More... | |
FileSystemInterface (const FileSystemInterface &other)=delete | |
copy constructor is forbidden More... | |
FileSystemInterface & | operator= (const FileSystemInterface &other)=delete |
assignment operator is forbidden More... | |
virtual FileSystemHandle * | getHandle ()=0 |
return the underlying FileSystem handle (implementation specific) More... | |
virtual Status | _removeDirectory (const char *path)=0 |
Remove a directory at the specified path. More... | |
virtual Status | _removeFile (const char *path)=0 |
Remove a file at the specified path. More... | |
virtual Status | _rename (const char *sourcePath, const char *destPath)=0 |
Rename (or move) a file from source to destination. More... | |
virtual Status | _getFreeSpace (const char *path, FwSizeType &totalBytes, FwSizeType &freeBytes)=0 |
Get filesystem free and total space in bytes on the filesystem containing the specified path. More... | |
virtual Status | _getWorkingDirectory (char *path, FwSizeType bufferSize)=0 |
Get the current working directory. More... | |
virtual Status | _changeWorkingDirectory (const char *path)=0 |
Change the current working directory to the specified path. More... | |
Static Public Member Functions | |
static FileSystemInterface * | getDelegate (FileSystemHandleStorage &aligned_new_memory) |
provide a pointer to a FileSystem delegate object More... | |
Static Public Attributes | |
static constexpr FwSignedSizeType | FILE_SYSTEM_FILE_CHUNK_SIZE = FW_FILE_CHUNK_SIZE |
Size of file system chunk. More... | |
Definition at line 18 of file FileSystem.hpp.
Enumerator | |
---|---|
FILE | Path is a file. |
DIRECTORY | Path is a directory. |
NOT_EXIST | Path does not exist. |
Definition at line 44 of file FileSystem.hpp.
Enumerator | |
---|---|
OP_OK | Operation was successful. |
ALREADY_EXISTS | File already exists. |
NO_SPACE | No space left. |
NO_PERMISSION | No permission to write. |
NOT_DIR | Path is not a directory. |
IS_DIR | Path is a directory. |
NOT_EMPTY | directory is not empty |
INVALID_PATH | Path is too long, too many sym links, etc. |
DOESNT_EXIST | Path doesn't exist. |
FILE_LIMIT | Too many files or links. |
BUSY | Operand is in use by the system or by a process. |
NO_MORE_FILES | Directory stream has no more files. |
BUFFER_TOO_SMALL | Buffer size is too small to hold full path (for getWorkingDirectory) |
EXDEV_ERROR | |
OVERFLOW_ERROR | |
NOT_SUPPORTED | Operation is not supported by the current implementation. |
OTHER_ERROR | other OS-specific error |
Definition at line 24 of file FileSystem.hpp.
|
default |
default constructor
|
virtualdefault |
default virtual destructor
|
delete |
copy constructor is forbidden
|
pure virtual |
Change the current working directory to the specified path.
path | The path of the new working directory |
Implemented in Os::Stub::FileSystem::StubFileSystem, Os::Posix::FileSystem::PosixFileSystem, and Os::FileSystem.
|
pure virtual |
Get filesystem free and total space in bytes on the filesystem containing the specified path.
path | The path on the filesystem to query |
totalBytes | Reference to store the total bytes on the filesystem |
freeBytes | Reference to store the free bytes on the filesystem |
Implemented in Os::Stub::FileSystem::StubFileSystem, Os::Posix::FileSystem::PosixFileSystem, and Os::FileSystem.
|
pure virtual |
Get the current working directory.
path | Buffer to store the current working directory path |
bufferSize | Size of the buffer |
Implemented in Os::Stub::FileSystem::StubFileSystem, Os::Posix::FileSystem::PosixFileSystem, and Os::FileSystem.
|
pure virtual |
Remove a directory at the specified path.
path | The path of the directory to remove |
Implemented in Os::Stub::FileSystem::StubFileSystem, Os::Posix::FileSystem::PosixFileSystem, and Os::FileSystem.
|
pure virtual |
Remove a file at the specified path.
path | The path of the file to remove |
Implemented in Os::Stub::FileSystem::StubFileSystem, Os::Posix::FileSystem::PosixFileSystem, and Os::FileSystem.
|
pure virtual |
Rename (or move) a file from source to destination.
sourcePath | The path of the source file |
destPath | The path of the destination file |
Implemented in Os::Stub::FileSystem::StubFileSystem, Os::Posix::FileSystem::PosixFileSystem, and Os::FileSystem.
|
static |
provide a pointer to a FileSystem delegate object
get a delegate for FileSystemInterface that intercepts calls for stub fileSystem usage
aligned_new_memory | aligned memory to fill |
to_copy | pointer to copy-constructor input |
Definition at line 17 of file DefaultFile.cpp.
|
pure virtual |
return the underlying FileSystem handle (implementation specific)
Implemented in Os::Stub::FileSystem::StubFileSystem, Os::Posix::FileSystem::PosixFileSystem, and Os::FileSystem.
|
delete |
assignment operator is forbidden
|
staticconstexpr |
Size of file system chunk.
Definition at line 22 of file FileSystem.hpp.