00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef INCL_PLFILESRC
00012 #define INCL_PLFILESRC
00013
00014 #ifndef INCL_PLDATASRC
00015 #include "pldatasrc.h"
00016 #endif
00017
00018 #ifdef _WINDOWS
00019 #define PL_FILE_MAPPING
00020 #endif
00021
00022 #include <stdio.h>
00023
00024 class PLIProgressNotification;
00025
00027 class PLFileSource : public PLDataSource
00028 {
00029
00030 public:
00032 PLFileSource
00033 ( PLIProgressNotification * pNotification = NULL
00034 );
00035
00037 virtual ~PLFileSource
00038 ();
00039
00041 virtual int Open
00042 ( const char * pszFName
00043 );
00044
00046 virtual void Close
00047 ();
00048
00049 virtual PLBYTE * ReadNBytes
00050 ( int n
00051 );
00052
00054 virtual PLBYTE * GetBufferPtr
00055 ( int MinBytesInBuffer
00056 );
00057
00058 virtual PLBYTE * ReadEverything
00059 ();
00060
00061 private:
00062 #ifdef PL_FILE_MAPPING
00063 HANDLE m_hf;
00064 HANDLE m_hm;
00065
00066 #else
00067 bool bytesAvailable
00068 ( int n
00069 );
00070
00071 void fillBuffer
00072 ( int n = 4096
00073 );
00074
00075 FILE * m_pFile;
00076 PLBYTE * m_pBuffer;
00077
00078 PLBYTE * m_pReadPos;
00079 int m_BytesReadFromFile;
00080 #endif
00081 PLBYTE * m_pStartData;
00082 PLBYTE * m_pCurPos;
00083 };
00084
00085 #endif
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111