00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef _WordDBCompress_h_
00014 #define _WordDBCompress_h_
00015
00016 #include "WordDBCompress.h"
00017
00018 #include "db.h"
00019
00020 class WordMonitor;
00021 class WordDBEncoded;
00022 class WordContext;
00023
00024 class WordDBCompress
00025 {
00026 public:
00027 WordDBCompress(WordContext* ncontext);
00028 ~WordDBCompress();
00029
00030
00031
00032
00033 int Compress(const unsigned char* inbuff, int inbuff_length, unsigned char** outbuffp, int* outbuff_lengthp);
00034 int Uncompress(const unsigned char* inbuff, int inbuff_length, unsigned char* outbuff, int outbuff_length);
00035
00036 int CompressBtree(const unsigned char* inbuff, int inbuff_length, unsigned char* outbuff, int* outbuff_lengthp);
00037 int CompressIBtree(const unsigned char* inbuff, int inbuff_length, unsigned char* outbuff, int* outbuff_lengthp);
00038 int CompressLBtree(const unsigned char* inbuff, int inbuff_length, unsigned char* outbuff, int* outbuff_lengthp);
00039
00040 int UncompressBtree(const unsigned char* inbuff, int inbuff_length, unsigned char* outbuff, int outbuff_length);
00041 int UncompressIBtree(const unsigned char* inbuff, int inbuff_length, unsigned char* outbuff, int outbuff_length);
00042 int UncompressLBtree(const unsigned char* inbuff, int inbuff_length, unsigned char* outbuff, int outbuff_length);
00043
00044
00045
00046
00047
00048 DB_CMPR_INFO *CmprInfo();
00049
00050
00051
00052
00053
00054 inline WordContext* GetContext() { return context; }
00055
00056
00057
00058
00059 void DumpPage(const unsigned char* page) const;
00060 int DiffPage(const unsigned char* first, const unsigned char* second) const;
00061
00062 private:
00063 DB_CMPR_INFO *cmprInfo;
00064 WordContext *context;
00065 WordDBEncoded *encoded;
00066
00067 int verbose;
00068 int debug;
00069 };
00070
00071 #endif