A modded EditSaber for making beat saber maps.
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.

43 lines
1.8 KiB

  1. #pragma once
  2. #include <vector>
  3. #include <atlbase.h>
  4. #include "SevenZipLibrary.h"
  5. #include "SevenZipArchive.h"
  6. #include "FileInfo.h"
  7. #include "CompressionFormat.h"
  8. #include "CompressionLevel.h"
  9. #include "ProgressCallback.h"
  10. namespace SevenZip
  11. {
  12. class SevenZipCompressor : public SevenZipArchive
  13. {
  14. public:
  15. SevenZipCompressor( const SevenZipLibrary& library, const TString& archivePath );
  16. virtual ~SevenZipCompressor();
  17. // Includes the last directory as the root in the archive, e.g. specifying "C:\Temp\MyFolder"
  18. // makes "MyFolder" the single root item in archive with the files within it included.
  19. virtual bool CompressDirectory( const TString& directory, ProgressCallback* callback, bool includeSubdirs = true);
  20. // Excludes the last directory as the root in the archive, its contents are at root instead. E.g.
  21. // specifying "C:\Temp\MyFolder" make the files in "MyFolder" the root items in the archive.
  22. virtual bool CompressFiles( const TString& directory, const TString& searchFilter, ProgressCallback* callback, bool includeSubdirs = true );
  23. virtual bool CompressAllFiles( const TString& directory, ProgressCallback* callback, bool includeSubdirs = true );
  24. // Compress just this single file as the root item in the archive.
  25. virtual bool CompressFile( const TString& filePath, ProgressCallback* callback);
  26. private:
  27. TString m_outputPath; //the final compression result compression path. Used for tracking in callbacks
  28. CComPtr< IStream > OpenArchiveStream();
  29. bool FindAndCompressFiles( const TString& directory, const TString& searchPattern,
  30. const TString& pathPrefix, bool recursion, ProgressCallback* callback);
  31. bool CompressFilesToArchive(const TString& pathPrefix, const std::vector< intl::FilePathInfo >& filePaths, ProgressCallback* callback);
  32. bool SetCompressionProperties( IUnknown* outArchive );
  33. };
  34. }