PoDoFo 0.7.0
Public Member Functions | Protected Member Functions | Protected Attributes
PoDoFo::PdfSimpleEncoding Class Reference

#include <PdfEncoding.h>

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

List of all members.

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

Protected Member Functions

virtual const PdfNameGetID () const
virtual const pdf_utf16be * GetToUnicodeTable () const =0

Protected Attributes

Util::PdfMutex * m_mutex
 Mutex for the creation of the encoding table.

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.

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

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

Parameters:
anunicode 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.

Implements 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.

Implements 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 [inline, protected, virtual]

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 [protected, pure 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::PdfDocEncoding, PoDoFo::PdfWinAnsiEncoding, PoDoFo::PdfMacRomanEncoding, PoDoFo::PdfStandardEncoding, PoDoFo::PdfSymbolEncoding, and PoDoFo::PdfZapfDingbatsEncoding.

bool PoDoFo::PdfSimpleEncoding::IsAutoDelete ( ) const [inline, virtual]

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 [inline, virtual]
Returns:
true if this is a single byte encoding with a maximum of 256 values.

Implements PoDoFo::PdfEncoding.