/// @file zle.hpp
/// Zero length encoding
///
/// @remarks
/// Loco's first attempt to make a compressor for octane
///
/// @author loco
/// @date   2003.08.13
///
///

#ifndef zleH
#define zleH

#include "../compressor.hpp"

/// This is a zero-length-encoder, it performs run-length-encoding for 0 bytes only.
/// 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.
///
/// @ingroup Compressors
///
class zleCompressor : public OctaneCompressor
{
public:
	zleCompressor(bool registerme = false);
	~zleCompressor() {;};

	virtual std::string GetClassName() {return "zle";}
	virtual std::string GetDescription() {return "Zero length encoding";}

	virtual OctaneCompressor *MakeCompressorInstantiation() {return new zleCompressor();};

protected:
	virtual bool DoProtectedCompress(bitreader &s, bitwriter &d);
	virtual bool DoProtectedDecompress(bitreader &s, bitwriter &d);
};

#endif
