PoDoFo 1.2.0
Loading...
Searching...
No Matches
PdfPostScriptTokenizer.h
1// SPDX-FileCopyrightText: 2021 Francesco Pretto <ceztko@gmail.com>
2// SPDX-License-Identifier: LGPL-2.0-or-later OR MPL-2.0
3
4#ifndef PDF_POSTSCRIPT_TOKENIZER_H
5#define PDF_POSTSCRIPT_TOKENIZER_H
6
7#include "PdfTokenizer.h"
8#include "PdfVariant.h"
9#include <podofo/auxiliary/InputDevice.h>
10
11namespace PoDoFo {
12
16{
17 Unknown = 0,
18 Keyword,
19 Variant,
22};
23
26class PODOFO_API PdfPostScriptTokenizer final : private PdfTokenizer
27{
28public:
29 PdfPostScriptTokenizer(PdfPostScriptLanguageLevel level = PdfPostScriptLanguageLevel::L2);
33 PdfPostScriptTokenizer(std::shared_ptr<charbuff> buffer,
34 PdfPostScriptLanguageLevel level = PdfPostScriptLanguageLevel::L2);
35public:
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:20
This class is a parser for general PostScript content in PDF documents.
Definition PdfPostScriptTokenizer.h:27
PdfPostScriptTokenizer(std::shared_ptr< charbuff > buffer, PdfPostScriptLanguageLevel level=PdfPostScriptLanguageLevel::L2)
A simple tokenizer for PDF files and PDF content streams.
Definition PdfTokenizer.h:34
A variant data type which supports all data types supported by the PDF standard.
Definition PdfVariant.h:31
Convenient type for char array storage and/or buffer with std::string compatibility.
Definition basetypes.h:35
All classes, functions, types and enums of PoDoFo are members of these namespace.
Definition basetypes.h:13
PdfPostScriptTokenType
An enum describing the type of a read token.
Definition PdfPostScriptTokenizer.h:16
@ 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 '}'.