From: Markus Scherer Date: Tue, 4 Sep 2012 20:38:14 +0000 (+0000) Subject: ICU-9353 fix dependencies, mostly dictionary code and listformatter X-Git-Tag: milestone-59-0-1~3582 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=22cc0cd7cc98d26bb0f89098fa0ef22ba75c2440;p=icu ICU-9353 fix dependencies, mostly dictionary code and listformatter X-SVN-Rev: 32331 --- diff --git a/icu4c/source/common/dictbe.cpp b/icu4c/source/common/dictbe.cpp index b310462f68e..29488b57c7e 100644 --- a/icu4c/source/common/dictbe.cpp +++ b/icu4c/source/common/dictbe.cpp @@ -771,6 +771,7 @@ CjkBreakEngine::divideUpDictionaryRange( UText *text, } UnicodeString inputString(charString.elems(), inputLength); + // TODO: Use Normalizer2. UNormalizationMode norm_mode = UNORM_NFKC; UBool isNormalized = Normalizer::quickCheck(inputString, norm_mode, status) == UNORM_YES || diff --git a/icu4c/source/common/dictionarydata.cpp b/icu4c/source/common/dictionarydata.cpp index e9ec12edc2b..1971751dede 100644 --- a/icu4c/source/common/dictionarydata.cpp +++ b/icu4c/source/common/dictionarydata.cpp @@ -22,6 +22,9 @@ const int32_t DictionaryData::TRIE_TYPE_BYTES; const int32_t DictionaryData::TRIE_TYPE_UCHARS; #endif +DictionaryMatcher::~DictionaryMatcher() { +} + UCharsDictionaryMatcher::~UCharsDictionaryMatcher() { udata_close(file); } diff --git a/icu4c/source/common/dictionarydata.h b/icu4c/source/common/dictionarydata.h index 06b438a309d..eedc926fa09 100644 --- a/icu4c/source/common/dictionarydata.h +++ b/icu4c/source/common/dictionarydata.h @@ -61,13 +61,15 @@ public: * Wrapper class around generic dictionaries, implementing matches(). * getType() should return a TRIE_TYPE_??? constant from DictionaryData. * - * All implementations of this interface must be threadsafe if they are to be used inside of the + * All implementations of this interface must be thread-safe if they are to be used inside of the * dictionary-based break iteration code. */ -class U_COMMON_API DictionaryMatcher { +class U_COMMON_API DictionaryMatcher : public UMemory { public: + virtual ~DictionaryMatcher(); // this should emulate CompactTrieDictionary::matches() - virtual int32_t matches(UText *text, int32_t maxLength, int32_t *lengths, int &count, int limit, int32_t *values = NULL) const = 0; + virtual int32_t matches(UText *text, int32_t maxLength, int32_t *lengths, int &count, + int limit, int32_t *values = NULL) const = 0; /** @return DictionaryData::TRIE_TYPE_XYZ */ virtual int32_t getType() const = 0; }; @@ -78,8 +80,9 @@ public: // constructs a new UCharsDictionaryMatcher. // The UDataMemory * will be closed on this object's destruction. UCharsDictionaryMatcher(const UChar *c, UDataMemory *f) : characters(c), file(f) { } - ~UCharsDictionaryMatcher(); - virtual int32_t matches(UText *text, int32_t maxLength, int32_t *lengths, int &count, int limit, int32_t *values = NULL) const; + virtual ~UCharsDictionaryMatcher(); + virtual int32_t matches(UText *text, int32_t maxLength, int32_t *lengths, int &count, + int limit, int32_t *values = NULL) const; virtual int32_t getType() const; private: const UChar *characters; @@ -92,9 +95,11 @@ public: // constructs a new BytesTrieDictionaryMatcher // the transform constant should be the constant read from the file, not a masked version! // the UDataMemory * fed in here will be closed on this object's destruction - BytesDictionaryMatcher(const char *c, int32_t t, UDataMemory *f) : characters(c), transformConstant(t), file(f) { } - ~BytesDictionaryMatcher(); - virtual int32_t matches(UText *text, int32_t maxLength, int32_t *lengths, int &count, int limit, int32_t *values = NULL) const; + BytesDictionaryMatcher(const char *c, int32_t t, UDataMemory *f) + : characters(c), transformConstant(t), file(f) { } + virtual ~BytesDictionaryMatcher(); + virtual int32_t matches(UText *text, int32_t maxLength, int32_t *lengths, int &count, + int limit, int32_t *values = NULL) const; virtual int32_t getType() const; private: UChar32 transform(UChar32 c) const; diff --git a/icu4c/source/test/depstest/dependencies.txt b/icu4c/source/test/depstest/dependencies.txt index e66480eb216..89153636c59 100644 --- a/icu4c/source/test/depstest/dependencies.txt +++ b/icu4c/source/test/depstest/dependencies.txt @@ -37,7 +37,7 @@ group: c_strings memcmp memcpy memmove memset # Additional symbols in an optimized build. __strcpy_chk __strncpy_chk __strcat_chk __strncat_chk - __rawmemchr __memcpy_chk __memmove_chk + __rawmemchr __memcpy_chk __memmove_chk __memset_chk group: c_string_formatting atoi atol strtod strtol strtoul @@ -136,6 +136,7 @@ library: common ucasemap ucasemap_titlecase_brkiter script_runs uprops ubidi_props ucase uscript ubidi ushape + listformatter resourcebundle service_registration resbund_cnv ures_cnv icudataver ucat loclikely conversion converter_selector ucnv_set ucnvdisp @@ -164,12 +165,13 @@ group: breakiterator brkiter.o brkeng.o ubrk.o rbbi.o rbbinode.o rbbiscan.o rbbisetb.o rbbistbl.o rbbitblb.o rbbidata.o rbbirb.o - triedict.o dictbe.o + dictionarydata.o dictbe.o deps resourcebundle service_registration schriter utext uniset_core uniset_props uhash ustack utrie - uvector32 # for triedict.o + ucharstrie bytestrie + normlzr # for dictbe.o, should switch to Normalizer2 group: unormcmp # unorm_compare() unormcmp.o @@ -491,6 +493,11 @@ group: service_registration locale_display_names resourcebundle hashtable uvector +group: listformatter + listformatter.o + deps + resourcebundle + group: ucat # message-catalog-like API ucat.o deps