/*
* Copyright (c) 2023 Vaughn Nugent
*
* Library: VNLib
* Package: VNLib.Net.Compression
* File: INativeCompressionLib.cs
*
* INativeCompressionLib.cs is part of VNLib.Net.Compression which is part of
* the larger VNLib collection of libraries and utilities.
*
* VNLib.Net.Compression is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 2 of the License,
* or (at your option) any later version.
*
* VNLib.Net.Compression is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with VNLib.Net.Compression. If not, see http://www.gnu.org/licenses/.
*/
using System;
using System.IO.Compression;
using System.Runtime.InteropServices;
using VNLib.Net.Http;
namespace VNLib.Net.Compression
{
///
/// Represents a native compression library that can create native
/// compressor instances.
///
public interface INativeCompressionLib
{
///
/// Gets the compression methods supported by the underluing library
///
/// The supported compression methods
CompressionMethod GetSupportedMethods();
///
/// Allocates a new implementation that allows for
/// compressing stream data.
///
/// The desired , must be a supported method
/// The desired to compress blocks with
/// The new
///
/// The the level or method are not supported by the underlying library
INativeCompressor AllocCompressor(CompressionMethod method, CompressionLevel level);
///
/// Allocates a safe compressor handle to allow native operations if preferred.
///
///The desired , must be a supported method
/// The desired to compress blocks with
/// A new that holds a pointer to the native compressor context
///
/// The the level or method are not supported by the underlying library
SafeHandle AllocSafeCompressorHandle(CompressionMethod method, CompressionLevel level);
}
}