btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / kits / textencoding / CharacterSet.cpp
blob6b2a633a5b00e55b8e4cdf3e4c5e21b503b53e14
1 #include <CharacterSet.h>
3 namespace BPrivate {
5 BCharacterSet::BCharacterSet()
7 id = 0;
8 MIBenum = 106;
9 print_name = "Unicode";
10 iana_name = "UTF-8";
11 mime_name = "UTF-8";
12 aliases_count = 0;
13 aliases = NULL;
16 BCharacterSet::BCharacterSet(uint32 _id, uint32 _MIBenum, const char * _print_name,
17 const char * _iana_name, const char * _mime_name,
18 const char ** _aliases)
20 id = _id;
21 MIBenum = _MIBenum;
22 print_name = _print_name;
23 iana_name = _iana_name;
24 mime_name = _mime_name;
25 aliases_count = 0;
26 if (_aliases != 0) {
27 while (_aliases[aliases_count] != 0) {
28 aliases_count++;
31 aliases = _aliases;
34 uint32
35 BCharacterSet::GetFontID() const
37 return id;
40 uint32
41 BCharacterSet::GetConversionID() const
43 return id-1;
46 uint32
47 BCharacterSet::GetMIBenum() const
49 return MIBenum;
52 const char *
53 BCharacterSet::GetName() const
55 return iana_name;
58 const char *
59 BCharacterSet::GetPrintName() const
61 return print_name;
64 const char *
65 BCharacterSet::GetMIMEName() const
67 return mime_name;
70 int32
71 BCharacterSet::CountAliases() const
73 return aliases_count;
76 const char *
77 BCharacterSet::AliasAt(uint32 index) const
79 if (index >= aliases_count) {
80 return 0;
82 return aliases[index];