host filesystem continued
This commit is contained in:
@ -19,13 +19,9 @@ struct FilesystemParams {
|
||||
struct FileOpParams {
|
||||
FileOpParams(const char* path, size_t size) : fsParams(path), size(size) {}
|
||||
|
||||
[[nodiscard]] const char* path() const {
|
||||
return fsParams.path;
|
||||
}
|
||||
[[nodiscard]] const char* path() const { return fsParams.path; }
|
||||
|
||||
[[nodiscard]] FileSystemArgsIF* args() const {
|
||||
return fsParams.args;
|
||||
}
|
||||
[[nodiscard]] FileSystemArgsIF* args() const { return fsParams.args; }
|
||||
|
||||
FilesystemParams fsParams;
|
||||
size_t size;
|
||||
|
@ -134,7 +134,8 @@ ReturnValue_t PusDistributor::initialize() {
|
||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||
}
|
||||
if (verifyChannel == nullptr) {
|
||||
verifyChannel = ObjectManager::instance()->get<VerificationReporterIF>(objects::VERIFICATION_REPORTER);
|
||||
verifyChannel =
|
||||
ObjectManager::instance()->get<VerificationReporterIF>(objects::VERIFICATION_REPORTER);
|
||||
if (verifyChannel == nullptr) {
|
||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||
}
|
||||
|
@ -40,14 +40,14 @@ ReturnValue_t HostFilesystem::readFromFile(FileOpParams params, uint8_t **buffer
|
||||
if (file.fail()) {
|
||||
return HasFileSystemIF::GENERIC_FILE_ERROR;
|
||||
}
|
||||
auto readLen = static_cast<unsigned int>(params.offset);
|
||||
file.seekg(readLen);
|
||||
if (readSize + params.size > maxSize) {
|
||||
auto sizeToRead = static_cast<unsigned int>(params.size);
|
||||
file.seekg(static_cast<unsigned int>(params.offset));
|
||||
if (readSize + sizeToRead > maxSize) {
|
||||
return SerializeIF::BUFFER_TOO_SHORT;
|
||||
}
|
||||
file.read(reinterpret_cast<char *>(*buffer), readLen);
|
||||
readSize += readLen;
|
||||
*buffer += readLen;
|
||||
file.read(reinterpret_cast<char *>(*buffer), sizeToRead);
|
||||
readSize += sizeToRead;
|
||||
*buffer += sizeToRead;
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user