Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

memfile.h

Go to the documentation of this file.
00001 /* 00002 * memfile.h 00003 * 00004 * WAV file I/O channel class. 00005 * 00006 * Portable Windows Library 00007 * 00008 * Copyright (c) 2002 Equivalence Pty. Ltd. 00009 * 00010 * The contents of this file are subject to the Mozilla Public License 00011 * Version 1.0 (the "License"); you may not use this file except in 00012 * compliance with the License. You may obtain a copy of the License at 00013 * http://www.mozilla.org/MPL/ 00014 * 00015 * Software distributed under the License is distributed on an "AS IS" 00016 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 00017 * the License for the specific language governing rights and limitations 00018 * under the License. 00019 * 00020 * The Original Code is Portable Windows Library. 00021 * 00022 * The Initial Developer of the Original Code is 00023 * Equivalence Pty Ltd 00024 * 00025 * All Rights Reserved. 00026 * 00027 * Contributor(s): ______________________________________. 00028 * 00029 * $Log: memfile.h,v $ 00030 * Revision 1.4 2002/09/16 01:08:59 robertj 00031 * Added #define so can select if #pragma interface/implementation is used on 00032 * platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan. 00033 * 00034 * Revision 1.3 2002/08/05 05:40:45 robertj 00035 * Fixed missing pragma interface/implementation 00036 * 00037 * Revision 1.2 2002/06/27 03:53:35 robertj 00038 * Cleaned up documentation and added Compare() function. 00039 * 00040 * Revision 1.1 2002/06/26 09:01:19 craigs 00041 * Initial version 00042 * 00043 */ 00044 00045 #ifndef _PMEMFILE 00046 #define _PMEMFILE 00047 00048 #ifdef P_USE_PRAGMA 00049 #pragma interface 00050 #endif 00051 00052 00055 class PMemoryFile : public PFile 00056 { 00057 PCLASSINFO(PMemoryFile, PFile); 00058 public: 00063 PMemoryFile(); 00064 00067 PMemoryFile( 00068 const PBYTEArray & data 00069 ); 00071 00072 00081 Comparison Compare( 00082 const PObject & obj 00083 ) const; 00085 00086 00100 virtual BOOL Read( 00101 void * buf, 00102 PINDEX len 00103 ); 00104 00114 virtual BOOL Write( 00115 const void * buf, 00116 PINDEX len 00117 ); 00119 00120 00129 off_t GetLength() const; 00130 00137 BOOL SetLength( 00138 off_t len // New length of file. 00139 ); 00140 00151 BOOL SetPosition( 00152 off_t pos, 00153 FilePositionOrigin origin = Start 00154 ); 00155 00162 off_t GetPosition() const; 00164 00165 00170 const PBYTEArray & GetData() const { return data; } 00172 00173 00174 protected: 00175 PBYTEArray data; 00176 off_t position; 00177 }; 00178 00179 00180 #endif // _PMEMFILE 00181 00182 00183 // End of File /////////////////////////////////////////////////////////////// 00184

Generated on Sat Jul 24 15:35:56 2004 for PWLib by doxygen 1.3.7