upgrade to xpdf 3.00.
[swftools.git] / pdf2swf / xpdf / Parser.h
blob3bc3ab27408755e9f1e662d4a458ee211dc56803
1 //========================================================================
2 //
3 // Parser.h
4 //
5 // Copyright 1996-2003 Glyph & Cog, LLC
6 //
7 //========================================================================
9 #ifndef PARSER_H
10 #define PARSER_H
12 #include <aconf.h>
14 #ifdef USE_GCC_PRAGMAS
15 #pragma interface
16 #endif
18 #include "Lexer.h"
20 //------------------------------------------------------------------------
21 // Parser
22 //------------------------------------------------------------------------
24 class Parser {
25 public:
27 // Constructor.
28 Parser(XRef *xrefA, Lexer *lexerA);
30 // Destructor.
31 ~Parser();
33 // Get the next object from the input stream.
34 #ifndef NO_DECRYPTION
35 Object *getObj(Object *obj,
36 Guchar *fileKey = NULL, int keyLength = 0,
37 int objNum = 0, int objGen = 0);
38 #else
39 Object *getObj(Object *obj);
40 #endif
42 // Get stream.
43 Stream *getStream() { return lexer->getStream(); }
45 // Get current position in file.
46 int getPos() { return lexer->getPos(); }
48 private:
50 XRef *xref; // the xref table for this PDF file
51 Lexer *lexer; // input stream
52 Object buf1, buf2; // next two tokens
53 int inlineImg; // set when inline image data is encountered
55 Stream *makeStream(Object *dict);
56 void shift();
59 #endif