getFileSize API for fsfw
This commit is contained in:
@ -145,3 +145,13 @@ ReturnValue_t FilesystemMock::getBaseFilename(FilesystemParams params, char *nam
|
||||
}
|
||||
|
||||
bool FilesystemMock::isDirectory(const char *path) { return false; }
|
||||
|
||||
bool FilesystemMock::getFileSize(FilesystemParams params, size_t &fileSize) {
|
||||
std::string filename(params.path);
|
||||
auto iter = fileMap.find(filename);
|
||||
if (iter == fileMap.end()) {
|
||||
fileSize = iter->second.fileRaw.size();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user