/*
**********************************************************************
-* Copyright (c) 2001, International Business Machines
+* Copyright (c) 2001-2006, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
static const UChar RBRACE[] = {125,0}; // "}"
static const UChar EMPTY[] = {0}; // ""
-const char EscapeTransliterator::fgClassID=0;
+UOBJECT_DEFINE_RTTI_IMPLEMENTATION(EscapeTransliterator)
/**
* Factory methods
*/
-Transliterator* EscapeTransliterator::_createUnicode(const UnicodeString& ID, Token /*context*/) {
+static Transliterator* _createEscUnicode(const UnicodeString& ID, Transliterator::Token /*context*/) {
// Unicode: "U+10FFFF" hex, min=4, max=6
return new EscapeTransliterator(ID, UNIPRE, EMPTY, 16, 4, TRUE, NULL);
}
-Transliterator* EscapeTransliterator::_createJava(const UnicodeString& ID, Token /*context*/) {
+static Transliterator* _createEscJava(const UnicodeString& ID, Transliterator::Token /*context*/) {
// Java: "\\uFFFF" hex, min=4, max=4
return new EscapeTransliterator(ID, BS_u, EMPTY, 16, 4, FALSE, NULL);
}
-Transliterator* EscapeTransliterator::_createC(const UnicodeString& ID, Token /*context*/) {
+static Transliterator* _createEscC(const UnicodeString& ID, Transliterator::Token /*context*/) {
// C: "\\uFFFF" hex, min=4, max=4; \\U0010FFFF hex, min=8, max=8
return new EscapeTransliterator(ID, BS_u, EMPTY, 16, 4, TRUE,
new EscapeTransliterator(EMPTY, BS_U, EMPTY, 16, 8, TRUE, NULL));
}
-Transliterator* EscapeTransliterator::_createXML(const UnicodeString& ID, Token /*context*/) {
+static Transliterator* _createEscXML(const UnicodeString& ID, Transliterator::Token /*context*/) {
// XML: "" hex, min=1, max=6
return new EscapeTransliterator(ID, XMLPRE, SEMI, 16, 1, TRUE, NULL);
}
-Transliterator* EscapeTransliterator::_createXML10(const UnicodeString& ID, Token /*context*/) {
+static Transliterator* _createEscXML10(const UnicodeString& ID, Transliterator::Token /*context*/) {
// XML10: "&1114111;" dec, min=1, max=7 (not really "Any-Hex")
return new EscapeTransliterator(ID, XML10PRE, SEMI, 10, 1, TRUE, NULL);
}
-Transliterator* EscapeTransliterator::_createPerl(const UnicodeString& ID, Token /*context*/) {
+static Transliterator* _createEscPerl(const UnicodeString& ID, Transliterator::Token /*context*/) {
// Perl: "\\x{263A}" hex, min=1, max=6
return new EscapeTransliterator(ID, PERLPRE, RBRACE, 16, 1, TRUE, NULL);
}
void EscapeTransliterator::registerIDs() {
Token t = integerToken(0);
- Transliterator::_registerFactory("Any-Hex/Unicode", _createUnicode, t);
+ Transliterator::_registerFactory(UNICODE_STRING_SIMPLE("Any-Hex/Unicode"), _createEscUnicode, t);
- Transliterator::_registerFactory("Any-Hex/Java", _createJava, t);
+ Transliterator::_registerFactory(UNICODE_STRING_SIMPLE("Any-Hex/Java"), _createEscJava, t);
- Transliterator::_registerFactory("Any-Hex/C", _createC, t);
+ Transliterator::_registerFactory(UNICODE_STRING_SIMPLE("Any-Hex/C"), _createEscC, t);
- Transliterator::_registerFactory("Any-Hex/XML", _createXML, t);
+ Transliterator::_registerFactory(UNICODE_STRING_SIMPLE("Any-Hex/XML"), _createEscXML, t);
- Transliterator::_registerFactory("Any-Hex/XML10", _createXML10, t);
+ Transliterator::_registerFactory(UNICODE_STRING_SIMPLE("Any-Hex/XML10"), _createEscXML10, t);
- Transliterator::_registerFactory("Any-Hex/Perl", _createPerl, t);
+ Transliterator::_registerFactory(UNICODE_STRING_SIMPLE("Any-Hex/Perl"), _createEscPerl, t);
- Transliterator::_registerFactory("Any-Hex", _createJava, t);
+ Transliterator::_registerFactory(UNICODE_STRING_SIMPLE("Any-Hex"), _createEscJava, t);
}
/**
/**
* Implements {@link Transliterator#handleTransliterate}.
*/
-void EscapeTransliterator::handleTransliterate(Replaceable& text, UTransPosition& pos,
- UBool isIncremental) const {
+void EscapeTransliterator::handleTransliterate(Replaceable& text,
+ UTransPosition& pos,
+ UBool /*isIncremental*/) const
+{
+ /* TODO: Verify that isIncremental can be ignored */
int32_t start = pos.start;
int32_t limit = pos.limit;