6 #ifndef _OS_DIRECTORY_HPP_
7 #define _OS_DIRECTORY_HPP_
178 void close()
override;
#define FW_HANDLE_ALIGNMENT
Alignment of handle storage.
PlatformSizeType FwSizeType
C++-compatible configuration header for fprime configuration.
U8 DirectoryHandleStorage[FW_DIRECTORY_HANDLE_MAX_SIZE]
Status rewind() override
Rewind directory stream.
Status getFileCount(FwSizeType &fileCount)
Get the number of files in the directory.
Status open(const char *path, OpenMode mode) override
Open or create a directory.
bool isOpen()
Check if Directory is open or not.
DirectoryHandle * getHandle() override
return the underlying Directory handle (implementation specific)
Status readDirectory(Fw::String filenameArray[], const FwSizeType arraySize, FwSizeType &filenameCount)
Read the contents of the directory and store filenames in filenameArray of size arraySize.
void close() override
Close directory.
~Directory() final
Destructor.
Status read(char *fileNameBuffer, FwSizeType buffSize) override
Get next filename from directory stream.
static DirectoryInterface * getDelegate(DirectoryHandleStorage &aligned_new_memory)
provide a pointer to a Directory delegate object
virtual Status rewind()=0
Rewind directory stream.
DirectoryInterface & operator=(const DirectoryInterface &other)=delete
assignment operator is forbidden
virtual Status open(const char *path, OpenMode mode)=0
Open or create a directory.
virtual ~DirectoryInterface()=default
default virtual destructor
virtual void close()=0
Get next filename from directory stream and write it to a Fw::StringBase object.
DirectoryInterface()=default
default constructor
virtual Status read(char *fileNameBuffer, FwSizeType buffSize)=0
Get next filename from directory stream.
DirectoryInterface(const DirectoryInterface &other)=delete
copy constructor is forbidden
@ READ
Error if directory doesn't exist.
@ MAX_OPEN_MODE
Maximum value of OpenMode.
@ CREATE_IF_MISSING
Create directory if it doesn't exist.
@ CREATE_EXCLUSIVE
Create directory and error if it already exists.
@ DOESNT_EXIST
Directory doesn't exist.
@ NO_PERMISSION
No permission to read directory.
@ OP_OK
Operation was successful.
@ NO_MORE_FILES
Directory stream has no more files.
@ NOT_OPENED
Directory hasn't been opened yet.
@ NOT_SUPPORTED
Operation is not supported by the current implementation.
@ FILE_LIMIT
Directory has more files than can be read.
@ BAD_DESCRIPTOR
Directory stream descriptor is invalid.
@ NOT_DIR
Path is not a directory.
@ OTHER_ERROR
A catch-all for other errors. Have to look in implementation-specific code.
@ ALREADY_EXISTS
Directory already exists.
virtual DirectoryHandle * getHandle()=0
return the underlying Directory handle (implementation specific)