7#ifndef PDF_DIFFERENCE_ENCODING_H
8#define PDF_DIFFERENCE_ENCODING_H
10#include "PdfEncodingMap.h"
16struct CodePointMapNode;
18struct PODOFO_API PdfDifferenceMapping final
21 unsigned char Code = 0;
22 CodePointSpan CodePoints;
32 using const_iterator = std::vector<PdfDifferenceMapping>::const_iterator;
60 void AddDifference(
unsigned char code,
const codepointview&
codePoints);
84 unsigned GetCount()
const;
86 const_iterator begin()
const {
return m_differences.begin(); }
88 const_iterator end()
const {
return m_differences.end(); }
94 void AddDifference(
unsigned char code,
const std::string_view&
name);
98 struct DifferenceComparatorPredicate
101 bool operator()(
const PdfDifferenceMapping&
diff1,
const PdfDifferenceMapping&
diff2)
const
107 using DifferenceList = std::vector<PdfDifferenceMapping>;
110 DifferenceList m_differences;
140 std::unique_ptr<PdfDifferenceEncoding>&
encoding);
173 bool tryGetNextCharCode(std::string_view::iterator&
it,
180 void buildReverseMap();
A memory owning immutable block of code points, optimized for small segments as up to 3 elements can ...
Definition PdfEncodingCommon.h:141
This class represents a PdfArray Use it for all arrays that are written to a PDF file.
Definition PdfArray.h:81
PdfDifferenceEncoding is an encoding, which is based on either the fonts encoding or a predefined enc...
Definition PdfDifferenceEncoding.h:118
const PdfDifferenceMap & GetDifferences() const
Get read-only access to the object containing the actual differences.
Definition PdfDifferenceEncoding.h:165
static bool TryGetCodePointsFromCharName(const std::string_view &name, CodePointSpan &codepoints)
Try to convert a standard character name to a unicode code points.
A helper class for PdfDifferenceEncoding that can be used to create a differences array.
Definition PdfDifferenceEncoding.h:29
PdfEncodingMap used by legacy encodings like PdfBuiltInEncoding or PdfDifferenceEncoding that can def...
Definition PdfEncodingMap.h:254
A PdfEncodingMap is a low level interface to convert between utf8 and encoded strings in and to deter...
Definition PdfEncodingMap.h:32
This abstract class provides access to font metrics information.
Definition PdfFontMetrics.h:36
A list of PdfObjects that constitutes the indirect object list of the document The PdfParser will rea...
Definition PdfIndirectObjectList.h:30
This class represents a PdfName.
Definition PdfName.h:24
This class represents a PDF indirect Object in memory.
Definition PdfObject.h:35
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
cspan< char32_t > unicodeview
Unicode code point view.
Definition basetypes.h:27
@ Name
Name datatype. Names are used as keys in dictionary to reference values.
std::shared_ptr< const PdfEncodingMap > PdfEncodingMapConstPtr
Convenience typedef for a const /Encoding map entry shared ptr.
Definition PdfEncodingMap.h:355
A character code unit.
Definition PdfEncodingCommon.h:20