clockUtils  1.1
clockUtils::compression::algorithm::HuffmanGeneric Class Reference

class for Huffman compression using a dictionary generated out of the given string has always an overhead of 256 Bytes because of the header More...

#include <HuffmanGeneric.h>

Inheritance diagram for clockUtils::compression::algorithm::HuffmanGeneric:
Inheritance graph

Static Public Member Functions

static ClockError compress (const std::string &uncompressed, std::string &compressed)
 compresses the given string and returns result More...
 
static ClockError decompress (const std::string &compressed, std::string &decompressed)
 decompresses the given string and returns result More...
 

Additional Inherited Members

- Protected Types inherited from clockUtils::compression::algorithm::HuffmanBase
typedef uint32_t len_t
 type that should be used as the 'length' counter This controls the size of the header, the maximum string length etc. More...
 
- Static Protected Member Functions inherited from clockUtils::compression::algorithm::HuffmanBase
static std::shared_ptr< NodebuildTree (const std::vector< uint8_t > &header)
 creates a Huffman tree with given list of probabilities header must have size 256 and values have to be between 0 and 255 (unsigned char) if a value is zero no node is inserted into the tree and this value isn't accessible More...
 
static void generateMapping (const std::shared_ptr< Node > &node, const std::vector< bool > &bitSeq, std::vector< std::vector< bool >> &mapping)
 constructs a mapping from character to a bit sequence More...
 
static ClockError getChar (const std::string &compressed, const std::shared_ptr< Node > &root, len_t length, std::string &result)
 converts bit sequence to the real character More...
 

Detailed Description

class for Huffman compression using a dictionary generated out of the given string has always an overhead of 256 Bytes because of the header

Definition at line 38 of file HuffmanGeneric.h.

Member Function Documentation

§ compress()

static ClockError clockUtils::compression::algorithm::HuffmanGeneric::compress ( const std::string &  uncompressed,
std::string &  compressed 
)
static

compresses the given string and returns result

§ decompress()

static ClockError clockUtils::compression::algorithm::HuffmanGeneric::decompress ( const std::string &  compressed,
std::string &  decompressed 
)
static

decompresses the given string and returns result


The documentation for this class was generated from the following file: