/src/xpdf-4.03/xpdf/Parser.h
Line | Count | Source (jump to first uncovered line) |
1 | | //======================================================================== |
2 | | // |
3 | | // Parser.h |
4 | | // |
5 | | // Copyright 1996-2003 Glyph & Cog, LLC |
6 | | // |
7 | | //======================================================================== |
8 | | |
9 | | #ifndef PARSER_H |
10 | | #define PARSER_H |
11 | | |
12 | | #include <aconf.h> |
13 | | |
14 | | #ifdef USE_GCC_PRAGMAS |
15 | | #pragma interface |
16 | | #endif |
17 | | |
18 | | #include "Lexer.h" |
19 | | |
20 | | //------------------------------------------------------------------------ |
21 | | // Parser |
22 | | //------------------------------------------------------------------------ |
23 | | |
24 | | class Parser { |
25 | | public: |
26 | | |
27 | | // Constructor. |
28 | | Parser(XRef *xrefA, Lexer *lexerA, GBool allowStreamsA); |
29 | | |
30 | | // Destructor. |
31 | | ~Parser(); |
32 | | |
33 | | // Get the next object from the input stream. If <simpleOnly> is |
34 | | // true, do not parse compound objects (arrays, dictionaries, or |
35 | | // streams). |
36 | | Object *getObj(Object *obj, GBool simpleOnly = gFalse, |
37 | | Guchar *fileKey = NULL, |
38 | | CryptAlgorithm encAlgorithm = cryptRC4, int keyLength = 0, |
39 | | int objNum = 0, int objGen = 0, int recursion = 0); |
40 | | |
41 | | // Get stream index (for arrays of streams). |
42 | 0 | int getStreamIndex() { return lexer->getStreamIndex(); } |
43 | | |
44 | | // Get stream. |
45 | 0 | Stream *getStream() { return lexer->getStream(); } |
46 | | |
47 | | // Get current position in file. |
48 | 398k | GFileOffset getPos() { return lexer->getPos(); } |
49 | | |
50 | | private: |
51 | | |
52 | | XRef *xref; // the xref table for this PDF file |
53 | | Lexer *lexer; // input stream |
54 | | GBool allowStreams; // parse stream objects? |
55 | | Object buf1, buf2; // next two tokens |
56 | | int inlineImg; // set when inline image data is encountered |
57 | | |
58 | | Stream *makeStream(Object *dict, Guchar *fileKey, |
59 | | CryptAlgorithm encAlgorithm, int keyLength, |
60 | | int objNum, int objGen, int recursion); |
61 | | void shift(); |
62 | | }; |
63 | | |
64 | | #endif |
65 | | |