C++ Library to handle BagIt structures. BagIt is a standard format to create transfer packages for digital preservation purposes. See https://en.wikipedia.org/wiki/BagIt for details http://andreas-romeyke.de
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.3 KiB

#include "bag.hpp"
bool Bag::validate() {
bool is_valid = true;
if (this->bagit_version_major != 0) {
is_valid = false;
}
if (this->bagit_version_minor != 97) {
is_valid = false;
}
if (0 != tag_file_character_encoding.compare( "UTF-8" )) {
is_valid = false;
}
if (NULL == this->payload_p) {
is_valid = false;
} else {
bool ret = this->payload_p->validate();
if (ret == false) {
is_valid = false;
}
}
if (NULL == this->payloadmanifest_p) {
is_valid = false;
} else {
bool ret = this->payloadmanifest_p->validate();
if (ret == false) {
is_valid = false;
}
}
// next elements are optional
if (NULL == this->tagmanifest_p) {
} else {
bool ret = this->tagmanifest_p->validate();
if (ret == false) {
is_valid = false;
}
}
if (NULL == this->bagmetadata_p) {
} else {
bool ret = this->bagmetadata_p->validate();
if (ret == false) {
is_valid = false;
}
}
/*
if (NULL == this->fetchfile_p) {
} else {
bool ret = this->fetchfile_p->validate();
if (ret == false) {
is_valid = false;
}
}
if (NULL == this->othertags_p) {
} else {
bool ret = this->othertags_p->validate();
if (ret == false) {
is_valid = false;
}
}
*/
return is_valid;
}
// vim: set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab