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
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

34 строки
1.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 "bag.hpp"
  16. using namespace std;
  17. #include <iostream>
  18. #include <string>
  19. int main(int argc, const char *argv[]) {
  20. if (argc != 2) {
  21. cout << "you need at least one argument (a bagit dir)" << endl;
  22. exit(-1);
  23. }
  24. const string dir = argv[1];
  25. Bag bag( dir );
  26. bool is_valid = bag.validate();
  27. cout << "The bag '"<< dir <<"' is " << (is_valid ? "valid" : "invalid") << endl;
  28. return 0;
  29. }
  30. // vim: set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab