00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef _BUFFERFILTER_H_
00013 #define _BUFFERFILTER_H_
00014
00015 #include <SIBCUtil.h>
00016 #include <SIBCString.h>
00017
00018 #include "CXSIFilter.h"
00019
00020 #define BUFFER_FILTER_NAME "Buffer"
00021 #define BUFFER_FILTER_ID "buf"
00022
00023 #ifdef _PSX2
00024 #define BUFFER_SIZE (32 * 1024)
00025 #else
00026 #define BUFFER_SIZE (128 * 1024)
00027 #endif
00029
00030
00031
00032
00033
00034 class CBufferFilter : public CXSIFilter
00035 {
00036 public:
00040 CBufferFilter();
00044 virtual ~CBufferFilter();
00045
00050 int Open ( CSIBCString in_szFilename, _SI_FILE_MODE in_Mode );
00053 int Close ();
00054
00060 int Read ( SI_Char * out_pBuffer, SI_Long in_lSize );
00066 int Write( SI_Char * in_pBuffer, SI_Long in_lSize );
00067
00068
00072 int Eof();
00076 int Tell();
00077
00078
00079
00080 private:
00081 void Flush();
00082 void FillBuffer();
00083
00084 char *m_pBuffer;
00085 LONG m_lPosition;
00086 SI_Long m_lSizeRead;
00087 bool m_bHeaderSkipped;
00088 };
00089
00090 #endif