BrailleTutorNS::GlyphMapping Struct Reference

Character/"wide char" structures to which Braille dot patterns are mapped. More...

#include <Charset.h>

List of all members.

Public Member Functions

bool equals (const GlyphMapping &gm) const
 Equality test for GlyphMapping objects (compares the str member).
bool lt (const GlyphMapping &gm) const
 Comparison for GlyphMapping objects (compares the str_w member).
 GlyphMapping (const uint32_t *my_str_w)
 Constructor: converts an array of 32-bit ints to a GlyphMapping.
 GlyphMapping (const uint8_t *my_str)
 Constructor: converts an array of unsigned chars to a GlyphMapping.
 GlyphMapping (const std::string &my_str)
 Constructor: converts a regular ASCII std::string to a GlyphMapping.
 GlyphMapping (const char *my_str)
 Constructor: converts an array of ASCII chars to a GlyphMapping.
 GlyphMapping ()
 Constructor: creates an "empty mapping".
GlyphMapping dup () const
 operator std::string () const
bool isEmpty () const
 Returns true if this GlyphMapping is the empty mapping.

Public Attributes

boost::shared_array
< uint8_t > 
str
 Character string to which a Braille dot pattern is mapped.
boost::shared_array
< uint32_t > 
str_w


Detailed Description

Character/"wide char" structures to which Braille dot patterns are mapped.

Dot patterns are mapped to GlyphMapping objects, which contain pointers to both a regular null-terminated char array and an array of 32-bit unsigned ints (also null-terminated). The unsigned ints are made by converting the char array bytes as if they are UTF-8. You may be able to cast the unsigned int string to a wchar_t string on your platform; otherwise you should be able to convert it to one without much trouble.

The smart pointers in a GlyphMapping object may point to the same strings as the pointers in other GlyphMapping objects. Change these strings with caution, or best not at all.


Member Function Documentation

bool BrailleTutorNS::GlyphMapping::lt ( const GlyphMapping gm  )  const

Comparison for GlyphMapping objects (compares the str_w member).

Note: this routine is more for STL containers that store GlyphMapping objects than for practical string sorting ('A' with an accent will be sorted after the whole unaccented alphabet, for example).

GlyphMapping BrailleTutorNS::GlyphMapping::dup (  )  const

Returns a GlyphMapping whose pointers point at new copies of this GlyphMapping's information

BrailleTutorNS::GlyphMapping::operator std::string (  )  const [inline]

Returns an approximate std::string version of this GlyphMapping. Useful only for ASCII strings.


Member Data Documentation

boost::shared_array<uint32_t> BrailleTutorNS::GlyphMapping::str_w

32-bit unsigned null-terminated "string" to which a Braille dot pattern is mapped


The documentation for this struct was generated from the following file:
Generated on Fri Nov 16 14:50:26 2007 for Braille Tutor Interface Library by  doxygen 1.5.3