]> git.ipfire.org Git - thirdparty/cups.git/blame - pdftops/Parser.h
Merge changes from 1.1.x into 1.2 devel.
[thirdparty/cups.git] / pdftops / Parser.h
CommitLineData
9c72faab 1//========================================================================
2//
3// Parser.h
4//
5// Copyright 1996 Derek B. Noonburg
6//
7//========================================================================
8
9#ifndef PARSER_H
10#define PARSER_H
11
12#ifdef __GNUC__
13#pragma interface
14#endif
15
16#include "Lexer.h"
17
18//------------------------------------------------------------------------
19// Parser
20//------------------------------------------------------------------------
21
22class Parser {
23public:
24
25 // Constructor.
753453e4 26 Parser(XRef *xrefA, Lexer *lexerA);
9c72faab 27
28 // Destructor.
29 ~Parser();
30
31 // Get the next object from the input stream.
52118ca3 32#ifndef NO_DECRYPTION
33 Object *getObj(Object *obj,
753453e4 34 Guchar *fileKey = NULL, int keyLength = 0,
35 int objNum = 0, int objGen = 0);
52118ca3 36#else
9c72faab 37 Object *getObj(Object *obj);
52118ca3 38#endif
9c72faab 39
40 // Get stream.
41 Stream *getStream() { return lexer->getStream(); }
42
43 // Get current position in file.
44 int getPos() { return lexer->getPos(); }
45
46private:
47
753453e4 48 XRef *xref; // the xref table for this PDF file
9c72faab 49 Lexer *lexer; // input stream
50 Object buf1, buf2; // next two tokens
51 int inlineImg; // set when inline image data is encountered
52
53 Stream *makeStream(Object *dict);
54 void shift();
55};
56
57#endif
58