F´ Flight Software - C/C++ Documentation
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  // Implementation-specific FileSystem member functions
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 
98  FileSystemHandle* getHandle() override;
99 
107  Status _getPathType(const char* path, PathType& pathType) override;
108 
109  private:
111  StubFileSystemHandle m_handle;
112 };
113 
114 } // namespace FileSystem
115 } // namespace Stub
116 } // namespace Os
117 #endif // OS_STUB_FILESYSTEM_HPP
Status _removeDirectory(const char *path) override
Remove a directory at the specified path.
Definition: FileSystem.cpp:11
PlatformSizeType FwSizeType
StubFileSystem()=default
constructor
FileSystemHandle * getHandle() override
returns the raw fileSystem handle
Definition: FileSystem.cpp:35
Status _changeWorkingDirectory(const char *path) override
Change the current working directory to the specified path.
Definition: FileSystem.cpp:27
Status _removeFile(const char *path) override
Remove a file at the specified path.
Definition: FileSystem.cpp:15
Status _getPathType(const char *path, PathType &pathType) override
Get the type of the path (file, directory, etc.)
Definition: FileSystem.cpp:39
Status _getWorkingDirectory(char *path, FwSizeType bufferSize) override
Get the current working directory.
Definition: FileSystem.cpp:23
~StubFileSystem() override=default
destructor
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 _rename(const char *sourcePath, const char *destPath) override
Rename a file from source to destination.
Definition: FileSystem.cpp:19
stub implementation of Os::FileSystem
Definition: FileSystem.hpp:20