X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/9d88c94317aeac5dd26c1dbe8c2112dbe855d2b5..73c04bcfe1096173b00431f0cdc742894b15eef0:/icuSources/i18n/unesctrn.cpp diff --git a/icuSources/i18n/unesctrn.cpp b/icuSources/i18n/unesctrn.cpp index 93008b00..45ced8b1 100644 --- a/icuSources/i18n/unesctrn.cpp +++ b/icuSources/i18n/unesctrn.cpp @@ -75,28 +75,39 @@ static const UChar SPEC_Any[] = { UOBJECT_DEFINE_RTTI_IMPLEMENTATION(UnescapeTransliterator) +static UChar* copySpec(const UChar* spec) { + int32_t len = 0; + while (spec[len] != END) { + ++len; + } + ++len; + UChar *result = (UChar *)uprv_malloc(len*sizeof(UChar)); + uprv_memcpy(result, spec, len*sizeof(result[0])); + return result; +} + /** * Factory methods. Ignore the context. */ -Transliterator* UnescapeTransliterator::_createUnicode(const UnicodeString& ID, Token /*context*/) { +static Transliterator* _createUnicode(const UnicodeString& ID, Transliterator::Token /*context*/) { return new UnescapeTransliterator(ID, SPEC_Unicode); } -Transliterator* UnescapeTransliterator::_createJava(const UnicodeString& ID, Token /*context*/) { +static Transliterator* _createJava(const UnicodeString& ID, Transliterator::Token /*context*/) { return new UnescapeTransliterator(ID, SPEC_Java); } -Transliterator* UnescapeTransliterator::_createC(const UnicodeString& ID, Token /*context*/) { +static Transliterator* _createC(const UnicodeString& ID, Transliterator::Token /*context*/) { return new UnescapeTransliterator(ID, SPEC_C); } -Transliterator* UnescapeTransliterator::_createXML(const UnicodeString& ID, Token /*context*/) { +static Transliterator* _createXML(const UnicodeString& ID, Transliterator::Token /*context*/) { return new UnescapeTransliterator(ID, SPEC_XML); } -Transliterator* UnescapeTransliterator::_createXML10(const UnicodeString& ID, Token /*context*/) { +static Transliterator* _createXML10(const UnicodeString& ID, Transliterator::Token /*context*/) { return new UnescapeTransliterator(ID, SPEC_XML10); } -Transliterator* UnescapeTransliterator::_createPerl(const UnicodeString& ID, Token /*context*/) { +static Transliterator* _createPerl(const UnicodeString& ID, Transliterator::Token /*context*/) { return new UnescapeTransliterator(ID, SPEC_Perl); } -Transliterator* UnescapeTransliterator::_createAny(const UnicodeString& ID, Token /*context*/) { +static Transliterator* _createAny(const UnicodeString& ID, Transliterator::Token /*context*/) { return new UnescapeTransliterator(ID, SPEC_Any); } @@ -151,17 +162,6 @@ Transliterator* UnescapeTransliterator::clone() const { return new UnescapeTransliterator(*this); } -UChar* UnescapeTransliterator::copySpec(const UChar* spec) { - int32_t len = 0; - while (spec[len] != END) { - ++len; - } - ++len; - UChar *result = (UChar *)uprv_malloc(len*sizeof(UChar)); - uprv_memcpy(result, spec, len*sizeof(result[0])); - return result; -} - /** * Implements {@link Transliterator#handleTransliterate}. */