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.

41 lines
1.4 KiB

  1. #include "tagmanifest.hpp"
  2. #include <iostream>
  3. #include <fstream>
  4. #include <sstream>
  5. #include <boost/filesystem.hpp>
  6. //#include <filesystem> // c++17
  7. //namespace fs = std::filesystem;
  8. namespace fs = boost::filesystem;
  9. using namespace std;
  10. Tagmanifest::Tagmanifest( string basedir ) : Manifest::Manifest (basedir, "tagmanifest-") {
  11. }
  12. multimap<checksum_string_t,filename_t> Tagmanifest::get_checksum_file_pairs(checksum_algorithms alg) {
  13. //log << "DEBUG: begin Tagmanifest::get_checksum_file_pairs" << endl;
  14. multimap<checksum_string_t,filename_t> checksum_file_pairs = Manifest::get_checksum_file_pairs(alg);
  15. //log << "DEBUG: called super->get_checksum_file_pairs" << endl;
  16. for (auto & checksum_file_pair : checksum_file_pairs) {
  17. // log << "DEBUG: TAGMANIFEST found 'data/' in the beginning of file '"<<it->second<<"' in tagmanifest file '"<< this->manifest_algorithm_files[ alg] << endl;
  18. if (checksum_file_pair.second.find( "data/" ) == 0) {
  19. log << "found 'data/' in the beginning of file '"<<checksum_file_pair.second<<"' in tagmanifest file '"<< this->manifest_algorithm_files[ alg] << endl;
  20. }
  21. }
  22. //log << "TAGMANIFEST get_checksum_file_pairs, calling debug()" << endl;
  23. //this->debug();
  24. //log << "TAGMANIFEST get_checksum_file_pairs, finished" << endl;
  25. return checksum_file_pairs;
  26. }
  27. bool Tagmanifest::has_tagmanifest() {
  28. return Manifest::exist_manifest_files;
  29. }
  30. // vim: set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab