|
|
@ -360,6 +360,12 @@ void Bagmetadata::set_BaggingDate(string BaggingDate) { |
|
|
|
this->metadata["BaggingDate"] = BaggingDate; |
|
|
|
} |
|
|
|
|
|
|
|
void Bagmetadata::set_BaggingDate( std::time_t BaggingDate ) { |
|
|
|
char datestring[100]; |
|
|
|
std::strftime( datestring, sizeof(datestring), "%Y-%m-%d", std::localtime(&BaggingDate)); |
|
|
|
this->metadata["BaggingDate"] = string(datestring); |
|
|
|
} |
|
|
|
|
|
|
|
void Bagmetadata::set_ExternalIdentifier(string ExternalIdentifier) { |
|
|
|
this->metadata["ExternalIdentifier"] = ExternalIdentifier; |
|
|
|
} |
|
|
@ -368,15 +374,16 @@ void Bagmetadata::set_BagSize(string BagSize) { |
|
|
|
this->metadata["BagSize"] = BagSize; |
|
|
|
} |
|
|
|
|
|
|
|
void Bagmetadata::set_BagSize( unsigned long int bytes) { |
|
|
|
if (bytes > (1024*1024*1024*1024) ) { |
|
|
|
this->metadata["BagSize"] = to_string (bytes/ (1024*1024*1024*1024)) + " TB"; |
|
|
|
void Bagmetadata::set_BagSize( unsigned long long int bytes) { |
|
|
|
|
|
|
|
if (bytes > (const unsigned long long int) (1024ull*1024*1024*1024) ) { |
|
|
|
this->metadata["BagSize"] = to_string (bytes/ (1024ull*1024*1024*1024)) + " TB"; |
|
|
|
} else if (bytes > (1024*1024*1024) ) { |
|
|
|
this->metadata["BagSize"] = to_string (bytes/ (1024*1024*1024)) + " GB"; |
|
|
|
this->metadata["BagSize"] = to_string (bytes/ (1024ull*1024*1024)) + " GB"; |
|
|
|
} else if (bytes > (1024*1024) ) { |
|
|
|
this->metadata["BagSize"] = to_string (bytes/ (1024*1024)) + " MB"; |
|
|
|
this->metadata["BagSize"] = to_string (bytes/ (1024ull*1024)) + " MB"; |
|
|
|
} else if (bytes > (1024) ) { |
|
|
|
this->metadata["BagSize"] = to_string (bytes/ (1024)) + " kB"; |
|
|
|
this->metadata["BagSize"] = to_string (bytes/ (1024ull)) + " kB"; |
|
|
|
} else { |
|
|
|
this->metadata["BagSize"] = to_string (bytes) + " B"; |
|
|
|
} |
|
|
|