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.

64 lines
2.1 KiB

  1. #pragma once
  2. #include "ZipUtilityInterface.h"
  3. #include "ZipFileFunctionInternalCallback.generated.h"
  4. /**
  5. * This is used to provide a callback for unzipping single files, it ends up getting called from the ListFiles lambda.
  6. */
  7. UCLASS(ClassGroup = ZipUtility)
  8. class ZIPUTILITY_API UZipFileFunctionInternalCallback : public UObject, public IZipUtilityInterface
  9. {
  10. GENERATED_BODY()
  11. private:
  12. /** Compression format used to unzip */
  13. UPROPERTY(Transient)
  14. TEnumAsByte<ZipUtilityCompressionFormat> CompressionFormat;
  15. /** Path of the file */
  16. UPROPERTY(Transient)
  17. FString File;
  18. UPROPERTY(Transient)
  19. FString DestinationFolder;
  20. /** Current File index parsed */
  21. UPROPERTY(Transient)
  22. int32 FileIndex = 0;
  23. /** Callback object */
  24. UPROPERTY(Transient)
  25. UObject* Callback;
  26. UPROPERTY(Transient)
  27. bool bSingleFile;
  28. UPROPERTY(Transient)
  29. bool bFileFound;
  30. UPROPERTY(Transient)
  31. bool bUnzipto;
  32. public:
  33. UZipFileFunctionInternalCallback();
  34. //IZipUtilityInterface overrides
  35. virtual void OnProgress_Implementation(const FString& archive, float percentage, int32 bytes) override {};
  36. virtual void OnDone_Implementation(const FString& archive, EZipUtilityCompletionState CompletionState) override {};
  37. virtual void OnStartProcess_Implementation(const FString& archive, int32 bytes) override {};
  38. virtual void OnFileDone_Implementation(const FString& archive, const FString& file) override {
  39. UE_LOG(LogTemp, Log, TEXT("OnFileDone_Implementation"));
  40. };
  41. virtual void OnFileFound_Implementation(const FString& archive, const FString& fileIn, int32 size) override;
  42. void SetCallback(const FString& FileName, UObject* CallbackIn, TEnumAsByte<ZipUtilityCompressionFormat> CompressionFormatIn = ZipUtilityCompressionFormat::COMPRESSION_FORMAT_UNKNOWN);
  43. void SetCallback(const FString& FileName, const FString& DestinationFolder, UObject* CallbackIn, TEnumAsByte<ZipUtilityCompressionFormat> CompressionFormatIn = ZipUtilityCompressionFormat::COMPRESSION_FORMAT_UNKNOWN);
  44. FORCEINLINE bool GetSingleFile() const { return bSingleFile; }
  45. FORCEINLINE void SetSingleFile(bool val) { bSingleFile = val; }
  46. };