1 #ifndef CHARACTER_SET_H
2 #define CHARACTER_SET_H
4 #include <SupportDefs.h>
10 * @author Andrew Bachmann
11 * @brief Defines BCharacterSet
13 * @see http://www.iana.org/assignments/character-sets
18 * @class BCharacterSet
19 * @brief An object holding a variety of useful information about a character set.
21 * This information has been derived from the IANA standards organization.
22 * Since IANA provides several names for some encodings, this object also
23 * provides for aliases.
27 * @brief default constructor, for stack allocated character set objects
31 * @brief constructor, for internal use only
33 BCharacterSet(uint32 id
, uint32 MIBenum
, const char * print_name
,
34 const char * iana_name
, const char * mime_name
,
35 const char ** aliases
);
37 * @brief returns an id for use in BFont::SetEncoding
38 * @return an id for use in BFont::SetEncoding
40 uint32
GetFontID(void) const;
42 * @brief returns an id for use in convert_to/from_utf8
43 * @return an id for use in convert_to/from_utf8
45 uint32
GetConversionID(void) const;
47 * @brief returns an id for use in MIBs to identify coded character sets
48 * @return an id for use in MIBs to identify coded character sets
50 uint32
GetMIBenum(void) const;
52 * @brief returns the IANA standard name for this character set
53 * @return the IANA standard name for this character set
55 const char * GetName(void) const;
57 * @brief returns a user interface friendly name for this character set
58 * @return a user interface friendly name for this character set
60 const char * GetPrintName(void) const;
62 * @brief returns the MIME preferred name for this character set, or null if none exists
63 * @return the MIME preferred name for this character set, or null if none exists
65 const char * GetMIMEName(void) const;
67 * @brief returns the number of aliases for this character set
68 * @return the number of aliases for this character set
70 int32
CountAliases(void) const;
72 * @brief returns the index'th alias, or NULL if out of range
73 * @return the index'th alias, or NULL if out of range
75 const char * AliasAt(uint32 index
) const;
78 uint32 id
; //! id from convert_to_utf8/convert_from_utf8
79 uint32 MIBenum
; //! for use in MIBs to identify coded character sets
80 const char * print_name
; //! user interface friendly name
81 const char * iana_name
; //! standard IANA name
82 const char * mime_name
; //! the preferred mime name
83 const char ** aliases
; //! aliases for this character set
84 uint32 aliases_count
; //! how many aliases are available
89 #endif // CHARACTER_SET_H