1
0

unlha.h 865 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * unlha.h
  3. * -------
  4. * Purpose: Header file for .lha 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. #ifdef MPT_WITH_LHASA
  13. typedef struct _LHAInputStream LHAInputStream;
  14. typedef struct _LHAReader LHAReader;
  15. typedef struct _LHAFileHeader LHAFileHeader;
  16. #endif // MPT_WITH_LHASA
  17. OPENMPT_NAMESPACE_BEGIN
  18. #ifdef MPT_WITH_LHASA
  19. class CLhaArchive : public ArchiveBase
  20. {
  21. private:
  22. LHAInputStream *inputstream;
  23. LHAReader *reader;
  24. LHAFileHeader *firstfile;
  25. void OpenArchive();
  26. void CloseArchive();
  27. public:
  28. CLhaArchive(FileReader &file);
  29. virtual ~CLhaArchive();
  30. public:
  31. bool ExtractFile(std::size_t index) override;
  32. };
  33. #endif // MPT_WITH_LHASA
  34. OPENMPT_NAMESPACE_END