RestLink 2.2.0
Powerfull Rest Client for Qt
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
RestLink::CompressionUtils Class Reference

Provides utility methods for decompressing data using supported compression algorithms. More...

#include <compressionutils.h>

Static Public Member Functions

static QByteArray decompress (const QByteArray &input, const QByteArray &algorithm)
 Decompresses the input data based on the specified compression algorithm.
 
static QList< QByteArray > supportedAlgorithms ()
 Returns a list of supported compression algorithms.
 

Detailed Description

Provides utility methods for decompressing data using supported compression algorithms.

This class supports decompressing data compressed using algorithms like gzip and deflate, leveraging the zlib library when available. It includes methods for decompressing data streams based on the specified algorithm and provides a list of supported algorithms.

Member Function Documentation

◆ decompress()

QByteArray RestLink::CompressionUtils::decompress ( const QByteArray &  input,
const QByteArray &  algorithm 
)
static

Decompresses the input data based on the specified compression algorithm.

The method checks the algorithm parameter and decompresses the data using the corresponding algorithm. If the algorithm is not recognized, the method returns the original input data.

Parameters
inputThe compressed data.
algorithmThe algorithm to use for decompression (e.g., "gzip" or "deflate").
Returns
The decompressed data.

◆ supportedAlgorithms()

QList< QByteArray > RestLink::CompressionUtils::supportedAlgorithms ( )
static

Returns a list of supported compression algorithms.

This method returns a list of compression algorithms that the library can handle, based on the available libraries and the current system configuration.

Returns
A list of supported algorithms as QByteArrays.