BufferFilter.h

Go to the documentation of this file.
00001 //***************************************************************************************
00002 // File supervisor: Crosswalk team
00012 //***************************************************************************************
00013 
00014 #ifndef _BUFFERFILTER_H_
00015 #define _BUFFERFILTER_H_
00016 
00017 #include <SIBCUtil.h>
00018 #include <SIBCString.h>
00019 
00020 #include "CXSIFilter.h"
00021 
00022 #define BUFFER_FILTER_NAME  "Buffer"
00023 #define BUFFER_FILTER_ID        "buf"
00024 
00025 #ifdef  _PSX2
00026 #define BUFFER_SIZE             (32 * 1024)
00027 #else
00028 #define BUFFER_SIZE             (128 * 1024)
00029 #endif
00030 
00036 class CBufferFilter : public CXSIFilter
00037 {
00038 public:
00041     CBufferFilter();
00044     virtual ~CBufferFilter();
00045 
00051     int Open ( CSIBCString in_szFilename,  _SI_FILE_MODE in_Mode );
00055     int Close ();
00056 
00062     int Read ( SI_Char * out_pBuffer, SI_Long in_lSize );
00068     int Write( SI_Char * in_pBuffer,  SI_Long in_lSize );
00069 
00070 
00075     int Eof();
00079     int Tell();
00080 
00081 
00082 
00083 private:
00084     void    Flush();
00085     void    FillBuffer();
00086 
00087     char    *m_pBuffer;
00088     LONG    m_lPosition;
00089     SI_Long m_lSizeRead;
00090     bool    m_bHeaderSkipped;
00091 };
00092 
00093 #endif