1
0

unrar.h 769 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * unrar.h
  3. * -------
  4. * Purpose: Header file for .rar loader
  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 "archive.h"
  12. OPENMPT_NAMESPACE_BEGIN
  13. #ifdef MPT_WITH_UNRAR
  14. class CRarArchive
  15. : public ArchiveBase
  16. {
  17. protected:
  18. std::unique_ptr<OnDiskFileWrapper> diskFile;
  19. bool captureCurrentFile = false;
  20. public:
  21. CRarArchive(FileReader &file);
  22. ~CRarArchive() override;
  23. bool ExtractFile(std::size_t index) override;
  24. public:
  25. void RARCallbackProcessData(const char * data, std::size_t size);
  26. private:
  27. void Reset();
  28. void ResetFile();
  29. };
  30. #endif // MPT_WITH_UNRAR
  31. OPENMPT_NAMESPACE_END