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/Stub/FileSystem.hpp
3 // \brief stub fileSystem definitions for Os::FileSystem
4 // ======================================================================
5 #ifndef OS_STUB_FILESYSTEM_HPP
6 #define OS_STUB_FILESYSTEM_HPP
7 
8 #include "Os/FileSystem.hpp"
9 
10 namespace Os {
11 namespace Stub {
12 namespace FileSystem {
13 
15 
21  public:
23  StubFileSystem() = default;
24 
26  ~StubFileSystem() override = default;
27 
28 
29  // ------------------------------------------------------------
30  // Implementation-specific FileSystem member functions
31  // ------------------------------------------------------------
32 
39  Status _removeDirectory(const char* path) override;
40 
47  Status _removeFile(const char* path) override;
48 
59  Status _rename(const char* sourcePath, const char* destPath) override;
60 
69  Status _getFreeSpace(const char* path, FwSizeType& totalBytes, FwSizeType& freeBytes) override;
70 
82  Status _getWorkingDirectory(char* path, FwSizeType bufferSize) override;
83 
90  Status _changeWorkingDirectory(const char* path) override;
91 
92 
93 
101  FileSystemHandle *getHandle() override;
102 
103 
104 private:
106  StubFileSystemHandle m_handle;
107 };
108 
109 } // namespace FileSystem
110 } // namespace Stub
111 } // namespace Os
112 #endif // OS_STUB_FILESYSTEM_HPP
PlatformSizeType FwSizeType
Definition: FpConfig.h:35
stub implementation of Os::FileSystem
Definition: FileSystem.hpp:20
Status _removeDirectory(const char *path) override
Remove a directory at the specified path.
Definition: FileSystem.cpp:11
StubFileSystem()=default
constructor
Status _rename(const char *sourcePath, const char *destPath) override
Rename a file from source to destination.
Definition: FileSystem.cpp:19
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:31
Status _removeFile(const char *path) override
Remove a file at the specified path.
Definition: FileSystem.cpp:15
Status _getWorkingDirectory(char *path, FwSizeType bufferSize) override
Get the current working directory.
Definition: FileSystem.cpp:23
Status _changeWorkingDirectory(const char *path) override
Change the current working directory to the specified path.
Definition: FileSystem.cpp:27
~StubFileSystem() override=default
destructor
FileSystemHandle * getHandle() override
returns the raw fileSystem handle
Definition: FileSystem.cpp:35