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

parsers/parser_bitlevel/bitparser.hpp

Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 //---------------------------------------------------------------------------
00016 
00017 //---------------------------------------------------------------------------
00018 // recursive header protection
00019 #ifndef BitParserH
00020 #define BitParserH
00021 //---------------------------------------------------------------------------
00022 
00023 //---------------------------------------------------------------------------
00024 // application includes
00025 #include "../parser.hpp"
00026 #include "../../bitio/bitio.hpp"
00027 // system includes
00028 using namespace std;
00029 //---------------------------------------------------------------------------
00030 
00031 
00032 
00033 
00034 
00035 
00036 //---------------------------------------------------------------------------
00041 class BitParser : public OctaneParser
00042 {
00043 protected:
00045         int Parameter_bitlength;
00046 protected:
00049         bool senteos;
00050 public:
00051         //---------------------------------------------------------------------------
00053         BitParser() {bitlength=1;};
00055         ~BitParser() {;};
00056         //---------------------------------------------------------------------------
00057 public:
00058         //---------------------------------------------------------------------------
00059         // PARSER PUBLIC API - PREPARATIONS FOR PARSING
00060         virtual bool CreateSymbolSetUsingStream(bitreader &from) {return true;};
00061         virtual bool IsReadyToParse() {return true;};
00062         virtual bool RewindAnyBufferedInput(bitreader &from) {return true;};
00063         //---------------------------------------------------------------------------
00064 public:
00065         //---------------------------------------------------------------------------
00066         // PARSER PUBLIC API - MAIN PARSING FUNCTIONS
00067         virtual void SynchronizeStateForNewStream();
00068         virtual int GetSymbolCount() {return 256;};
00069         virtual bool ParseNextSymbolFromInput(bitreader &from, int &symbolnum);
00070         virtual bool WriteSymbolText(bitwriter &to, int symbolnum,bool &isendofstreamsymbol);
00071         virtual string LookupSymbolText(int symbolnum);
00072         //---------------------------------------------------------------------------
00073 public:
00074         //---------------------------------------------------------------------------
00075         // OCTANE PUBLIC API - AUXILIARY FUNCTIONS - these are supported by all derived classes
00076         virtual void ShowDebuggingInfo() {;};
00077         virtual unsigned int GetMemoryUsed() {return (unsigned int)(sizeof(this));};
00078         virtual unsigned int GetDiskspaceUsed(bool fortempdecompressiononly) {return (unsigned int)0;};
00079         virtual std::string GetParametersInformation() {return "";};
00080         virtual void SetDefaultParameters() {;};
00081         virtual bool SetParameter(const std::string &parametername,const std::string &parametervalue) {return false;};
00082         virtual bool SaveState(bitwriter &to,bool fortempdecompressiononly) {return true;};
00083         virtual bool LoadState(bitreader &from) {return true;};
00084         //---------------------------------------------------------------------------
00085 };
00086 //---------------------------------------------------------------------------
00087 
00088 
00089 
00090 
00091 
00092 //---------------------------------------------------------------------------
00093 #endif
00094 //---------------------------------------------------------------------------
00095 
 
Generated on 20 May 2004 by doxygen 1.3.3