|
|
|
Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members
CVFile.hGo to the documentation of this file.00001 00002 00003 // Written by Michael Ellison 00004 //------------------------------------------------------------------------- 00005 // CodeVis's Free License 00006 // www.codevis.com 00007 // 00008 // Copyright (c) 2003 by Michael Ellison (mike@codevis.com) 00009 // All rights reserved. 00010 // 00011 // You may use this software in source and/or binary form, with or without 00012 // modification, for commercial or non-commercial purposes, provided that 00013 // you comply with the following conditions: 00014 // 00015 // * Redistributions of source code must retain the above copyright notice, 00016 // this list of conditions and the following disclaimer. 00017 // 00018 // * Redistributions of modified source must be clearly marked as modified, 00019 // and due notice must be placed in the modified source indicating the 00020 // type of modification(s) and the name(s) of the person(s) performing 00021 // said modification(s). 00022 // 00023 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00024 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00025 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00026 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 00027 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00028 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 00029 // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00030 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00031 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00032 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00033 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00034 // 00035 //--------------------------------------------------------------------------- 00036 // Modifications: 00037 // 00038 //--------------------------------------------------------------------------- 00050 00051 #ifndef _CVFILE_H_ 00052 #define _CVFILE_H_ 00053 00054 #include <stdio.h> 00055 #include "CVResFile.h" 00056 00057 class CVFile 00058 { 00059 public: 00060 CVFile(); 00061 virtual ~CVFile(); 00062 00071 CVRES OpenForRead ( const char* filename ); 00072 00085 CVRES OpenForReadWrite ( const char* filename ); 00086 00096 CVRES Create ( const char* filename ); 00097 00103 CVRES Close ( ); 00104 00121 CVRES Read ( void* buffer, 00122 unsigned long length, 00123 unsigned long& amountRead); 00124 00137 CVRES ReadLine ( char* buffer, 00138 unsigned long maxLength, 00139 unsigned long& amountRead); 00140 00150 CVRES Write ( const void* buffer, 00151 unsigned long writeLength); 00152 00160 CVRES WriteString ( const char* strBuffer); 00161 00168 CVRES SeekAbs ( unsigned long position); 00169 00173 CVRES SeekEnd ( ); 00174 00180 CVRES GetPos ( unsigned long& position); 00181 00186 CVRES Length ( unsigned long& length); 00187 00188 //---------------------------------------------------- 00189 // Static utility functions 00190 00195 static bool FileExists ( const char* filename); 00196 //---------------------------------------------------- 00197 protected: 00198 FILE* fFilePtr; 00199 }; 00200 00201 #endif // _CVFILE_H_ 00202 |
1.3.3