Bringing apdf from vendor into main branch.
[AROS-Contrib.git] / apdf / xpdf / Parser.h
blobf35d17b173d30d59858de822bd5eb1a87ef5f4f0
1 //========================================================================
2 //
3 // Parser.h
4 //
5 // Copyright 1996-2003 Glyph & Cog, LLC
6 //
7 //========================================================================
8 //
9 // EL (01/2000): added the 'cutObj' parameter, to help handling
10 // linearized files.
12 #ifndef PARSER_H
13 #define PARSER_H
15 #include <aconf.h>
17 #ifdef USE_GCC_PRAGMAS
18 #pragma interface
19 #endif
21 #include "Lexer.h"
23 //------------------------------------------------------------------------
24 // Parser
25 //------------------------------------------------------------------------
27 class Parser {
28 public:
30 // Constructor.
31 Parser(XRef *xrefA, Lexer *lexerA, GBool cutObj = gFalse);
33 // Destructor.
34 ~Parser();
36 // Get the next object from the input stream.
37 Object *getObj(Object *obj,
38 Guchar *fileKey = NULL, int keyLength = 0,
39 int objNum = 0, int objGen = 0);
41 // Get stream.
42 Stream *getStream() { return lexer->getStream(); }
44 // Get current position in file.
45 int getPos() { return lexer->getPos(); }
47 private:
49 XRef *xref; // the xref table for this PDF file
50 Lexer *lexer; // input stream
51 Object buf1, buf2; // next two tokens
52 int inlineImg; // set when inline image data is encountered
54 Stream *makeStream(Object *dict);
55 void shift();
56 GBool cutObj;
59 #endif