cheshirekow  v0.1.0
fontconfig::CharSetDelegate Class Reference

An CharSet is an abstract type that holds the set of encoded Unicode chars in a font. Operations to build and compare these sets are provided. More...

#include <cpp_fontconfig/CharSet.h>

Public Member Functions

bool addChar (Char32_t ucs4)
 Add a character to a charset. More...
 
Char32_t count () const
 Count entries in a charset. More...
 
RefPtr< CharSetcreateUnion (const RefPtr< CharSet > &other)
 Add charsets. More...
 
bool delChar (Char32_t ucs4)
 Remove a character from a charset. More...
 
bool equal (const RefPtr< CharSet > &other) const
 Compare two charsets. More...
 
Char32_t firstPage (Char32_t map[MAP_SIZE], Char32_t *next)
 Start enumerating charset contents. More...
 
bool hasChar (Char32_t ucs4) const
 Check a charset for a char. More...
 
RefPtr< CharSetintersect (const RefPtr< CharSet > &other)
 Intersect charsets. More...
 
Char32_t intersectCount (const RefPtr< CharSet > &other)
 Intersect and count charsets. More...
 
bool isSubset (const RefPtr< CharSet > &other) const
 Test for charset inclusion. More...
 
bool merge (const RefPtr< CharSet > &other, bool &changed)
 Merge charsets. More...
 
bool merge (const RefPtr< CharSet > &other)
 
Char32_t nextPage (Char32_t map[MAP_SIZE], Char32_t *next)
 Continue enumerating charset contents. More...
 
CharSetDelegateoperator-> ()
 
const CharSetDelegateoperator-> () const
 
RefPtr< CharSetsubtract (const RefPtr< CharSet > &other)
 Subtract charsets. More...
 
Char32_t subtractCount (const RefPtr< CharSet > &other)
 Subtract and count charsets. More...
 

Static Public Attributes

static const unsigned int MAP_SIZE = 256/32
 

Private Member Functions

 CharSetDelegate (FcCharSet *ptr)
 wrap constructor More...
 
 CharSetDelegate (const CharSetDelegate &other)
 not copy-constructable More...
 
CharSetDelegateoperator= (const CharSetDelegate &other)
 not assignable More...
 

Private Attributes

FcCharSet * m_ptr
 

Friends

class RefPtr< CharSet >
 

Detailed Description

An CharSet is an abstract type that holds the set of encoded Unicode chars in a font. Operations to build and compare these sets are provided.

The underlying FcCharSet object is reference counted, so this CharSet wrapper provides a copy constructor which increments the reference count, and a destructor which decrements the reference count

Definition at line 48 of file CharSet.h.

Constructor & Destructor Documentation

fontconfig::CharSetDelegate::CharSetDelegate ( FcCharSet *  ptr)
inlineexplicitprivate

wrap constructor

wraps the pointer with this interface, does nothing else, only called by RefPtr<Atomic>

Definition at line 58 of file CharSet.h.

fontconfig::CharSetDelegate::CharSetDelegate ( const CharSetDelegate other)
private

not copy-constructable

Member Function Documentation

bool fontconfig::CharSetDelegate::addChar ( Char32_t  ucs4)

Add a character to a charset.

FcCharSetAddChar adds a single Unicode char to the set, returning FcFalse on failure, either as a result of a constant set or from running out of memory.

Char32_t fontconfig::CharSetDelegate::count ( ) const

Count entries in a charset.

Returns the total number of Unicode chars in a.

RefPtr<CharSet> fontconfig::CharSetDelegate::createUnion ( const RefPtr< CharSet > &  other)

Add charsets.

Returns a set including only those chars found in either a or b.

bool fontconfig::CharSetDelegate::delChar ( Char32_t  ucs4)

Remove a character from a charset.

FcCharSetDelChar deletes a single Unicode char from the set, returning FcFalse on failure, either as a result of a constant set or from running out of memory.

bool fontconfig::CharSetDelegate::equal ( const RefPtr< CharSet > &  other) const

Compare two charsets.

Returns whether a and b contain the same set of Unicode chars.

Char32_t fontconfig::CharSetDelegate::firstPage ( Char32_t  map[MAP_SIZE],
Char32_t next 
)

Start enumerating charset contents.

Builds an array of bits marking the first page of Unicode coverage of a. Returns the base of the array. next contains the next page in the font.

bool fontconfig::CharSetDelegate::hasChar ( Char32_t  ucs4) const

Check a charset for a char.

Returns whether fcs contains the char ucs4.

RefPtr<CharSet> fontconfig::CharSetDelegate::intersect ( const RefPtr< CharSet > &  other)

Intersect charsets.

Returns a set including only those chars found in both a and b.

Char32_t fontconfig::CharSetDelegate::intersectCount ( const RefPtr< CharSet > &  other)

Intersect and count charsets.

Returns the number of chars that are in both a and b.

bool fontconfig::CharSetDelegate::isSubset ( const RefPtr< CharSet > &  other) const

Test for charset inclusion.

Returns whether a is a subset of b.

bool fontconfig::CharSetDelegate::merge ( const RefPtr< CharSet > &  other,
bool &  changed 
)

Merge charsets.

Adds all chars in b to a. In other words, this is an in-place version of FcCharSetUnion. If changed is not NULL, then it returns whether any new chars from b were added to a. Returns FcFalse on failure, either when a is a constant set or from running out of memory.

bool fontconfig::CharSetDelegate::merge ( const RefPtr< CharSet > &  other)
Char32_t fontconfig::CharSetDelegate::nextPage ( Char32_t  map[MAP_SIZE],
Char32_t next 
)

Continue enumerating charset contents.

Builds an array of bits marking the Unicode coverage of a for page *next. Returns the base of the array. next contains the next page in the font.

CharSetDelegate* fontconfig::CharSetDelegate::operator-> ( )
inline

Definition at line 71 of file CharSet.h.

const CharSetDelegate* fontconfig::CharSetDelegate::operator-> ( ) const
inline

Definition at line 72 of file CharSet.h.

CharSetDelegate& fontconfig::CharSetDelegate::operator= ( const CharSetDelegate other)
private

not assignable

RefPtr<CharSet> fontconfig::CharSetDelegate::subtract ( const RefPtr< CharSet > &  other)

Subtract charsets.

Returns a set including only those chars found in a but not b.

Char32_t fontconfig::CharSetDelegate::subtractCount ( const RefPtr< CharSet > &  other)

Subtract and count charsets.

Returns the number of chars that are in a but not in b.

Friends And Related Function Documentation

friend class RefPtr< CharSet >
friend

Definition at line 69 of file CharSet.h.

Member Data Documentation

FcCharSet* fontconfig::CharSetDelegate::m_ptr
private

Definition at line 51 of file CharSet.h.

const unsigned int fontconfig::CharSetDelegate::MAP_SIZE = 256/32
static

Definition at line 74 of file CharSet.h.


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