2021-12-03 15:37:49 +01:00
|
|
|
#include "MetadataInfo.h"
|
|
|
|
|
2022-09-15 18:41:15 +02:00
|
|
|
MetadataInfo::MetadataInfo(bool closureRequested, cfdp::ChecksumType checksumType,
|
2023-07-19 13:44:52 +02:00
|
|
|
cfdp::Fss& fileSize, cfdp::StringLv& sourceFileName,
|
2022-08-23 19:37:30 +02:00
|
|
|
cfdp::StringLv& destFileName)
|
|
|
|
: MetadataInfo(fileSize, sourceFileName, destFileName) {
|
|
|
|
this->closureRequested = closureRequested;
|
|
|
|
this->checksumType = checksumType;
|
|
|
|
}
|
|
|
|
|
2023-07-19 13:44:52 +02:00
|
|
|
MetadataInfo::MetadataInfo(cfdp::Fss& fileSize, cfdp::StringLv& sourceFileName,
|
2022-08-23 19:37:30 +02:00
|
|
|
cfdp::StringLv& destFileName)
|
|
|
|
: fileSize(fileSize), sourceFileName(sourceFileName), destFileName(destFileName) {}
|
|
|
|
|
2022-09-15 18:41:15 +02:00
|
|
|
cfdp::ChecksumType MetadataInfo::getChecksumType() const { return checksumType; }
|
2021-12-03 15:37:49 +01:00
|
|
|
|
2022-09-15 18:41:15 +02:00
|
|
|
void MetadataInfo::setChecksumType(cfdp::ChecksumType checksumType_) {
|
2022-08-08 17:53:42 +02:00
|
|
|
checksumType = checksumType_;
|
2021-12-03 15:37:49 +01:00
|
|
|
}
|
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
bool MetadataInfo::isClosureRequested() const { return closureRequested; }
|
2021-12-03 15:37:49 +01:00
|
|
|
|
2022-08-08 17:53:42 +02:00
|
|
|
void MetadataInfo::setClosureRequested(bool closureRequested_) {
|
|
|
|
closureRequested = closureRequested_;
|
2021-12-03 15:37:49 +01:00
|
|
|
}
|
|
|
|
|
2022-08-23 19:37:30 +02:00
|
|
|
cfdp::StringLv& MetadataInfo::getDestFileName() { return destFileName; }
|
2021-12-03 15:37:49 +01:00
|
|
|
|
2023-07-19 13:44:52 +02:00
|
|
|
cfdp::Fss& MetadataInfo::getFileSize() { return fileSize; }
|
2021-12-03 15:37:49 +01:00
|
|
|
|
|
|
|
size_t MetadataInfo::getSerializedSize(bool fssLarge) {
|
2022-02-02 10:29:30 +01:00
|
|
|
// 1 byte + minimal FSS 4 bytes
|
|
|
|
size_t size = 5;
|
|
|
|
if (fssLarge) {
|
|
|
|
size += 4;
|
|
|
|
}
|
|
|
|
size += sourceFileName.getSerializedSize();
|
|
|
|
size += destFileName.getSerializedSize();
|
|
|
|
return size;
|
2021-12-03 15:37:49 +01:00
|
|
|
}
|
|
|
|
|
2022-08-23 19:37:30 +02:00
|
|
|
void MetadataInfo::setDestFileName(cfdp::StringLv& destFileName_) {
|
|
|
|
this->destFileName = destFileName_;
|
|
|
|
}
|
2021-12-03 15:37:49 +01:00
|
|
|
|
2022-08-23 19:37:30 +02:00
|
|
|
void MetadataInfo::setSourceFileName(cfdp::StringLv& sourceFileName_) {
|
2022-08-08 17:53:42 +02:00
|
|
|
this->sourceFileName = sourceFileName_;
|
2021-12-03 15:37:49 +01:00
|
|
|
}
|
|
|
|
|
2022-08-23 19:37:30 +02:00
|
|
|
cfdp::StringLv& MetadataInfo::getSourceFileName() { return sourceFileName; }
|