1
0

Container.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Container.h
  3. * -----------
  4. * Purpose: General interface for MDO container and/or packers.
  5. * Notes : (currently none)
  6. * Authors: OpenMPT Devs
  7. * The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
  8. */
  9. #pragma once
  10. #include "openmpt/all/BuildSettings.hpp"
  11. #include "../common/FileReader.h"
  12. #include <vector>
  13. OPENMPT_NAMESPACE_BEGIN
  14. struct ContainerItem
  15. {
  16. mpt::ustring name;
  17. FileReader file;
  18. std::unique_ptr<std::vector<char> > data_cache; // may be empty
  19. };
  20. enum ContainerLoadingFlags
  21. {
  22. ContainerOnlyVerifyHeader = 0x00,
  23. ContainerUnwrapData = 0x01,
  24. };
  25. #if !defined(MPT_WITH_ANCIENT)
  26. bool UnpackXPK(std::vector<ContainerItem> &containerItems, FileReader &file, ContainerLoadingFlags loadFlags);
  27. bool UnpackPP20(std::vector<ContainerItem> &containerItems, FileReader &file, ContainerLoadingFlags loadFlags);
  28. bool UnpackMMCMP(std::vector<ContainerItem> &containerItems, FileReader &file, ContainerLoadingFlags loadFlags);
  29. #endif // !MPT_WITH_ANCIENT
  30. bool UnpackUMX(std::vector<ContainerItem> &containerItems, FileReader &file, ContainerLoadingFlags loadFlags);
  31. OPENMPT_NAMESPACE_END