99ff9094c7
--------------------------------------------------------------------------- RCS file: /cvsroot/open-beos/current/src/kits/support/CharacterSet.cpp,v Working file: CharacterSet.cpp head: 1.3 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 3; selected revisions: 3 description: ---------------------------- revision 1.3 date: 2003/07/27 01:34:30; author: shatty; state: Exp; lines: +11 -0 added default constructor, which just happens to init to UTF-8. do not count on this feature. :-) ---------------------------- revision 1.2 date: 2003/07/27 00:58:01; author: shatty; state: Exp; lines: +4 -2 added all the remaining R5 text encodings ---------------------------- revision 1.1 date: 2003/07/26 21:26:36; author: shatty; state: Exp; add character set support git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5808 a95241bf-73f2-0310-859d-f6bbb57e9c96
86 lines
1.2 KiB
C++
86 lines
1.2 KiB
C++
#include <CharacterSet.h>
|
|
|
|
namespace BPrivate {
|
|
|
|
BCharacterSet::BCharacterSet()
|
|
{
|
|
id = 0;
|
|
MIBenum = 106;
|
|
print_name = "Unicode";
|
|
iana_name = "UTF-8";
|
|
mime_name = "UTF-8";
|
|
aliases_count = 0;
|
|
aliases = NULL;
|
|
}
|
|
|
|
BCharacterSet::BCharacterSet(uint32 _id, uint32 _MIBenum, const char * _print_name,
|
|
const char * _iana_name, const char * _mime_name,
|
|
const char ** _aliases)
|
|
{
|
|
id = _id;
|
|
MIBenum = _MIBenum;
|
|
print_name = _print_name;
|
|
iana_name = _iana_name;
|
|
mime_name = _mime_name;
|
|
aliases_count = 0;
|
|
if (_aliases != 0) {
|
|
while (_aliases[aliases_count] != 0) {
|
|
aliases_count++;
|
|
}
|
|
}
|
|
aliases = _aliases;
|
|
}
|
|
|
|
uint32
|
|
BCharacterSet::GetFontID() const
|
|
{
|
|
return id;
|
|
}
|
|
|
|
uint32
|
|
BCharacterSet::GetConversionID() const
|
|
{
|
|
return id-1;
|
|
}
|
|
|
|
uint32
|
|
BCharacterSet::GetMIBenum() const
|
|
{
|
|
return MIBenum;
|
|
}
|
|
|
|
const char *
|
|
BCharacterSet::GetName() const
|
|
{
|
|
return iana_name;
|
|
}
|
|
|
|
const char *
|
|
BCharacterSet::GetPrintName() const
|
|
{
|
|
return print_name;
|
|
}
|
|
|
|
const char *
|
|
BCharacterSet::GetMIMEName() const
|
|
{
|
|
return mime_name;
|
|
}
|
|
|
|
int32
|
|
BCharacterSet::CountAliases() const
|
|
{
|
|
return aliases_count;
|
|
}
|
|
|
|
const char *
|
|
BCharacterSet::AliasAt(uint32 index) const
|
|
{
|
|
if (index >= aliases_count) {
|
|
return 0;
|
|
}
|
|
return aliases[index];
|
|
}
|
|
|
|
}
|