F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
DirectoryInterface.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title Os/Interfaces/DirectoryInterface.hpp
3 // \brief pure-virtual interface implemented by Os::Directory implementations
4 // ======================================================================
5 #ifndef OS_INTERFACES_DIRECTORYINTERFACE_HPP_
6 #define OS_INTERFACES_DIRECTORYINTERFACE_HPP_
7 
9 
10 namespace Os {
11 
13  public:
15  DirectoryInterface() = default;
16 
18  virtual ~DirectoryInterface() = default;
19 
21  DirectoryInterface(const DirectoryInterface& other) = delete;
22 
24  DirectoryInterface& operator=(const DirectoryInterface& other) = delete;
25 
28  virtual DirectoryHandle* getHandle() = 0;
29 
30  // -----------------------------------------------------------------
31  // Directory operations to be implemented by an OSAL implementation
32  // -----------------------------------------------------------------
33  // These functions are to be overridden in each OS implementation
34  // See an example in in Os/Posix/Directory.hpp
35 
49  virtual Status open(const char* path, OpenMode mode) = 0;
50 
56  virtual Status rewind() = 0;
57 
69  virtual Status read(char* fileNameBuffer, FwSizeType buffSize) = 0;
70 
75  // virtual Status read(Fw::StringBase& filename) = 0;
76 
78  virtual void close() = 0;
79 };
80 
81 } // namespace Os
82 
83 #endif // OS_INTERFACES_DIRECTORYINTERFACE_HPP_
virtual DirectoryHandle * getHandle()=0
return the underlying Directory handle (implementation specific)
virtual ~DirectoryInterface()=default
default virtual destructor
virtual Status read(char *fileNameBuffer, FwSizeType buffSize)=0
Get next filename from directory stream.
PlatformSizeType FwSizeType
DirectoryInterface()=default
default constructor
DirectoryInterface & operator=(const DirectoryInterface &other)=delete
assignment operator is forbidden
types and constants shared by users of Os::Directory and by its implementations
virtual Status open(const char *path, OpenMode mode)=0
Open or create a directory.
virtual Status rewind()=0
Rewind directory stream.
virtual void close()=0
Get next filename from directory stream and write it to a Fw::StringBase object.