Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

plfilesrc.h

Go to the documentation of this file.
00001 /*
00002 /--------------------------------------------------------------------
00003 |
00004 |      $Id: plfilesrc.h,v 1.1 2004/05/21 21:02:52 maxx Exp $
00005 |
00006 |      Copyright (c) 1996-1998 Ulrich von Zadow
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;    // File handle.
00064   HANDLE m_hm;    // Handle to file-mapping object.
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 |      $Log: plfilesrc.h,v $
00090 |      Revision 1.1  2004/05/21 21:02:52  maxx
00091 |      Initial Version of vuVolume, moderatly changed to make it compile on my windows and linux machine.
00092 |
00093 |      Revision 1.1  2002/11/13 01:58:21  mspindle
00094 |      *** empty log message ***
00095 |
00096 |      Revision 1.3  2001/10/06 22:37:08  uzadow
00097 |      Linux compatibility.
00098 |
00099 |      Revision 1.2  2001/09/16 20:57:17  uzadow
00100 |      Linux version name prefix changes
00101 |
00102 |      Revision 1.1  2001/09/16 19:03:22  uzadow
00103 |      Added global name prefix PL, changed most filenames.
00104 |
00105 |      Revision 1.4  2001/09/13 20:46:45  uzadow
00106 |      Removed 4096-byte limit for fillBuffer that was causing PLPNGEncoder
00107 |      to fail under Linux.
00108 |
00109 |
00110 \--------------------------------------------------------------------
00111 */

Generated on Wed Dec 15 21:20:30 2004 for vuVolume by  doxygen 1.3.9.1