begin compression module
This commit is contained in:
37
include/sp/extensions/Compress.h
Normal file
37
include/sp/extensions/Compress.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* \file Compression.h
|
||||
* \brief File containing compress utilities
|
||||
*/
|
||||
|
||||
#include <cstdint>
|
||||
#include <sp/common/DataBuffer.h>
|
||||
|
||||
namespace sp {
|
||||
namespace zlib {
|
||||
|
||||
/**
|
||||
* \brief Compress some data
|
||||
* \param buffer the data to compress
|
||||
* \return the compressed data
|
||||
*/
|
||||
DataBuffer Compress(const DataBuffer& buffer);
|
||||
|
||||
/**
|
||||
* \brief Reads the packet lenght and uncompress it
|
||||
* \param buffer the data to uncompress
|
||||
* \return the uncompressed data
|
||||
*/
|
||||
DataBuffer Decompress(DataBuffer& buffer);
|
||||
|
||||
/**
|
||||
* \brief Uncompress some data
|
||||
* \param buffer the data to uncompress
|
||||
* \param packetLength lenght of data
|
||||
* \return the uncompressed data
|
||||
*/
|
||||
DataBuffer Decompress(DataBuffer& buffer, std::uint64_t packetLength);
|
||||
|
||||
} // namespace zlib
|
||||
} // namespace sp
|
||||
Reference in New Issue
Block a user