beta-0.89.2
[luatex.git] / source / libs / poppler / poppler-src / poppler / Parser.h
blob1ce9445e19d495011150b06f69b480e13d425979
1 //========================================================================
2 //
3 // Parser.h
4 //
5 // Copyright 1996-2003 Glyph & Cog, LLC
6 //
7 //========================================================================
9 //========================================================================
11 // Modified under the Poppler project - http://poppler.freedesktop.org
13 // All changes made under the Poppler project to this file are licensed
14 // under GPL version 2 or later
16 // Copyright (C) 2006, 2010, 2013 Albert Astals Cid <aacid@kde.org>
17 // Copyright (C) 2012 Hib Eris <hib@hiberis.nl>
18 // Copyright (C) 2013 Adrian Johnson <ajohnson@redneon.com>
19 // Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de>
21 // To see a description of the changes please see the Changelog file that
22 // came with your tarball or type make ChangeLog if you are building from git
24 //========================================================================
26 #ifndef PARSER_H
27 #define PARSER_H
29 #ifdef USE_GCC_PRAGMAS
30 #pragma interface
31 #endif
33 #include "Lexer.h"
35 //------------------------------------------------------------------------
36 // Parser
37 //------------------------------------------------------------------------
39 class Parser {
40 public:
42 // Constructor.
43 Parser(XRef *xrefA, Lexer *lexerA, GBool allowStreamsA);
45 // Destructor.
46 ~Parser();
48 // Get the next object from the input stream. If <simpleOnly> is
49 // true, do not parse compound objects (arrays, dictionaries, or
50 // streams).
51 Object *getObj(Object *obj, GBool simpleOnly = gFalse,
52 Guchar *fileKey = NULL,
53 CryptAlgorithm encAlgorithm = cryptRC4, int keyLength = 0,
54 int objNum = 0, int objGen = 0, int recursion = 0,
55 GBool strict = gFalse);
57 Object *getObj(Object *obj, int recursion);
59 // Get stream.
60 Stream *getStream() { return lexer->getStream(); }
62 // Get current position in file.
63 Goffset getPos() { return lexer->getPos(); }
65 private:
67 XRef *xref; // the xref table for this PDF file
68 Lexer *lexer; // input stream
69 GBool allowStreams; // parse stream objects?
70 Object buf1, buf2; // next two tokens
71 int inlineImg; // set when inline image data is encountered
73 Stream *makeStream(Object *dict, Guchar *fileKey,
74 CryptAlgorithm encAlgorithm, int keyLength,
75 int objNum, int objGen, int recursion,
76 GBool strict);
77 void shift(int objNum = -1);
78 void shift(const char *cmdA, int objNum);
81 #endif