pdfmm 0.9.20
Public Member Functions | List of all members
mm::PdfEncodingDifference Class Reference

#include <PdfDifferenceEncoding.h>

Public Member Functions

 PdfEncodingDifference ()
 
 PdfEncodingDifference (const PdfEncodingDifference &rhs)
 
const PdfEncodingDifferenceoperator= (const PdfEncodingDifference &rhs)
 
void AddDifference (unsigned char code, char32_t codePoint)
 
void AddDifference (unsigned char code, char32_t codePoint, const PdfName &name, bool explicitNames=false)
 
bool Contains (unsigned char code, PdfName &name, char32_t &codePoint) const
 
void ToArray (PdfArray &arr) const
 
size_t GetCount () const
 

Detailed Description

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

Constructor & Destructor Documentation

◆ PdfEncodingDifference() [1/2]

PdfEncodingDifference::PdfEncodingDifference ( )

Create a PdfEncodingDifference object.

◆ PdfEncodingDifference() [2/2]

PdfEncodingDifference::PdfEncodingDifference ( const PdfEncodingDifference rhs)

Copy a PdfEncodingDifference object.

Member Function Documentation

◆ AddDifference() [1/2]

void PdfEncodingDifference::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 PdfEncodingDifference::AddDifference ( unsigned char  code,
char32_t  codePoint,
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)
codePointactual unicode value for nCode; can be 0
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)

◆ Contains()

bool PdfEncodingDifference::Contains ( unsigned char  code,
PdfName name,
char32_t &  codePoint 
) const

Tests if the specified code is part of the differences.

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

◆ GetCount()

size_t PdfEncodingDifference::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

◆ operator=()

const PdfEncodingDifference & PdfEncodingDifference::operator= ( const PdfEncodingDifference rhs)

Copy a PdfEncodingDifference object.

◆ ToArray()

void PdfEncodingDifference::ToArray ( PdfArray arr) const

Convert the PdfEncodingDifference to an array

Parameters
arrwrite to this array