F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
FileSystem.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title Os/Posix/FileSystem.hpp
3 // \brief Posix FileSystem definitions for Os::FileSystem
4 // ======================================================================
5 #ifndef OS_POSIX_FILESYSTEM_HPP
6 #define OS_POSIX_FILESYSTEM_HPP
7 
8 #include "Os/FileSystem.hpp"
9 
10 namespace Os {
11 namespace Posix {
12 namespace FileSystem {
13 
15 
21  public:
23  PosixFileSystem() = default;
24 
26  ~PosixFileSystem() override = default;
27 
28  // ------------------------------------------------------------
29  // Implementation-specific member functions - overrides
30  // ------------------------------------------------------------
31 
38  Status _removeDirectory(const char* path) override;
39 
46  Status _removeFile(const char* path) override;
47 
58  Status _rename(const char* sourcePath, const char* destPath) override;
59 
68  Status _getFreeSpace(const char* path, FwSizeType& totalBytes, FwSizeType& freeBytes) override;
69 
81  Status _getWorkingDirectory(char* path, FwSizeType bufferSize) override;
82 
89  Status _changeWorkingDirectory(const char* path) override;
90 
97  FileSystemHandle* getHandle() override;
98 
99  private:
101  PosixFileSystemHandle m_handle;
102 }; // class PosixFileSystem
103 
104 } // namespace FileSystem
105 } // namespace Posix
106 } // namespace Os
107 #endif // OS_POSIX_FILESYSTEM_HPP
PlatformSizeType FwSizeType
Definition: FpConfig.h:35
Posix implementation of Os::FileSystem.
Definition: FileSystem.hpp:20
Status _removeFile(const char *path) override
Remove a file at the specified path.
Definition: FileSystem.cpp:30
Status _changeWorkingDirectory(const char *path) override
Change the current working directory to the specified path.
Definition: FileSystem.cpp:54
~PosixFileSystem() override=default
destructor
Status _getWorkingDirectory(char *path, FwSizeType bufferSize) override
Get the current working directory.
Definition: FileSystem.cpp:46
FileSystemHandle * getHandle() override
Get the raw FileSystem handle.
Definition: FileSystem.cpp:96
Status _removeDirectory(const char *path) override
Remove a directory at the specified path.
Definition: FileSystem.cpp:22
Status _getFreeSpace(const char *path, FwSizeType &totalBytes, FwSizeType &freeBytes) override
Get filesystem free and total space in bytes on the filesystem containing the specified path.
Definition: FileSystem.cpp:62
Status _rename(const char *sourcePath, const char *destPath) override
Rename a file from source to destination.
Definition: FileSystem.cpp:38