PoDoFo  1.0.0-dev
Public Member Functions | List of all members
PoDoFo::PdfDifferenceList Class Referencefinal

A helper class for PdfDifferenceEncoding that can be used to create a differences array. More...

#include <PdfDifferenceEncoding.h>

Public Member Functions

 PdfDifferenceList ()
 Create a PdfEncodingDifference object.
 
 PdfDifferenceList (const PdfDifferenceList &rhs)=default
 
PdfDifferenceListoperator= (const PdfDifferenceList &rhs)=default
 
void AddDifference (unsigned char code, char32_t codePoint)
 Add a difference to the object. More...
 
void AddDifference (unsigned char code, const PdfName &name, bool explicitNames=false)
 Add a difference to the object. More...
 
bool TryGetMappedName (unsigned char code, const PdfName *&name) const
 Get the mapped code point from a char code. More...
 
bool TryGetMappedName (unsigned char code, const PdfName *&name, char32_t &codePoint) const
 
void ToArray (PdfArray &arr) const
 Convert the PdfEncodingDifference to an array. More...
 
size_t GetCount () const
 Get the number of differences in this object. More...
 
const_iterator begin () const
 
const_iterator end () const
 

Detailed Description

A helper class for PdfDifferenceEncoding that can be used to create a differences array.

Member Function Documentation

◆ AddDifference() [1/2]

void PdfDifferenceList::AddDifference ( unsigned char  code,
char32_t  codePoint 
)

Add a difference to the object.

Parameters
nCodeunicode code point of the difference (0 to 255 are legal values)
unicodeValueactual unicode value for nCode; can be 0
See also
AddDifference if you know the name of the code point use the overload below which is faster

◆ AddDifference() [2/2]

void PdfDifferenceList::AddDifference ( unsigned char  code,
const PdfName name,
bool  explicitNames = false 
)

Add a difference to the object.

Parameters
nameunicode code point of the difference (0 to 255 are legal values)
namename of the different code point or .notdef if none
explicitNamesif true, the unicode value is set to nCode as name is meaningless (Type3 fonts)

◆ GetCount()

size_t PdfDifferenceList::GetCount ( ) const

Get the number of differences in this object.

If the user added .notdef as a difference it is counted, even it is no real difference in the final encoding.

Returns
the number of differences in this object

◆ ToArray()

void PdfDifferenceList::ToArray ( PdfArray arr) const

Convert the PdfEncodingDifference to an array.

Parameters
arrwrite to this array

◆ TryGetMappedName()

bool PdfDifferenceList::TryGetMappedName ( unsigned char  code,
const PdfName *&  name 
) const

Get the mapped code point from a char code.

Parameters
codetest if the given code is part of the differences
codePointwrite the associated unicode value of the name to this value
Returns
true if the code is part of the difference

The documentation for this class was generated from the following files: