Octane v1.01.20 - The Open Compression Toolkit for C++ | http://octane.sourceforge.net/ |
#include <zle.hpp>
Inheritance diagram for zleCompressor:
Any contiguous string of 0 bytes up to 255 characters long will be replaced by a 0 byte followed by counter signifying the length of the string of 0s.
Definition at line 22 of file zle.hpp.
Public Member Functions | |
zleCompressor (bool registerme=false) | |
virtual std::string | GetClassName () |
Get the assigned name of an instantiated compressor. | |
virtual std::string | GetDescription () |
optionally provide a longer (maybe 20-60 characters) description | |
virtual OctaneCompressor * | MakeCompressorInstantiation () |
Instantiate a compressor from this class (like a factory). | |
Protected Member Functions | |
virtual bool | DoProtectedCompress (bitreader &s, bitwriter &d) |
This is the member function which does the actual compression, and this is the function that should be subclasses by derived classes. | |
virtual bool | DoProtectedDecompress (bitreader &s, bitwriter &d) |
This is the member function which does the actual decompression, and this is the function that should be subclasses by derived classes. |
|
optionally provide a longer (maybe 20-60 characters) description
Reimplemented from OctaneCompressor. Definition at line 29 of file zle.hpp.
00029 {return "Zero length encoding";} |
|
This is the member function which does the actual compression, and this is the function that should be subclasses by derived classes. It is wrapped by the public API call Compress() which performs some measurements on compression speed and streamsize.
Implements OctaneCompressor. Definition at line 25 of file zle.cpp. References bitreader::empty(), bitreader::get_byte(), bitwriter::put_byte(), and bitreader::seek_byte().
00026 { 00027 while (!s.empty()) 00028 { 00029 unsigned char b = s.get_byte(); 00030 unsigned char c; 00031 d.put_byte(b); 00032 00033 if (!b) 00034 { 00035 for (c= 0; c < 255; c++) 00036 { 00037 if (s.empty()) break; 00038 if (s.get_byte()) 00039 { 00040 s.seek_byte(-1, ios::cur); 00041 break; 00042 } 00043 } 00044 d.put_byte(c); 00045 } 00046 } 00047 return true; 00048 } |
|
This is the member function which does the actual decompression, and this is the function that should be subclasses by derived classes. It is wrapped by the public API call Decompress() which performs some measurements on decompression speed and streamsize.
Implements OctaneCompressor. Definition at line 50 of file zle.cpp. References bitreader::empty(), bitreader::get_byte(), and bitwriter::put_byte().
|