Files
BeatLanguageMapper/Plugins/ZipUtility-ue4/Source/ZipUtility/Private/ZipFileFunctionInternalCallback.cpp
squeaksies 7b6050b843 Mk2Rev1
various bugfixes and such.
also bookmarks, temp song loaderm and undo overhaul with near complete multiplayer, but menu items disabled. i really wish i could split this into multiple commits, but i don't know how to work unreal.
2018-11-07 18:00:46 -08:00

51 lines
1.5 KiB
C++

#include "ZipUtilityPrivatePCH.h"
#include "ZipFileFunctionInternalCallback.h"
UZipFileFunctionInternalCallback::UZipFileFunctionInternalCallback()
{
CompressionFormat = ZipUtilityCompressionFormat::COMPRESSION_FORMAT_UNKNOWN;
DestinationFolder = FString();
File = FString();
FileIndex = 0;
Callback = NULL;
}
void UZipFileFunctionInternalCallback::OnFileFound_Implementation(const FString& archive, const FString& fileIn, int32 size)
{
if (!bFileFound && fileIn.ToLower().Contains(File.ToLower()))
{
TArray<int32> FileIndices = { FileIndex };
if (bUnzipto)
{
UZipFileFunctionLibrary::UnzipFilesTo(FileIndices, archive, DestinationFolder, Callback, CompressionFormat);
}
else
{
UZipFileFunctionLibrary::UnzipFiles(FileIndices, archive, Callback, CompressionFormat);
}
if (bSingleFile)
{
bFileFound = true;
}
}
FileIndex++;
}
void UZipFileFunctionInternalCallback::SetCallback(const FString& FileName, UObject* CallbackIn, TEnumAsByte<ZipUtilityCompressionFormat> CompressionFormatIn /*= ZipUtilityCompressionFormat::COMPRESSION_FORMAT_UNKNOWN*/)
{
File = FileName;
Callback = CallbackIn;
CompressionFormat = CompressionFormatIn;
FileIndex = 0;
}
void UZipFileFunctionInternalCallback::SetCallback(const FString& FileName, const FString& DestinationFolderIn, UObject* CallbackIn, TEnumAsByte<ZipUtilityCompressionFormat> CompressionFormatIn /*= ZipUtilityCompressionFormat::COMPRESSION_FORMAT_UNKNOWN*/)
{
SetCallback(FileName, CallbackIn, CompressionFormatIn);
bUnzipto = true;
DestinationFolder = DestinationFolderIn;
}