F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
FileSystemInterface.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title Os/Interfaces/FileSystemInterface.hpp
3 // \brief pure-virtual interface implemented by Os::FileSystem implementations
4 // ======================================================================
5 #ifndef OS_INTERFACES_FILESYSTEMINTERFACE_HPP_
6 #define OS_INTERFACES_FILESYSTEMINTERFACE_HPP_
7 
9 
10 namespace Os {
11 
13  public:
15  FileSystemInterface() = default;
16 
18  virtual ~FileSystemInterface() = default;
19 
21  FileSystemInterface(const FileSystemInterface& other) = delete;
22 
24  FileSystemInterface& operator=(const FileSystemInterface& other) = delete; // NO_CODESONAR (cpp:S3657)
25 
28  virtual FileSystemHandle* getHandle() = 0;
29 
30  // ------------------------------------------------------------------
31  // FileSystem 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/FileSystem.hpp
35 
39  virtual Status _removeDirectory(const char* path) = 0;
40 
44  virtual Status _removeFile(const char* path) = 0;
45 
50  virtual Status _rename(const char* sourcePath, const char* destPath) = 0;
51 
57  virtual Status _getFreeSpace(const char* path, FwSizeType& totalBytes, FwSizeType& freeBytes) = 0;
58 
66  virtual Status _getPathType(const char* path, PathType& pathType) = 0;
67 
72  virtual Status _getWorkingDirectory(char* path, FwSizeType bufferSize) = 0;
73 
77  virtual Status _changeWorkingDirectory(const char* path) = 0;
78 };
79 
80 } // namespace Os
81 
82 #endif // OS_INTERFACES_FILESYSTEMINTERFACE_HPP_
virtual Status _getFreeSpace(const char *path, FwSizeType &totalBytes, FwSizeType &freeBytes)=0
Get filesystem free and total space in bytes on the filesystem containing the specified path...
PlatformSizeType FwSizeType
FileSystemInterface()=default
default constructor
virtual ~FileSystemInterface()=default
default virtual destructor
types and constants shared by users of Os::FileSystem and by its implementations
virtual Status _rename(const char *sourcePath, const char *destPath)=0
Rename (or move) a file from source to destination.
virtual Status _getPathType(const char *path, PathType &pathType)=0
Get the type of the path (file, directory, etc.)
virtual Status _getWorkingDirectory(char *path, FwSizeType bufferSize)=0
Get the current working directory.
virtual FileSystemHandle * getHandle()=0
return the underlying FileSystem handle (implementation specific)
FileSystemInterface & operator=(const FileSystemInterface &other)=delete
assignment operator is forbidden
virtual Status _removeFile(const char *path)=0
Remove a file at the specified path.
virtual Status _removeDirectory(const char *path)=0
Remove a directory at the specified path.
virtual Status _changeWorkingDirectory(const char *path)=0
Change the current working directory to the specified path.