00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef FOFIBASE_H
00010 #define FOFIBASE_H
00011
00012 #include <aconf.h>
00013
00014 #ifdef USE_GCC_PRAGMAS
00015 #pragma interface
00016 #endif
00017
00018 #include "gtypes.h"
00019
00020
00021
00022 typedef void (*FoFiOutputFunc)(void *stream, char *data, int len);
00023
00024
00025
00026
00027
00028 class FoFiBase {
00029 public:
00030
00031 virtual ~FoFiBase();
00032
00033 protected:
00034
00035 FoFiBase(char *fileA, int lenA, GBool freeFileDataA);
00036 static char *readFile(char *fileName, int *fileLen);
00037
00038
00039
00040
00041 int getS8(int pos, GBool *ok);
00042 int getU8(int pos, GBool *ok);
00043 int getS16BE(int pos, GBool *ok);
00044 int getU16BE(int pos, GBool *ok);
00045 int getS32BE(int pos, GBool *ok);
00046 Guint getU32BE(int pos, GBool *ok);
00047 Guint getUVarBE(int pos, int size, GBool *ok);
00048
00049 GBool checkRegion(int pos, int size);
00050
00051 Guchar *fileData;
00052 Guchar *file;
00053 int len;
00054 GBool freeFileData;
00055 };
00056
00057 #endif