Update FSFW from Upstream #27

Merged
muellerr merged 523 commits from mueller/update-from-upstream into develop 2022-05-17 10:06:59 +02:00
2 changed files with 30 additions and 10 deletions
Showing only changes of commit 0176c07886 - Show all commits

View File

@ -0,0 +1,13 @@
#ifndef FSFW_SRC_FSFW_MEMORY_FILESYSTEMARGS_H_
#define FSFW_SRC_FSFW_MEMORY_FILESYSTEMARGS_H_
/**
* Empty base interface which can be implemented by to pass arguments via the HasFileSystemIF.
* Users can then dynamic_cast the base pointer to the require child pointer.
*/
class FileSystemArgsIF {
public:
virtual~ FileSystemArgsIF() {};
};
#endif /* FSFW_SRC_FSFW_MEMORY_FILESYSTEMARGS_H_ */

View File

@ -1,9 +1,10 @@
#ifndef FSFW_MEMORY_HASFILESYSTEMIF_H_ #ifndef FSFW_MEMORY_HASFILESYSTEMIF_H_
#define FSFW_MEMORY_HASFILESYSTEMIF_H_ #define FSFW_MEMORY_HASFILESYSTEMIF_H_
#include "../returnvalues/HasReturnvaluesIF.h" #include "FileSystemArgsIF.h"
#include "../returnvalues/FwClassIds.h" #include "fsfw/returnvalues/HasReturnvaluesIF.h"
#include "../ipc/messageQueueDefinitions.h" #include "fsfw/returnvalues/FwClassIds.h"
#include "fsfw/ipc/messageQueueDefinitions.h"
#include <cstddef> #include <cstddef>
@ -59,7 +60,7 @@ public:
*/ */
virtual ReturnValue_t appendToFile(const char* repositoryPath, virtual ReturnValue_t appendToFile(const char* repositoryPath,
const char* filename, const uint8_t* data, size_t size, const char* filename, const uint8_t* data, size_t size,
uint16_t packetNumber, void* args = nullptr) = 0; uint16_t packetNumber, FileSystemArgsIF* args = nullptr) = 0;
/** /**
* @brief Generic function to create a new file. * @brief Generic function to create a new file.
@ -72,7 +73,7 @@ public:
*/ */
virtual ReturnValue_t createFile(const char* repositoryPath, virtual ReturnValue_t createFile(const char* repositoryPath,
const char* filename, const uint8_t* data = nullptr, const char* filename, const uint8_t* data = nullptr,
size_t size = 0, void* args = nullptr) = 0; size_t size = 0, FileSystemArgsIF* args = nullptr) = 0;
/** /**
* @brief Generic function to delete a file. * @brief Generic function to delete a file.
@ -81,24 +82,30 @@ public:
* @param args Any other arguments which an implementation might require * @param args Any other arguments which an implementation might require
* @return * @return
*/ */
virtual ReturnValue_t deleteFile(const char* repositoryPath, virtual ReturnValue_t removeFile(const char* repositoryPath,
const char* filename, void* args = nullptr) = 0; const char* filename, FileSystemArgsIF* args = nullptr) = 0;
/** /**
* @brief Generic function to create a directory * @brief Generic function to create a directory
* @param repositoryPath * @param repositoryPath
* @param Equivalent to the -p flag in Unix systems. If some required parent directories
* do not exist, create them as well
* @param args Any other arguments which an implementation might require * @param args Any other arguments which an implementation might require
* @return * @return
*/ */
virtual ReturnValue_t createDirectory(const char* repositoryPath, void* args = nullptr) = 0; virtual ReturnValue_t createDirectory(const char* repositoryPath, const char* dirname,
bool createParentDirs, FileSystemArgsIF* args = nullptr) = 0;
/** /**
* @brief Generic function to remove a directory * @brief Generic function to remove a directory
* @param repositoryPath * @param repositoryPath
* @param args Any other arguments which an implementation might require * @param args Any other arguments which an implementation might require
*/ */
virtual ReturnValue_t removeDirectory(const char* repositoryPath, virtual ReturnValue_t removeDirectory(const char* repositoryPath, const char* dirname,
bool deleteRecurively = false, void* args = nullptr) = 0; bool deleteRecurively = false, FileSystemArgsIF* args = nullptr) = 0;
virtual ReturnValue_t renameFile(const char* repositoryPath, const char* oldFilename,
const char* newFilename, FileSystemArgsIF* args = nullptr) = 0;
}; };