F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
Directory.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title Os/Posix/Directory.hpp
3 // \brief Posix definitions for Os::Directory
4 // ======================================================================
5 #ifndef OS_POSIX_DIRECTORY_HPP
6 #define OS_POSIX_DIRECTORY_HPP
7 #include <dirent.h>
8 #include <Os/Directory.hpp>
9 
10 namespace Os {
11 namespace Posix {
12 namespace Directory {
13 
15  DIR* m_dir_descriptor = nullptr;
16 };
17 
22  public:
25 
27  ~PosixDirectory() = default;
28 
31  DirectoryHandle* getHandle() override;
32 
33  // ------------------------------------------------------------
34  // Implementation-specific Directory member functions
35  // ------------------------------------------------------------
36 
50  Status open(const char* path, OpenMode mode) override;
51 
54  bool isOpen();
55 
61  Status rewind() override;
62 
74  Status read(char* fileNameBuffer, FwSizeType buffSize) override;
75 
77  void close() override;
78 
79  private:
81  PosixDirectoryHandle m_handle;
82 };
83 
84 } // namespace Directory
85 } // namespace Posix
86 } // namespace Os
87 #endif // OS_POSIX_DIRECTORY_HPP
PlatformSizeType FwSizeType
Definition: FpConfig.h:35
Posix implementation of Os::Directory.
Definition: Directory.hpp:21
void close() override
Close directory.
Definition: Directory.cpp:91
bool isOpen()
Check if Directory is open or not.
DirectoryHandle * getHandle() override
return the underlying mutex handle (implementation specific)
Definition: Directory.cpp:20
Status rewind() override
Rewind directory stream.
Definition: Directory.cpp:52
Status read(char *fileNameBuffer, FwSizeType buffSize) override
Get next filename from directory stream.
Definition: Directory.cpp:59
Status open(const char *path, OpenMode mode) override
Open or create a directory.
Definition: Directory.cpp:24