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
1.7 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. #ifndef LIBCBAG
  16. #define LIBCBAG
  17. #include <string>
  18. #include <sstream>
  19. #include "manifest.hpp"
  20. #include "payload.hpp"
  21. #include "payloadmanifest.hpp"
  22. #include "tagmanifest.hpp"
  23. #include "bagmetadata.hpp"
  24. #include "fetchfile.hpp"
  25. #include "othertags.hpp"
  26. using namespace std;
  27. class Bag {
  28. private:
  29. string base_dir; // from where the bag was loaded, optional
  30. stringstream log;
  31. int bagit_version_major;
  32. int bagit_version_minor;
  33. string tag_file_character_encoding;
  34. class Payload *payload_p;
  35. class Payloadmanifest *payloadmanifest_p;
  36. // next elements are optional
  37. class Tagmanifest *tagmanifest_p;
  38. class Bagmetadata *bagmetadata_p;
  39. class Fetchfile *fetchfile_p{};
  40. class Othertags *othertags_p{};
  41. public:
  42. Bag();
  43. Bag(string dfname);
  44. list<string> get_all_bag_files();
  45. bool store( string basedir);
  46. bool validate();
  47. void get_logstream( stringstream & log);
  48. void reset_logstream();
  49. };
  50. #endif
  51. // vim: set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab