From 99ff9094c790d2e411592692297719d1fb05aa2f Mon Sep 17 00:00:00 2001 From: shatty Date: Tue, 30 Dec 2003 03:22:14 +0000 Subject: [PATCH] MOVED: --------------------------------------------------------------------------- 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 --- src/kits/textencoding/CharacterSet.cpp | 85 ++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 src/kits/textencoding/CharacterSet.cpp diff --git a/src/kits/textencoding/CharacterSet.cpp b/src/kits/textencoding/CharacterSet.cpp new file mode 100644 index 0000000000..6b2a633a5b --- /dev/null +++ b/src/kits/textencoding/CharacterSet.cpp @@ -0,0 +1,85 @@ +#include + +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]; +} + +}