F´ Flight Software - C/C++ Documentation
devel
A framework for building embedded system applications to NASA flight quality standards.
|
#include <Os/Directory.hpp>
Public Types | |
enum | Status { OP_OK , DOESNT_EXIST , NO_PERMISSION , NOT_OPENED , NOT_DIR , NO_MORE_FILES , FILE_LIMIT , BAD_DESCRIPTOR , ALREADY_EXISTS , NOT_SUPPORTED , OTHER_ERROR } |
enum | OpenMode { READ , CREATE_IF_MISSING , CREATE_EXCLUSIVE , MAX_OPEN_MODE } |
Public Member Functions | |
DirectoryInterface ()=default | |
default constructor More... | |
virtual | ~DirectoryInterface ()=default |
default virtual destructor More... | |
DirectoryInterface (const DirectoryInterface &other)=delete | |
copy constructor is forbidden More... | |
DirectoryInterface & | operator= (const DirectoryInterface &other)=delete |
assignment operator is forbidden More... | |
virtual DirectoryHandle * | getHandle ()=0 |
return the underlying Directory handle (implementation specific) More... | |
virtual Status | open (const char *path, OpenMode mode)=0 |
Open or create a directory. More... | |
virtual Status | rewind ()=0 |
Rewind directory stream. More... | |
virtual Status | read (char *fileNameBuffer, FwSizeType buffSize)=0 |
Get next filename from directory stream. More... | |
virtual void | close ()=0 |
Get next filename from directory stream and write it to a Fw::StringBase object. More... | |
Static Public Member Functions | |
static DirectoryInterface * | getDelegate (DirectoryHandleStorage &aligned_new_memory) |
provide a pointer to a Directory delegate object More... | |
Definition at line 17 of file Directory.hpp.
Definition at line 33 of file Directory.hpp.
Enumerator | |
---|---|
OP_OK | Operation was successful. |
DOESNT_EXIST | Directory doesn't exist. |
NO_PERMISSION | No permission to read directory. |
NOT_OPENED | Directory hasn't been opened yet. |
NOT_DIR | Path is not a directory. |
NO_MORE_FILES | Directory stream has no more files. |
FILE_LIMIT | Directory has more files than can be read. |
BAD_DESCRIPTOR | Directory stream descriptor is invalid. |
ALREADY_EXISTS | Directory already exists. |
NOT_SUPPORTED | Operation is not supported by the current implementation. |
OTHER_ERROR | A catch-all for other errors. Have to look in implementation-specific code. |
Definition at line 19 of file Directory.hpp.
|
default |
default constructor
|
virtualdefault |
default virtual destructor
|
delete |
copy constructor is forbidden
|
pure virtual |
Get next filename from directory stream and write it to a Fw::StringBase object.
filename | Fw::StringBase (or derived) object to store filename in |
Close directory
Implemented in Os::Stub::Directory::StubDirectory, Os::Posix::Directory::PosixDirectory, and Os::Directory.
|
static |
provide a pointer to a Directory delegate object
get a delegate for DirectoryInterface that intercepts calls for stub Directory usage
aligned_new_memory | aligned memory to fill |
Definition at line 20 of file DefaultFile.cpp.
|
pure virtual |
return the underlying Directory handle (implementation specific)
Implemented in Os::Stub::Directory::StubDirectory, Os::Posix::Directory::PosixDirectory, and Os::Directory.
Open or create a directory.
Using the path provided, this function will open or create a directory. Use OpenMode::READ to open an existing directory and error if the directory is not found Use OpenMode::CREATE_IF_MISSING to open a directory, creating the directory if it doesn't exist Use OpenMode::CREATE_EXCLUSIVE to open a directory, creating the directory and erroring if it already exists
It is invalid to pass nullptr
as the path. It is invalid to supply mode
as a non-enumerated value.
path | path of directory to open |
mode | enum (READ, CREATE_IF_MISSING, CREATE_EXCLUSIVE). See notes above for more information |
Implemented in Os::Stub::Directory::StubDirectory, Os::Posix::Directory::PosixDirectory, and Os::Directory.
|
delete |
assignment operator is forbidden
|
pure virtual |
Get next filename from directory stream.
Write at most buffSize characters of the file name to fileNameBuffer and guarantee null-termination. This function skips the current directory (.) and parent directory (..) entries. Returns NO_MORE_FILES if there are no more files to read from the buffer.
It is invalid to pass nullptr
as fileNameBuffer.
fileNameBuffer | buffer to store filename |
buffSize | size of fileNameBuffer |
Implemented in Os::Stub::Directory::StubDirectory, Os::Posix::Directory::PosixDirectory, and Os::Directory.
|
pure virtual |
Rewind directory stream.
Each read operation moves the seek position forward. This function resets the seek position to the beginning.
Implemented in Os::Stub::Directory::StubDirectory, Os::Posix::Directory::PosixDirectory, and Os::Directory.