PoDoFo 1.0.0-dev
Loading...
Searching...
No Matches
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
14namespace PoDoFo {
15
19{
20 Unknown = 0,
21 Keyword,
22 Variant,
25};
26
29class PODOFO_API PdfPostScriptTokenizer final : private PdfTokenizer
30{
31public:
32 PdfPostScriptTokenizer(PdfPostScriptLanguageLevel level = PdfPostScriptLanguageLevel::L2);
36 PdfPostScriptTokenizer(const std::shared_ptr<charbuff>& buffer,
37 PdfPostScriptLanguageLevel level = PdfPostScriptLanguageLevel::L2);
38public:
39 bool TryReadNext(InputStreamDevice& device, PdfPostScriptTokenType& tokenType, std::string_view& keyword, PdfVariant& variant);
40 void ReadNextVariant(InputStreamDevice& device, PdfVariant& variant);
41 bool TryReadNextVariant(InputStreamDevice& device, PdfVariant& variant);
42};
43
44};
45
46#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
PdfPostScriptTokenizer(const std::shared_ptr< charbuff > &buffer, PdfPostScriptLanguageLevel level=PdfPostScriptLanguageLevel::L2)
A simple tokenizer for PDF files and PDF content streams.
Definition PdfTokenizer.h:36
A variant data type which supports all data types supported by the PDF standard.
Definition PdfVariant.h:33
Convenient type for char array storage and/or buffer with std::string compatibility.
Definition basetypes.h:38
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.