PoDoFo  0.9.4
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PoDoFo::PdfSimpleEncoding Class Referenceabstract

#include <PdfEncoding.h>

Inheritance diagram for PoDoFo::PdfSimpleEncoding:
PoDoFo::PdfEncoding PoDoFo::PdfDocEncoding PoDoFo::PdfMacRomanEncoding PoDoFo::PdfStandardEncoding PoDoFo::PdfSymbolEncoding PoDoFo::PdfWinAnsiEncoding PoDoFo::PdfZapfDingbatsEncoding PoDoFo::PdfIso88592Encoding PoDoFo::PdfWin1250Encoding

Public Member Functions

virtual void AddToDictionary (PdfDictionary &rDictionary) const
 
virtual PdfString ConvertToUnicode (const PdfString &rEncodedString, const PdfFont *pFont) const
 
virtual PdfRefCountedBuffer ConvertToEncoding (const PdfString &rString, const PdfFont *pFont) const
 
virtual bool IsAutoDelete () const
 
virtual bool IsSingleByteEncoding () const
 
const PdfNameGetName () const
 
virtual pdf_utf16be GetCharCode (int nIndex) const
 
- Public Member Functions inherited from PoDoFo::PdfEncoding
bool operator== (const PdfEncoding &rhs) const
 
bool operator< (const PdfEncoding &rhs) const
 
int GetFirstChar () const
 
int GetLastChar () const
 
const_iterator begin () const
 
const_iterator end () const
 

Protected Member Functions

virtual const PdfNameGetID () const
 
virtual const pdf_utf16be * GetToUnicodeTable () const =0
 
- Protected Member Functions inherited from PoDoFo::PdfEncoding
 PdfEncoding (int nFirstChar, int nLastChar, PdfObject *=NULL)
 

Protected Attributes

Util::PdfMutex * m_mutex
 Mutex for the creation of the encoding table.
 
- Protected Attributes inherited from PoDoFo::PdfEncoding
bool m_bToUnicodeIsLoaded
 If true, ToUnicode has been parse.
 

Detailed Description

A common base class for standard PdfEncoding which are known by name.

See also
PdfWinAnsiEncoding
PdfMacRomanEncoding
PdfMacExportEncoding ..
PdfStandardEncoding
PdfSymbolEncoding
PdfZapfDingbatsEncoding

Member Function Documentation

void PoDoFo::PdfSimpleEncoding::AddToDictionary ( PdfDictionary rDictionary) const
virtual

Add this encoding object to a dictionary usually be adding an /Encoding key in font dictionaries.

Parameters
rDictionaryadd the encoding to this dictionary

Implements PoDoFo::PdfEncoding.

Reimplemented in PoDoFo::PdfWinAnsiEncoding.

PdfRefCountedBuffer PoDoFo::PdfSimpleEncoding::ConvertToEncoding ( const PdfString rString,
const PdfFont pFont 
) const
virtual

Convert a unicode PdfString to a string encoded with this encoding.

Parameters
rStringan unicode PdfString.
pFontthe font for which this string is converted
Returns
an encoded PdfRefCountedBuffer. The PdfRefCountedBuffer is treated as a series of bytes and is allowed to have 0 bytes. The returned buffer must not be a unicode string.

Reimplemented from PoDoFo::PdfEncoding.

PdfString PoDoFo::PdfSimpleEncoding::ConvertToUnicode ( const PdfString rEncodedString,
const PdfFont pFont 
) const
virtual

Convert a string that is encoded with this encoding to an unicode PdfString.

Parameters
rEncodedStringa string encoded by this encoding. Usually this string was read from a content stream.
pFontthe font for which this string is converted
Returns
an unicode PdfString.

Reimplemented from PoDoFo::PdfEncoding.

pdf_utf16be PoDoFo::PdfSimpleEncoding::GetCharCode ( int  nIndex) const
virtual

Get the unicode character code for this encoding at the position nIndex. nIndex is a position between GetFirstChar() and GetLastChar()

Parameters
nIndexcharacter code at position index
Returns
unicode character code
See also
GetFirstChar
GetLastChar

Will throw an exception if nIndex is out of range.

Implements PoDoFo::PdfEncoding.

const PdfName & PoDoFo::PdfSimpleEncoding::GetID ( ) const
inlineprotectedvirtual

Get a unique ID for this encoding which can used for comparisons!

Returns
a unique id for this encoding!

Implements PoDoFo::PdfEncoding.

const PdfName & PoDoFo::PdfSimpleEncoding::GetName ( ) const
inline

Get the name of this encoding.

Returns
the name of this encoding.
virtual const pdf_utf16be* PoDoFo::PdfSimpleEncoding::GetToUnicodeTable ( ) const
protectedpure virtual

Gets a table of 256 short values which are the big endian unicode code points that are assigned to the 256 values of this encoding.

This table is used internally to convert an encoded string of this encoding to and from unicode.

Returns
an array of 256 big endian unicode code points

Implemented in PoDoFo::PdfIso88592Encoding, PoDoFo::PdfWin1250Encoding, PoDoFo::PdfZapfDingbatsEncoding, PoDoFo::PdfSymbolEncoding, PoDoFo::PdfStandardEncoding, PoDoFo::PdfMacRomanEncoding, PoDoFo::PdfWinAnsiEncoding, and PoDoFo::PdfDocEncoding.

bool PoDoFo::PdfSimpleEncoding::IsAutoDelete ( ) const
inlinevirtual

PdfSimpleEncoding subclasses are usuylla not auto-deleted, as they are allocated statically only once.

Returns
true if this encoding should be deleted automatically with the font.
See also
PdfFont::WinAnsiEncoding
PdfFont::MacRomanEncoding

Implements PoDoFo::PdfEncoding.

bool PoDoFo::PdfSimpleEncoding::IsSingleByteEncoding ( ) const
inlinevirtual
Returns
true if this is a single byte encoding with a maximum of 256 values.

Implements PoDoFo::PdfEncoding.