windows building again
This commit is contained in:
@ -6,6 +6,7 @@
|
||||
#include <queue>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <filesystem>
|
||||
|
||||
#include "fsfw/filesystem.h"
|
||||
|
||||
@ -20,13 +21,13 @@
|
||||
class FilesystemMock : public HasFileSystemIF {
|
||||
public:
|
||||
struct FileWriteInfo {
|
||||
FileWriteInfo(std::basic_string<std::filesystem::path::value_type> filename, size_t offset,
|
||||
FileWriteInfo(std::filesystem::path::string_type filename, size_t offset,
|
||||
const uint8_t *data, size_t len)
|
||||
: offset(offset) {
|
||||
this->filename = filename;
|
||||
this->data.insert(this->data.end(), data, data + len);
|
||||
}
|
||||
std::basic_string<std::filesystem::path::value_type> filename;
|
||||
std::filesystem::path::string_type filename;
|
||||
size_t offset;
|
||||
std::vector<uint8_t> data;
|
||||
};
|
||||
@ -37,7 +38,7 @@ class FilesystemMock : public HasFileSystemIF {
|
||||
std::vector<uint8_t> fileRaw;
|
||||
};
|
||||
|
||||
std::map<std::basic_string<std::filesystem::path::value_type>, FileInfo> fileMap;
|
||||
std::map<std::filesystem::path::string_type, FileInfo> fileMap;
|
||||
|
||||
struct DirInfo {
|
||||
size_t createCallCount = 0;
|
||||
@ -45,18 +46,17 @@ class FilesystemMock : public HasFileSystemIF {
|
||||
std::queue<bool> wihParentDir;
|
||||
std::queue<bool> recursiveDeletion;
|
||||
};
|
||||
std::map<std::basic_string<std::filesystem::path::value_type>, DirInfo> dirMap;
|
||||
std::map<std::filesystem::path::string_type, DirInfo> dirMap;
|
||||
|
||||
struct RenameInfo {
|
||||
RenameInfo(std::basic_string<std::filesystem::path::value_type> oldName,
|
||||
std::basic_string<std::filesystem::path::value_type> newName)
|
||||
RenameInfo(const char* oldName, const char *newName)
|
||||
: oldName(std::move(oldName)), newName(std::move(newName)) {}
|
||||
|
||||
std::basic_string<std::filesystem::path::value_type> oldName;
|
||||
std::basic_string<std::filesystem::path::value_type> newName;
|
||||
const char *oldName;
|
||||
const char *newName;
|
||||
};
|
||||
std::queue<RenameInfo> renameQueue;
|
||||
std::basic_string<std::filesystem::path::value_type> truncateCalledOnFile;
|
||||
const char* truncateCalledOnFile;
|
||||
ReturnValue_t feedFile(const std::string &filename, std::ifstream &file);
|
||||
|
||||
bool fileExists(FilesystemParams params) override;
|
||||
@ -66,12 +66,12 @@ class FilesystemMock : public HasFileSystemIF {
|
||||
ReturnValue_t readFromFile(FileOpParams params, uint8_t **buffer, size_t &readSize,
|
||||
size_t maxSize) override;
|
||||
ReturnValue_t createFile(FilesystemParams params, const uint8_t *data, size_t size) override;
|
||||
ReturnValue_t removeFile(const std::filesystem::path::value_type *path,
|
||||
ReturnValue_t removeFile(const char *path,
|
||||
FileSystemArgsIF *args) override;
|
||||
ReturnValue_t createDirectory(FilesystemParams params, bool createParentDirs) override;
|
||||
ReturnValue_t removeDirectory(FilesystemParams params, bool deleteRecurively) override;
|
||||
ReturnValue_t rename(const std::filesystem::path::value_type *oldPath,
|
||||
const std::filesystem::path::value_type *newPath,
|
||||
ReturnValue_t rename(const char *oldPath,
|
||||
const char *newPath,
|
||||
FileSystemArgsIF *args) override;
|
||||
|
||||
void reset();
|
||||
|
Reference in New Issue
Block a user