00001
00002
00012
00013
00014 #ifndef _BINFILTER_H_
00015 #define _BINFILTER_H_
00016
00017 #include <SIBCUtil.h>
00018 #include <SIBCString.h>
00019
00020 #include "CXSIFilter.h"
00021
00022 #define BIN_FILTER_NAME "Binary"
00023 #define BIN_FILTER_ID "bin"
00024 #define GROW_BUFFER_MULTIPLIER 0.1f
00025 #define GROW_BUFFER_BYTE_AMOUNT 14
00026
00032 class CBINFilter : public CXSIFilter
00033 {
00034 public:
00038 CBINFilter( bool in_bLegacy );
00041 virtual ~CBINFilter();
00042
00048 int Open ( CSIBCString in_szFilename, _SI_FILE_MODE in_Mode );
00052 int Close ();
00053
00059 int Read ( SI_Char * out_pBuffer, SI_Long in_lSize );
00065 int Write( SI_Char * in_pBuffer, SI_Long in_lSize );
00066
00067
00072 int Eof();
00076 int Tell();
00077
00078
00079 private:
00080 void ReadBlock();
00081
00082 void AdjustBuffer( SI_Long in_lSize );
00083
00084 SI_UByte * m_pBytes;
00085 SI_UByte * m_pCompressedBuffer;
00086 SI_Long m_lCompressedBufferSize;
00087 SI_Long m_lPosition, m_lSize;
00088 bool m_bLegacy;
00089 bool m_bEof;
00090 };
00091
00092 #endif