Octane v1.01.20 - The Open Compression Toolkit for C++ | http://octane.sourceforge.net/ |
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 //--------------------------------------------------------------------------- 00013 00014 //--------------------------------------------------------------------------- 00015 // recursive header protection 00016 #ifndef SampleCompressorH 00017 #define SampleCompressorH 00018 //--------------------------------------------------------------------------- 00019 00020 //--------------------------------------------------------------------------- 00021 // application includes 00022 #include "../compressor.hpp" 00023 //--------------------------------------------------------------------------- 00024 00025 00026 00027 //--------------------------------------------------------------------------- 00034 class SampleCompressor : public OctaneCompressor 00035 { 00036 protected: 00038 unsigned char Parameter_xorbyte; 00039 public: 00041 SampleCompressor(bool registerme=false); 00043 ~SampleCompressor() {;}; 00044 public: 00045 //--------------------------------------------------------------------------- 00046 // OCTANE PUBLIC API - RTTI AND HELP FUNCTIONS - these are supported by all derived classes 00047 virtual std::string GetClassName() {return "Sample";} 00048 virtual std::string GetDescription() {return "Sample Compressor";} 00049 //--------------------------------------------------------------------------- 00050 public: 00051 //--------------------------------------------------------------------------- 00052 // COMPRESSOR PUBLIC API - FACTORY FUNCTION / MAKE AN INSTANTIATION OF DERIVED COMPRESSOR 00053 virtual OctaneCompressor *MakeCompressorInstantiation() {return new SampleCompressor();}; 00054 //--------------------------------------------------------------------------- 00055 public: 00056 //--------------------------------------------------------------------------- 00057 // OCTANE PUBLIC API - AUXILIARY FUNCTIONS - these are supported by all derived classes 00058 virtual void ShowDebuggingInfo(); 00059 virtual unsigned int GetMemoryUsed(); 00060 virtual unsigned int GetDiskspaceUsed(bool fortempdecompressiononly); 00061 virtual std::string GetParametersInformation(); 00062 virtual void SetDefaultParameters(); 00063 virtual bool SetParameter(const std::string ¶metername,const std::string ¶metervalue); 00064 //--------------------------------------------------------------------------- 00065 public: 00066 //--------------------------------------------------------------------------- 00067 // COMPRESSOR PUBLIC API - PREPARATION FOR COMPRESSING/DECOMPRESSING 00068 virtual bool IsReadyToCompress(); 00069 //--------------------------------------------------------------------------- 00070 protected: 00071 //--------------------------------------------------------------------------- 00072 // COMPRESSOR DERIVED COMPRESSION/DECOMPRESSING - implement these in derived classes 00073 virtual bool DoProtectedCompress(bitreader &from, bitwriter &to); 00074 virtual bool DoProtectedDecompress(bitreader &from, bitwriter &to); 00075 //--------------------------------------------------------------------------- 00076 protected: 00077 //--------------------------------------------------------------------------- 00078 // OCTANE PROTECTED DERIVED STATE LOADING AND SAVING 00079 virtual bool DoProtectedCreateSymbolsAndModelsUsingStream(bitreader &from); 00080 virtual bool DoProtectedSaveState(bitwriter &to,bool fortempdecompressiononly); 00081 virtual bool DoProtectedLoadState(bitreader &from); 00082 //--------------------------------------------------------------------------- 00083 }; 00084 //--------------------------------------------------------------------------- 00085 00086 00087 00088 00089 00090 00091 //--------------------------------------------------------------------------- 00092 #endif 00093 //---------------------------------------------------------------------------