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.

55 lines
2.2 KiB

  1. // Copyright (C) 2018 Andreas Romeyke (art1@andreas-romeyke.de), 2018.
  2. //
  3. // This program is free software: you can redistribute it and/or modify
  4. // it under the terms of the GNU General Public License as published by
  5. // the Free Software Foundation, either version 3 of the License, or
  6. // (at your option) any later version.
  7. //
  8. // This program is distributed in the hope that it will be useful,
  9. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. // GNU General Public License for more details.
  12. //
  13. // You should have received a copy of the GNU General Public License
  14. // along with this program. If not, see <https://www.gnu.org/licenses/>.
  15. #include "tagmanifest.hpp"
  16. #include <iostream>
  17. #include <fstream>
  18. #include <sstream>
  19. #include <boost/filesystem.hpp>
  20. //#include <filesystem> // c++17
  21. //namespace fs = std::filesystem;
  22. namespace fs = boost::filesystem;
  23. using namespace std;
  24. Tagmanifest::Tagmanifest( string basedir ) : Manifest::Manifest (basedir, "tagmanifest-") {
  25. }
  26. multimap<checksum_string_t,filename_t> Tagmanifest::get_checksum_file_pairs(checksum_algorithms alg) {
  27. //log << "DEBUG: begin Tagmanifest::get_checksum_file_pairs" << endl;
  28. multimap<checksum_string_t,filename_t> checksum_file_pairs = Manifest::get_checksum_file_pairs(alg);
  29. //log << "DEBUG: called super->get_checksum_file_pairs" << endl;
  30. for (auto & checksum_file_pair : checksum_file_pairs) {
  31. // log << "DEBUG: TAGMANIFEST found 'data/' in the beginning of file '"<<it->second<<"' in tagmanifest file '"<< this->manifest_algorithm_files[ alg] << endl;
  32. if (checksum_file_pair.second.find( "data/" ) == 0) {
  33. log << "found 'data/' in the beginning of file '"<<checksum_file_pair.second<<"' in tagmanifest file '"<< this->manifest_algorithm_files[ alg] << endl;
  34. }
  35. }
  36. //log << "TAGMANIFEST get_checksum_file_pairs, calling debug()" << endl;
  37. //this->debug();
  38. //log << "TAGMANIFEST get_checksum_file_pairs, finished" << endl;
  39. return checksum_file_pairs;
  40. }
  41. bool Tagmanifest::has_tagmanifest() {
  42. return Manifest::exist_manifest_files;
  43. }
  44. // vim: set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab