Browse Source

- added 1.0 support

master
art1pirat 9 months ago
parent
commit
5da41e5db1
1 changed files with 9 additions and 7 deletions
  1. +9
    -7
      src/lib/bag.cpp

+ 9
- 7
src/lib/bag.cpp View File

@@ -183,13 +183,15 @@ bool Bag::store() {
}

bool Bag::validate() {
bool is_valid = true;
if (this->bagit_version_major != 0) {
this->log << "Bagit major version 0 is expected, but got: " << to_string(this->bagit_version_major) << endl;
is_valid = false;
}
if (this->bagit_version_minor != 97) {
this->log << "Bagit minor version 97 is expected, but got: " << to_string(this->bagit_version_minor) << endl;
bool is_valid = true;
if (
!(
((this->bagit_version_major == 0) && (this->bagit_version_minor ==97)) ||
((this->bagit_version_major == 1) && (this->bagit_version_minor == 0))
)
) {
this->log << "Bagit version 0.97 or 1.0 is expected, but got: "
<< to_string(this->bagit_version_major) << to_string(this->bagit_version_minor) << endl;
is_valid = false;
}
if (0 != tag_file_character_encoding.compare( "UTF-8" )) {


Loading…
Cancel
Save