upgrade to xpdf 3.00.
[swftools.git] / pdf2swf / xpdf / FoFiBase.h
1 //========================================================================
2 //
3 // FoFiBase.h
4 //
5 // Copyright 1999-2003 Glyph & Cog, LLC
6 //
7 //========================================================================
8
9 #ifndef FOFIBASE_H
10 #define FOFIBASE_H
11
12 #include <aconf.h>
13
14 #ifdef USE_GCC_PRAGMAS
15 #pragma interface
16 #endif
17
18 #include "gtypes.h"
19
20 //------------------------------------------------------------------------
21
22 typedef void (*FoFiOutputFunc)(void *stream, char *data, int len);
23
24 //------------------------------------------------------------------------
25 // FoFiBase
26 //------------------------------------------------------------------------
27
28 class FoFiBase {
29 public:
30
31   virtual ~FoFiBase();
32
33 protected:
34
35   FoFiBase(char *fileA, int lenA, GBool freeFileDataA);
36   static char *readFile(char *fileName, int *fileLen);
37
38   // S = signed / U = unsigned
39   // 8/16/32/Var = word length, in bytes
40   // BE = big endian
41   int getS8(int pos, GBool *ok);
42   int getU8(int pos, GBool *ok);
43   int getS16BE(int pos, GBool *ok);
44   int getU16BE(int pos, GBool *ok);
45   int getS32BE(int pos, GBool *ok);
46   Guint getU32BE(int pos, GBool *ok);
47   Guint getUVarBE(int pos, int size, GBool *ok);
48
49   GBool checkRegion(int pos, int size);
50
51   Guchar *fileData;
52   Guchar *file;
53   int len;
54   GBool freeFileData;
55 };
56
57 #endif