00001 // Copyright (C) 2006 Bryan Jacobson <bryanjacobson@users.sourceforge.net> 00002 // This program is licensed under the terms of the GNU General Public License 00003 // version 2, as published by the Free Software Foundation. 00004 // This program is distributed in the hope that it will be useful, 00005 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00006 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00007 00011 00012 #ifndef ONDISK_H 00013 #define ONDISK_H 00014 00015 class OnDisk 00016 { 00017 public: 00018 OnDisk(char *fileName); 00019 void Write(void *p, int byteCount); 00020 void Finalize(); 00021 int GetPos() { return ftell(mpOutputFile); } 00022 int SetPos(int pos) { return fseek(mpOutputFile, pos, SEEK_SET); } 00024 static void *MapFile(char *fileName); 00025 private: 00026 FILE *mpOutputFile; 00027 }; 00028 00029 #endif // ONDISK_H