7#ifndef PDF_DIFFERENCE_ENCODING_H
8#define PDF_DIFFERENCE_ENCODING_H
10#include "PdfEncodingMap.h"
24 unsigned char Code = 0;
26 char32_t MappedCodePoint = U
'\0';
29 using List = std::vector<Difference>;
30 using iterator = std::vector<Difference>::iterator;
31 using const_iterator = std::vector<Difference>::const_iterator;
66 bool TryGetMappedName(
unsigned char code,
const PdfName*& name)
const;
81 size_t GetCount()
const;
83 const_iterator begin()
const {
return m_differences.begin(); }
85 const_iterator end()
const {
return m_differences.end(); }
91 struct DifferenceComparatorPredicate
94 inline bool operator()(
const Difference&
diff1,
const Difference&
diff2)
const
126 std::unique_ptr<PdfDifferenceEncoding>&
encoding);
142 static char32_t NameToCodePoint(
const std::string_view& name);
165 void buildReverseMap();
170 bool m_reverseMapBuilt;
171 std::unordered_map<char32_t, unsigned char> m_reverseMap;
A memory owning immutable block of code points, optimized for small segments as up to 3 elements can ...
Definition PdfCharCodeMap.h:29
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:108
const PdfDifferenceList & GetDifferences() const
Get read-only access to the object containing the actual differences.
Definition PdfDifferenceEncoding.h:157
A helper class for PdfDifferenceEncoding that can be used to create a differences array.
Definition PdfDifferenceEncoding.h:21
PdfEncodingMap used by encodings like PdfBuiltInEncoding or PdfDifferenceEncoding that can define all...
Definition PdfEncodingMap.h:249
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
@ 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:345
A character code unit.
Definition PdfEncodingCommon.h:20