Merge remote-tracking branch 'origin/develop' into mueller/pus-15-tm-storage
This commit is contained in:
@ -160,3 +160,18 @@ ReturnValue_t HostFilesystem::truncateFile(FilesystemParams params) {
|
||||
ofstream of(path);
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
bool HostFilesystem::isDirectory(const char *path) { return filesystem::is_directory(path); }
|
||||
|
||||
ReturnValue_t HostFilesystem::getBaseFilename(FilesystemParams params, char *nameBuf, size_t maxLen,
|
||||
size_t &baseNameLen) {
|
||||
std::string path(params.path);
|
||||
std::string baseName = path.substr(path.find_last_of("/\\") + 1);
|
||||
if (baseName.size() + 1 > maxLen) {
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
std::memcpy(nameBuf, baseName.c_str(), baseName.size());
|
||||
nameBuf[baseName.size()] = '\0';
|
||||
baseNameLen = baseName.size();
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
@ -9,6 +9,9 @@ class HostFilesystem : public HasFileSystemIF {
|
||||
public:
|
||||
HostFilesystem();
|
||||
|
||||
ReturnValue_t getBaseFilename(FilesystemParams params, char *nameBuf, size_t maxLen,
|
||||
size_t &baseNameLen) override;
|
||||
bool isDirectory(const char *path) override;
|
||||
bool fileExists(FilesystemParams params) override;
|
||||
ReturnValue_t truncateFile(FilesystemParams params) override;
|
||||
ReturnValue_t writeToFile(FileOpParams params, const uint8_t *data) override;
|
||||
|
@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <fsfw_hal/linux/spi/SpiCookie.h>
|
||||
|
||||
#include "fsfw/ipc/MutexIF.h"
|
||||
#include "fsfw/returnvalues/returnvalue.h"
|
||||
#include "fsfw_hal/common/gpio/GpioIF.h"
|
||||
|
Reference in New Issue
Block a user