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

/users/u3/mtikir/PMaCInstrumentor_v1601/include/BinaryFile.h

Go to the documentation of this file.
00001 #ifndef _BinaryFile_h_
00002 #define _BinaryFile_h_
00003 
00004 #include <Base.h>
00005 
00006 class BinaryInputFile {
00007 private:
00008     char*        inBufferPointer;
00009     uint32_t     inBufferSize;
00010     char*        inBuffer;
00011 public:
00012     BinaryInputFile() : inBufferPointer(NULL),inBufferSize(0),inBuffer(NULL) {}
00013     ~BinaryInputFile() {}
00014 
00015     void     readFileInMemory(char* f);
00016 
00017     char*    copyBytes(void* buff,uint32_t bytes);
00018     char*    copyBytesIterate(void* buff,uint32_t bytes);
00019     char*    onlyIterate(uint32_t bytes);
00020     char*    moreBytes();
00021 
00022     char*    fileOffsetToPointer(uint64_t fileOffset);
00023     char*    setInBufferPointer(uint64_t fileOffset);
00024 
00025     char*    isInBuffer(char* f);
00026     char*    setInPointer(char* f);
00027 
00028     char*    inPtrBase() { return inBuffer; }
00029 
00030     uint32_t alreadyRead() { return (uint32_t)(inBufferPointer-inBuffer); }
00031     uint32_t bytesLeftInBuffer();
00032 
00033     uint32_t getSize() { return inBufferSize; }
00034 
00035     uint32_t currentOffset() { return (uint32_t)(inBufferPointer-inBuffer); }
00036 };
00037 
00038 
00039 class BinaryOutputFile {
00040 private:
00041     FILE* outFile;
00042 public:
00043 
00044     BinaryOutputFile() : outFile(NULL) {}
00045     ~BinaryOutputFile() {}
00046 
00047     void open(char* fileName);
00048     bool operator!();
00049     void copyBytes(char* buffer,uint32_t size,uint32_t offset);
00050     uint32_t alreadyWritten();
00051     void close();
00052 };
00053 
00054 #endif

Generated on Mon Jan 28 11:08:31 2008 for PMaCInstrumentor by doxygen 1.3.5