AuroraRuntime/Include/Aurora/Compression/StreamPipeProcessor.hpp

58 lines
1.7 KiB
C++

/***
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: StreamPipeProcessor.hpp
Date: 2021-6-9
Author: Reece
***/
#pragma once
namespace Aurora::IO
{
struct IStreamReader;
struct IStreamWriter;
}
namespace Aurora::Compression
{
struct CompressionPipe
{
/// algorithm
/// LZMA decompression + compression, and ZSTD compression only
AuUInt32 threads {1};
/// consume from stream callback
AuSPtr<Aurora::IO::IStreamReader> pReadPipe;
/// write to stream callback
AuSPtr<Aurora::IO::IStreamWriter> pWritePipe;
/// preemption and reporting
AuFunction<bool(AuUInt, AuUInt)> reportProgress;
};
/**
* @deprecated legacy api / wont remove
*
* This API class is still viable for single-threaded utilities wishing to compress once
* Consider it a utility in addition to the main StreamProcessor class of APIs.
*
* It is still tested and supported as a non-muxable pipe operation w/o the overhead
* (and features of) the io subsystem.
*
*/
AUKN_SYM bool Decompress(const CompressionPipe &stream, const DecompressInfo &parameters);
/**
* @deprecated legacy api / wont remove
*
* This API class is still viable for single-threaded utilities wishing to compress once
* Consider it a utility in addition to the main StreamProcessor class of APIs.
*
* It is still tested and supported as a non-muxable pipe operation w/o the overhead
* (and features of) the io subsystem.
*
*/
AUKN_SYM bool Compress(const CompressionPipe &stream, const CompressionInfo &parameters);
}