Octane v1.01.20 - The Open Compression Toolkit for C++ http://octane.sourceforge.net/
Homepage | Main | Modules | Class Hierarchy | Compound List | File List | Compound Members | Related Pages

core/octaneclass.hpp

Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 //---------------------------------------------------------------------------
00011 
00012 //---------------------------------------------------------------------------
00013 // recursive header protection
00014 #ifndef OctaneClassH
00015 #define OctaneClassH
00016 //---------------------------------------------------------------------------
00017 
00018 //---------------------------------------------------------------------------
00019 // application includes
00020 #include "../bitio/bitio.hpp"
00021 // system includes
00022 #include <string>
00023 // ATTN: note the old .h include - we only need this for bcc compilation
00024 #include <stdlib.h>
00025 //---------------------------------------------------------------------------
00026 
00027 //---------------------------------------------------------------------------
00032 class OctaneClass
00033 {
00034 public:
00035         //---------------------------------------------------------------------------
00037         OctaneClass() {;};
00039         virtual ~OctaneClass() {;};
00040         //---------------------------------------------------------------------------
00041 public:
00042         //---------------------------------------------------------------------------
00043         // OCTANE PUBLIC API - RTTI AND HELP FUNCTIONS - these are supported by all derived classes
00046         virtual std::string GetName() {return "OctaneClass";}
00049         virtual std::string GetDescription() {return "Base Octane Class";}
00052         virtual std::string GetHelpInformation() { return ""; }
00053         //---------------------------------------------------------------------------
00054 public:
00055         //---------------------------------------------------------------------------
00056         // OCTANE PUBLIC API - AUXILIARY FUNCTIONS - these are supported by all derived classes
00058         virtual void ShowDebuggingInfo() {;};
00060         virtual unsigned int GetMemoryUsed() {return sizeof(this);};
00062         virtual unsigned int GetDiskspaceUsed(bool fortempdecompressiononly) {return 0;};
00064         virtual std::string GetParametersInformation() {return "";};
00066         virtual void SetDefaultParameters() {;};
00070         virtual bool SetParameter(const std::string &parametername,const std::string &parametervalue) {return false;};
00073         virtual bool SaveState(bitwriter &to,bool fortempdecompressiononly) {return DoProtectedSaveState(to,fortempdecompressiononly);};
00076         virtual bool LoadState(bitreader &from) {return DoProtectedLoadState(from);};
00077         //---------------------------------------------------------------------------
00078 public:
00079         //---------------------------------------------------------------------------
00080         // OCTANE INTERNAL - STATIC HELPER FUNCTIONS - some general purpose helper functions for derived classes
00082         static void NiceifyHighAsciiString(std::string &str);
00084         static std::string PrefixNonEmptyString(const std::string headerstr, const std::string str);
00085         //---------------------------------------------------------------------------
00086 protected:
00087         //---------------------------------------------------------------------------
00088         // OCTANE INTERNAL - STATIC PARAMETER HANDLING FUNCTIONS - some general purpose helper functions for derived classes
00089         // parameter setting helpers, for use by derived classes for use in parsing parameter values from SetParameter() method
00092         static bool ParseParameter(const std::string &parametervalue,unsigned int &param) {param=(unsigned int)(atoi(parametervalue.c_str()));return true;}
00095         static bool ParseParameter(const std::string &parametervalue,int &param) {param=(int)(atoi(parametervalue.c_str()));return true;}
00098         static bool ParseParameter(const std::string &parametervalue,unsigned char &param) {param=(unsigned char)(atoi(parametervalue.c_str()));return true;}
00101         static bool ParseParameter(const std::string &parametervalue,char &param) {param=(char)(atoi(parametervalue.c_str()));return true;}
00104         static bool ParseParameter(const std::string &parametervalue,bool &param);
00105         //---------------------------------------------------------------------------
00106 protected:
00107         //---------------------------------------------------------------------------
00108         // OCTANE PROTECTED DERIVED STATE LOADING AND SAVING
00109         // These are the functions that should be implemented in derived classes
00112         virtual bool DoProtectedSaveState(bitwriter &to,bool fortempdecompressiononly) {return true;};
00115         virtual bool DoProtectedLoadState(bitreader &from) {return true;};
00116         //---------------------------------------------------------------------------
00117 };
00118 //---------------------------------------------------------------------------
00119 
00120 
00121 
00122 
00123 
00124 
00125 
00126 
00127 
00128 
00129 
00130 
00131 
00132 
00133 //---------------------------------------------------------------------------
00134 #endif
00135 //---------------------------------------------------------------------------
00136 
 
Generated on 20 May 2004 by doxygen 1.3.3