PoDoFo  1.0.0-dev
PdfPostScriptTokenizer.h
1 
7 #ifndef PDF_POSTSCRIPT_TOKENIZER_H
8 #define PDF_POSTSCRIPT_TOKENIZER_H
9 
10 #include "PdfTokenizer.h"
11 #include "PdfVariant.h"
12 #include <podofo/auxiliary/InputDevice.h>
13 
14 namespace PoDoFo {
15 
19 {
20  Unknown = 0,
21  Keyword,
22  Variant,
25 };
26 
29 class PODOFO_API PdfPostScriptTokenizer final : private PdfTokenizer
30 {
31 public:
32  PdfPostScriptTokenizer(PdfPostScriptLanguageLevel level = PdfPostScriptLanguageLevel::L2);
33  PdfPostScriptTokenizer(const std::shared_ptr<charbuff>& buffer,
34  PdfPostScriptLanguageLevel level = PdfPostScriptLanguageLevel::L2);
35 public:
36  bool TryReadNext(InputStreamDevice& device, PdfPostScriptTokenType& tokenType, std::string_view& keyword, PdfVariant& variant);
37  void ReadNextVariant(InputStreamDevice& device, PdfVariant& variant);
38  bool TryReadNextVariant(InputStreamDevice& device, PdfVariant& variant);
39 };
40 
41 };
42 
43 #endif // PDF_POSTSCRIPT_TOKENIZER_H
This class represents an input device It optionally supports peeking.
Definition: InputDevice.h:22
This class is a parser for general PostScript content in PDF documents.
Definition: PdfPostScriptTokenizer.h:30
A simple tokenizer for PDF files and PDF content streams.
Definition: PdfTokenizer.h:53
A variant data type which supports all data types supported by the PDF standard.
Definition: PdfVariant.h:33
SPDX-FileCopyrightText: (C) 2022 Francesco Pretto ceztko@gmail.com SPDX-License-Identifier: LGPL-2....
Definition: basetypes.h:16
PdfPostScriptTokenType
An enum describing the type of a read token.
Definition: PdfPostScriptTokenizer.h:19
@ ProcedureEnter
Procedure enter delimiter.
@ Keyword
The token is a PDF keyword.
@ Variant
The token is a PDF variant. A variant is usually a parameter to a keyword.
@ ProcedureExit
Procedure enter delimiter.