e-CryptIt Engine - Compression Xojo Plugin |
|
EinhugurZstandard.DecompressTask Method
Sets up a decompression task for native Thread execution
This function can raise the following exceptions:
When running the task returned by this function then the following exception can be thrown:

DecompressTask(
overwrite
as Boolean)
as EinhugurRuntime.Task
Parameters
- overwrite
- If set to true then destination will be replaced if it exists. If set to false and destination exists then exception will be thrown.
Returns
- EinhugurRuntime.Task
- The compression task.
Remarks
Both source and destination must be file based. As native thread cannot talk to Xojo objects which would be needed to talk to the Stream interfaces.
If source or destination is not File in a FolderItem then exception will be thrown.
Warning: If your TypeLib plugin is not version 11.2 or later then you will get crash if setting up native task like this.
var fileExtension as new FileType
fileExtension.Name = "Zstandard"
fileExtension.Extensions = EinhugurZstandard.FileExtension
var source as FolderItem = FolderItem.ShowOpenFileDialog(ftTmp)
if source <> nil then
var dest as FolderItem = source.Parent.Child(source.Name.TrimRight("." + EinhugurZstandard.FileExtension))
if dest <> nil then
try
var cstd as new EinhugurZstandard(source, dest)
cstd.SetProgressHandler(AddressOf OnProgress)
var task as EinhugurRuntime.Task = cstd.DecompressTask()
task.WaitFor()
catch e as InvalidArgumentException
MessageBox("IOException: " + e.Message)
catch e as InvalidArgumentException
MessageBox("InvalidArgumentException: " + e.Message)
end try
end if
end if
See Also
EinhugurZstandard Class