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
15{
16 Unknown = 0,
17 Keyword,
18 Variant,
21};
22
24class PODOFO_API PdfPostScriptTokenizer final : private PdfTokenizer
25{
26public:
29 PdfPostScriptTokenizer(std::shared_ptr<charbuff> buffer);
30
31 [[deprecated("Use the overloads with PdfTokenizerParams instead")]]
32 PdfPostScriptTokenizer(PdfPostScriptLanguageLevel level);
34 [[deprecated("Use the overloads with PdfTokenizerParams instead")]]
35 PdfPostScriptTokenizer(std::shared_ptr<charbuff> buffer, PdfPostScriptLanguageLevel level);
36public:
37 bool TryReadNext(InputStreamDevice& device, PdfPostScriptTokenType& tokenType, std::string_view& keyword, PdfVariant& variant);
39 void ReadNextVariant(InputStreamDevice& device, PdfVariant& variant);
40 bool TryReadNextVariant(InputStreamDevice& device, PdfVariant& variant);
41
42 using PdfTokenizer::GetParameters;
43 void SetParameters(const PdfTokenizerParams& params);
44private:
46};
47
48};
49
50#endif // PDF_POSTSCRIPT_TOKENIZER_H
This class represents an input device It optionally supports peeking.
Definition InputDevice.h:19
This class is a parser for general PostScript content in PDF documents.
Definition PdfPostScriptTokenizer.h:25
PdfPostScriptTokenizer(std::shared_ptr< charbuff > buffer, PdfPostScriptLanguageLevel level)
A simple tokenizer for PDF files and PDF content streams.
Definition PdfTokenizer.h:47
A variant data type which supports all data types supported by the PDF standard.
Definition PdfVariant.h:29
Convenient type for char array storage and/or buffer with std::string compatibility.
Definition basetypes.h:30
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:15
@ 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 '}'.
Definition PdfTokenizer.h:143