#include <StringCompressor.h>
Public Member Functions | |
~StringCompressor () | |
void | GenerateTreeFromStrings (unsigned char *input, unsigned inputLength) |
void | EncodeString (char *input, int maxCharsToWrite, RakNet::BitStream *output) |
bool | DecodeString (char *output, int maxCharsToWrite, RakNet::BitStream *input) |
Static Public Member Functions | |
static StringCompressor * | Instance () |
Private Member Functions | |
void | GenerateHuffmanEncodingTree (void) |
StringCompressor () | |
Private Attributes | |
HuffmanEncodingTree * | huffmanEncodingTree |
Static Private Attributes | |
static StringCompressor | instance |
|
Destructor |
|
Default Constructor |
|
Writes input to output, uncompressed. Takes care of the null terminator for you. maxCharsToWrite should be the allocated size of output
|
|
Writes input to output, compressed. Takes care of the null terminator for you
|
|
Create Huffman frequencies Tree used for both encoding and decoding |
|
Given an array of strings, such as a chat log, generate the optimal encoding tree for it. This function is optional and if it is not called a default tree will be used instead.
|
|
static function because only static functions can access static members Singleton pattern
|
|
Huffman frequencies Tree |
|
Singleton instance |