crawlserv++  [under development]
Application for crawling and analyzing textual content of websites.
crawlservpp::Data::Compression::Gzip Namespace Reference

Namespace for compressing and decompressing gzip. More...

Compression and Decompression

std::string compress (const std::string &content)
 Compresses content using gzip. More...
 
std::string decompress (const std::string &compressedContent)
 Decompresses gzip-compressed content. More...
 

Constant

constexpr auto compressionLevel {9}
 The compression level used when compressing with gzip. More...
 

Detailed Description

Namespace for compressing and decompressing gzip.

Function Documentation

◆ compress()

std::string crawlservpp::Data::Compression::Gzip::compress ( const std::string &  content)
inline

Compresses content using gzip.

Note
The string will be compressed via copying it into a string stream, therefore a string view is not feasible.
Parameters
contentA const reference to the content to be compressed.
Returns
The gzip-compressed content as copied string or an empty string if the given content is empty.

References compressionLevel.

Referenced by crawlservpp::Main::WebServer::send(), and crawlservpp::Main::Server::tick().

◆ decompress()

std::string crawlservpp::Data::Compression::Gzip::decompress ( const std::string &  compressedContent)
inline

Decompresses gzip-compressed content.

Note
The string will be decompressed via copying it into a string stream, therefore a string view is not feasible.
Parameters
compressedContentA const reference to the gzip-compressed content to be decompressed.
Returns
The decompressed content as copied string or an empty string if the given content is empty.

Referenced by crawlservpp::Main::WebServer::getIP(), crawlservpp::Main::Server::tick(), and crawlservpp::Network::Curl::writerInClass().

Variable Documentation

◆ compressionLevel

constexpr auto crawlservpp::Data::Compression::Gzip::compressionLevel {9}
inline

The compression level used when compressing with gzip.

Referenced by compress().