/src/xpdf-4.05/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 | | #include "Lexer.h" |
15 | | |
16 | | //------------------------------------------------------------------------ |
17 | | // Parser |
18 | | //------------------------------------------------------------------------ |
19 | | |
20 | | class Parser { |
21 | | public: |
22 | | |
23 | | // Constructor. |
24 | | Parser(XRef *xrefA, Lexer *lexerA, GBool allowStreamsA); |
25 | | |
26 | | // Destructor. |
27 | | ~Parser(); |
28 | | |
29 | | // Get the next object from the input stream. If <simpleOnly> is |
30 | | // true, do not parse compound objects (arrays, dictionaries, or |
31 | | // streams). |
32 | | Object *getObj(Object *obj, GBool simpleOnly = gFalse, |
33 | | Guchar *fileKey = NULL, |
34 | | CryptAlgorithm encAlgorithm = cryptRC4, int keyLength = 0, |
35 | | int objNum = 0, int objGen = 0, int recursion = 0); |
36 | | |
37 | | // Get stream index (for arrays of streams). |
38 | 0 | int getStreamIndex() { return lexer->getStreamIndex(); } |
39 | | |
40 | | // Get stream. |
41 | 0 | Stream *getStream() { return lexer->getStream(); } |
42 | | |
43 | | // Get current position in file. |
44 | 14.6M | GFileOffset getPos() { return lexer->getPos(); } |
45 | | |
46 | | private: |
47 | | |
48 | | XRef *xref; // the xref table for this PDF file |
49 | | Lexer *lexer; // input stream |
50 | | GBool allowStreams; // parse stream objects? |
51 | | Object buf1, buf2; // next two tokens |
52 | | int inlineImg; // set when inline image data is encountered |
53 | | |
54 | | Stream *makeStream(Object *dict, Guchar *fileKey, |
55 | | CryptAlgorithm encAlgorithm, int keyLength, |
56 | | int objNum, int objGen, int recursion); |
57 | | void shift(); |
58 | | }; |
59 | | |
60 | | #endif |
61 | | |