pango 2.2.0-x86-mingw32 → 2.2.1-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +21 -2
- data/lib/2.0/pango.so +0 -0
- data/vendor/local/bin/derb.exe +0 -0
- data/vendor/local/bin/genbrk.exe +0 -0
- data/vendor/local/bin/genccode.exe +0 -0
- data/vendor/local/bin/gencfu.exe +0 -0
- data/vendor/local/bin/gencmn.exe +0 -0
- data/vendor/local/bin/gencnval.exe +0 -0
- data/vendor/local/bin/gendict.exe +0 -0
- data/vendor/local/bin/gennorm2.exe +0 -0
- data/vendor/local/bin/genrb.exe +0 -0
- data/vendor/local/bin/gensprep.exe +0 -0
- data/vendor/local/bin/hb-ot-shape-closure.exe +0 -0
- data/vendor/local/bin/hb-shape.exe +0 -0
- data/vendor/local/bin/hb-view.exe +0 -0
- data/vendor/local/bin/icu-config +820 -0
- data/vendor/local/bin/icuinfo.exe +0 -0
- data/vendor/local/bin/icupkg.exe +0 -0
- data/vendor/local/bin/libharfbuzz-0.dll +0 -0
- data/vendor/local/bin/libpango-1.0-0.dll +0 -0
- data/vendor/local/bin/libpangocairo-1.0-0.dll +0 -0
- data/vendor/local/bin/libpangoft2-1.0-0.dll +0 -0
- data/vendor/local/bin/libpangowin32-1.0-0.dll +0 -0
- data/vendor/local/bin/libstdc++-6.dll +0 -0
- data/vendor/local/bin/makeconv.exe +0 -0
- data/vendor/local/bin/pango-querymodules.exe +0 -0
- data/vendor/local/bin/pango-view.exe +0 -0
- data/vendor/local/bin/pkgdata.exe +0 -0
- data/vendor/local/bin/uconv.exe +0 -0
- data/vendor/local/etc/pango/pango.modules +3 -3
- data/vendor/local/include/harfbuzz/hb-blob.h +3 -4
- data/vendor/local/include/harfbuzz/hb-buffer.h +22 -1
- data/vendor/local/include/harfbuzz/hb-common.h +23 -18
- data/vendor/local/include/harfbuzz/hb-icu.h +52 -0
- data/vendor/local/include/harfbuzz/hb-ot-font.h +41 -0
- data/vendor/local/include/harfbuzz/hb-ot-layout.h +11 -3
- data/vendor/local/include/harfbuzz/hb-ot-shape.h +10 -11
- data/vendor/local/include/harfbuzz/hb-ot.h +1 -0
- data/vendor/local/include/harfbuzz/hb-version.h +7 -7
- data/vendor/local/include/layout/LEFontInstance.h +550 -0
- data/vendor/local/include/layout/LEGlyphFilter.h +45 -0
- data/vendor/local/include/layout/LEGlyphStorage.h +546 -0
- data/vendor/local/include/layout/LEInsertionList.h +177 -0
- data/vendor/local/include/layout/LELanguages.h +112 -0
- data/vendor/local/include/layout/LEScripts.h +263 -0
- data/vendor/local/include/layout/LESwaps.h +100 -0
- data/vendor/local/include/layout/LETableReference.h +418 -0
- data/vendor/local/include/layout/LETypes.h +728 -0
- data/vendor/local/include/layout/LayoutEngine.h +518 -0
- data/vendor/local/include/layout/ParagraphLayout.h +747 -0
- data/vendor/local/include/layout/RunArrays.h +676 -0
- data/vendor/local/include/layout/loengine.h +225 -0
- data/vendor/local/include/layout/playout.h +466 -0
- data/vendor/local/include/layout/plruns.h +441 -0
- data/vendor/local/include/pango-1.0/pango/pango-features.h +2 -2
- data/vendor/local/include/pango-1.0/pango/pango-font.h +3 -1
- data/vendor/local/include/pango-1.0/pango/pango-item.h +11 -2
- data/vendor/local/include/unicode/alphaindex.h +752 -0
- data/vendor/local/include/unicode/appendable.h +232 -0
- data/vendor/local/include/unicode/basictz.h +214 -0
- data/vendor/local/include/unicode/brkiter.h +655 -0
- data/vendor/local/include/unicode/bytestream.h +257 -0
- data/vendor/local/include/unicode/bytestrie.h +519 -0
- data/vendor/local/include/unicode/bytestriebuilder.h +181 -0
- data/vendor/local/include/unicode/calendar.h +2519 -0
- data/vendor/local/include/unicode/caniter.h +208 -0
- data/vendor/local/include/unicode/chariter.h +722 -0
- data/vendor/local/include/unicode/choicfmt.h +594 -0
- data/vendor/local/include/unicode/coleitr.h +404 -0
- data/vendor/local/include/unicode/coll.h +1267 -0
- data/vendor/local/include/unicode/compactdecimalformat.h +330 -0
- data/vendor/local/include/unicode/curramt.h +130 -0
- data/vendor/local/include/unicode/currpinf.h +258 -0
- data/vendor/local/include/unicode/currunit.h +110 -0
- data/vendor/local/include/unicode/datefmt.h +883 -0
- data/vendor/local/include/unicode/dbbi.h +40 -0
- data/vendor/local/include/unicode/dcfmtsym.h +482 -0
- data/vendor/local/include/unicode/decimfmt.h +2479 -0
- data/vendor/local/include/unicode/docmain.h +215 -0
- data/vendor/local/include/unicode/dtfmtsym.h +912 -0
- data/vendor/local/include/unicode/dtintrv.h +158 -0
- data/vendor/local/include/unicode/dtitvfmt.h +985 -0
- data/vendor/local/include/unicode/dtitvinf.h +514 -0
- data/vendor/local/include/unicode/dtptngen.h +498 -0
- data/vendor/local/include/unicode/dtrule.h +250 -0
- data/vendor/local/include/unicode/enumset.h +64 -0
- data/vendor/local/include/unicode/errorcode.h +137 -0
- data/vendor/local/include/unicode/fieldpos.h +291 -0
- data/vendor/local/include/unicode/filteredbrk.h +131 -0
- data/vendor/local/include/unicode/fmtable.h +760 -0
- data/vendor/local/include/unicode/format.h +305 -0
- data/vendor/local/include/unicode/fpositer.h +117 -0
- data/vendor/local/include/unicode/gender.h +111 -0
- data/vendor/local/include/unicode/gregocal.h +777 -0
- data/vendor/local/include/unicode/icudataver.h +41 -0
- data/vendor/local/include/unicode/icuplug.h +371 -0
- data/vendor/local/include/unicode/idna.h +323 -0
- data/vendor/local/include/unicode/listformatter.h +167 -0
- data/vendor/local/include/unicode/localpointer.h +304 -0
- data/vendor/local/include/unicode/locdspnm.h +204 -0
- data/vendor/local/include/unicode/locid.h +815 -0
- data/vendor/local/include/unicode/measfmt.h +389 -0
- data/vendor/local/include/unicode/measunit.h +1443 -0
- data/vendor/local/include/unicode/measure.h +159 -0
- data/vendor/local/include/unicode/messagepattern.h +943 -0
- data/vendor/local/include/unicode/msgfmt.h +1093 -0
- data/vendor/local/include/unicode/normalizer2.h +658 -0
- data/vendor/local/include/unicode/normlzr.h +797 -0
- data/vendor/local/include/unicode/numfmt.h +1187 -0
- data/vendor/local/include/unicode/numsys.h +208 -0
- data/vendor/local/include/unicode/parseerr.h +92 -0
- data/vendor/local/include/unicode/parsepos.h +230 -0
- data/vendor/local/include/unicode/platform.h +751 -0
- data/vendor/local/include/unicode/plurfmt.h +615 -0
- data/vendor/local/include/unicode/plurrule.h +501 -0
- data/vendor/local/include/unicode/ptypes.h +126 -0
- data/vendor/local/include/unicode/putil.h +181 -0
- data/vendor/local/include/unicode/rbbi.h +782 -0
- data/vendor/local/include/unicode/rbnf.h +1032 -0
- data/vendor/local/include/unicode/rbtz.h +362 -0
- data/vendor/local/include/unicode/regex.h +1857 -0
- data/vendor/local/include/unicode/region.h +228 -0
- data/vendor/local/include/unicode/reldatefmt.h +498 -0
- data/vendor/local/include/unicode/rep.h +261 -0
- data/vendor/local/include/unicode/resbund.h +490 -0
- data/vendor/local/include/unicode/schriter.h +187 -0
- data/vendor/local/include/unicode/scientificformathelper.h +139 -0
- data/vendor/local/include/unicode/search.h +575 -0
- data/vendor/local/include/unicode/selfmt.h +367 -0
- data/vendor/local/include/unicode/simpletz.h +928 -0
- data/vendor/local/include/unicode/smpdtfmt.h +1592 -0
- data/vendor/local/include/unicode/sortkey.h +338 -0
- data/vendor/local/include/unicode/std_string.h +37 -0
- data/vendor/local/include/unicode/strenum.h +276 -0
- data/vendor/local/include/unicode/stringpiece.h +224 -0
- data/vendor/local/include/unicode/stringtriebuilder.h +402 -0
- data/vendor/local/include/unicode/stsearch.h +504 -0
- data/vendor/local/include/unicode/symtable.h +112 -0
- data/vendor/local/include/unicode/tblcoll.h +873 -0
- data/vendor/local/include/unicode/timezone.h +948 -0
- data/vendor/local/include/unicode/tmunit.h +129 -0
- data/vendor/local/include/unicode/tmutamt.h +168 -0
- data/vendor/local/include/unicode/tmutfmt.h +243 -0
- data/vendor/local/include/unicode/translit.h +1342 -0
- data/vendor/local/include/unicode/tzfmt.h +1098 -0
- data/vendor/local/include/unicode/tznames.h +404 -0
- data/vendor/local/include/unicode/tzrule.h +828 -0
- data/vendor/local/include/unicode/tztrans.h +195 -0
- data/vendor/local/include/unicode/ubidi.h +2186 -0
- data/vendor/local/include/unicode/ubrk.h +540 -0
- data/vendor/local/include/unicode/ucal.h +1560 -0
- data/vendor/local/include/unicode/ucasemap.h +423 -0
- data/vendor/local/include/unicode/ucat.h +158 -0
- data/vendor/local/include/unicode/uchar.h +3426 -0
- data/vendor/local/include/unicode/ucharstrie.h +576 -0
- data/vendor/local/include/unicode/ucharstriebuilder.h +185 -0
- data/vendor/local/include/unicode/uchriter.h +381 -0
- data/vendor/local/include/unicode/uclean.h +258 -0
- data/vendor/local/include/unicode/ucnv.h +2036 -0
- data/vendor/local/include/unicode/ucnv_cb.h +162 -0
- data/vendor/local/include/unicode/ucnv_err.h +463 -0
- data/vendor/local/include/unicode/ucnvsel.h +187 -0
- data/vendor/local/include/unicode/ucol.h +1474 -0
- data/vendor/local/include/unicode/ucoleitr.h +266 -0
- data/vendor/local/include/unicode/uconfig.h +430 -0
- data/vendor/local/include/unicode/ucsdet.h +413 -0
- data/vendor/local/include/unicode/ucurr.h +424 -0
- data/vendor/local/include/unicode/udat.h +1536 -0
- data/vendor/local/include/unicode/udata.h +430 -0
- data/vendor/local/include/unicode/udateintervalformat.h +181 -0
- data/vendor/local/include/unicode/udatpg.h +588 -0
- data/vendor/local/include/unicode/udisplaycontext.h +150 -0
- data/vendor/local/include/unicode/uenum.h +206 -0
- data/vendor/local/include/unicode/uformattable.h +280 -0
- data/vendor/local/include/unicode/ugender.h +82 -0
- data/vendor/local/include/unicode/uidna.h +762 -0
- data/vendor/local/include/unicode/uiter.h +707 -0
- data/vendor/local/include/unicode/uldnames.h +302 -0
- data/vendor/local/include/unicode/uloc.h +1256 -0
- data/vendor/local/include/unicode/ulocdata.h +277 -0
- data/vendor/local/include/unicode/umachine.h +356 -0
- data/vendor/local/include/unicode/umisc.h +60 -0
- data/vendor/local/include/unicode/umsg.h +623 -0
- data/vendor/local/include/unicode/unifilt.h +120 -0
- data/vendor/local/include/unicode/unifunct.h +125 -0
- data/vendor/local/include/unicode/unimatch.h +163 -0
- data/vendor/local/include/unicode/unirepl.h +97 -0
- data/vendor/local/include/unicode/uniset.h +1691 -0
- data/vendor/local/include/unicode/unistr.h +4470 -0
- data/vendor/local/include/unicode/unorm.h +561 -0
- data/vendor/local/include/unicode/unorm2.h +528 -0
- data/vendor/local/include/unicode/unum.h +1328 -0
- data/vendor/local/include/unicode/unumsys.h +170 -0
- data/vendor/local/include/unicode/uobject.h +320 -0
- data/vendor/local/include/unicode/upluralrules.h +145 -0
- data/vendor/local/include/unicode/uregex.h +1591 -0
- data/vendor/local/include/unicode/uregion.h +248 -0
- data/vendor/local/include/unicode/urename.h +1784 -0
- data/vendor/local/include/unicode/urep.h +155 -0
- data/vendor/local/include/unicode/ures.h +887 -0
- data/vendor/local/include/unicode/uscript.h +642 -0
- data/vendor/local/include/unicode/usearch.h +885 -0
- data/vendor/local/include/unicode/uset.h +1126 -0
- data/vendor/local/include/unicode/usetiter.h +318 -0
- data/vendor/local/include/unicode/ushape.h +474 -0
- data/vendor/local/include/unicode/uspoof.h +1064 -0
- data/vendor/local/include/unicode/usprep.h +269 -0
- data/vendor/local/include/unicode/ustdio.h +1018 -0
- data/vendor/local/include/unicode/ustream.h +68 -0
- data/vendor/local/include/unicode/ustring.h +1700 -0
- data/vendor/local/include/unicode/ustringtrie.h +95 -0
- data/vendor/local/include/unicode/utext.h +1600 -0
- data/vendor/local/include/unicode/utf.h +223 -0
- data/vendor/local/include/unicode/utf16.h +623 -0
- data/vendor/local/include/unicode/utf32.h +23 -0
- data/vendor/local/include/unicode/utf8.h +824 -0
- data/vendor/local/include/unicode/utf_old.h +1169 -0
- data/vendor/local/include/unicode/utmscale.h +481 -0
- data/vendor/local/include/unicode/utrace.h +359 -0
- data/vendor/local/include/unicode/utrans.h +658 -0
- data/vendor/local/include/unicode/utypes.h +723 -0
- data/vendor/local/include/unicode/uvernum.h +170 -0
- data/vendor/local/include/unicode/uversion.h +193 -0
- data/vendor/local/include/unicode/vtzone.h +455 -0
- data/vendor/local/lib/girepository-1.0/Pango-1.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/PangoCairo-1.0.typelib +0 -0
- data/vendor/local/lib/girepository-1.0/PangoFT2-1.0.typelib +0 -0
- data/vendor/local/lib/icu/54.1/Makefile.inc +293 -0
- data/vendor/local/lib/icu/54.1/pkgdata.inc +17 -0
- data/vendor/local/lib/icu/Makefile.inc +293 -0
- data/vendor/local/lib/icu/pkgdata.inc +17 -0
- data/vendor/local/lib/icudt.dll +0 -0
- data/vendor/local/lib/icudt54.dll +0 -0
- data/vendor/local/lib/icuin.dll +0 -0
- data/vendor/local/lib/icuin54.dll +0 -0
- data/vendor/local/lib/icuio.dll +0 -0
- data/vendor/local/lib/icuio54.dll +0 -0
- data/vendor/local/lib/icule.dll +0 -0
- data/vendor/local/lib/icule54.dll +0 -0
- data/vendor/local/lib/iculx.dll +0 -0
- data/vendor/local/lib/iculx54.dll +0 -0
- data/vendor/local/lib/icutest.dll +0 -0
- data/vendor/local/lib/icutest54.dll +0 -0
- data/vendor/local/lib/icutu.dll +0 -0
- data/vendor/local/lib/icutu54.dll +0 -0
- data/vendor/local/lib/icuuc.dll +0 -0
- data/vendor/local/lib/icuuc54.dll +0 -0
- data/vendor/local/lib/libharfbuzz-icu.a +0 -0
- data/vendor/local/lib/libharfbuzz-icu.la +41 -0
- data/vendor/local/lib/libharfbuzz.dll.a +0 -0
- data/vendor/local/lib/libharfbuzz.la +3 -3
- data/vendor/local/lib/libicudt.dll.a +0 -0
- data/vendor/local/lib/libicuin.dll.a +0 -0
- data/vendor/local/lib/libicuio.dll.a +0 -0
- data/vendor/local/lib/libicule.dll.a +0 -0
- data/vendor/local/lib/libiculx.dll.a +0 -0
- data/vendor/local/lib/libicutest.dll.a +0 -0
- data/vendor/local/lib/libicutu.dll.a +0 -0
- data/vendor/local/lib/libicuuc.dll.a +0 -0
- data/vendor/local/lib/libpango-1.0.dll.a +0 -0
- data/vendor/local/lib/libpango-1.0.la +2 -2
- data/vendor/local/lib/libpangocairo-1.0.dll.a +0 -0
- data/vendor/local/lib/libpangocairo-1.0.la +2 -2
- data/vendor/local/lib/libpangoft2-1.0.dll.a +0 -0
- data/vendor/local/lib/libpangoft2-1.0.la +2 -2
- data/vendor/local/lib/libpangowin32-1.0.dll.a +0 -0
- data/vendor/local/lib/libpangowin32-1.0.la +2 -2
- data/vendor/local/lib/pango/1.8.0/modules/pango-arabic-lang.dll +0 -0
- data/vendor/local/lib/pango/1.8.0/modules/pango-arabic-lang.dll.a +0 -0
- data/vendor/local/lib/pango/1.8.0/modules/pango-arabic-lang.la +1 -1
- data/vendor/local/lib/pango/1.8.0/modules/pango-basic-fc.dll +0 -0
- data/vendor/local/lib/pango/1.8.0/modules/pango-basic-fc.dll.a +0 -0
- data/vendor/local/lib/pango/1.8.0/modules/pango-basic-fc.la +1 -1
- data/vendor/local/lib/pango/1.8.0/modules/pango-basic-win32.dll +0 -0
- data/vendor/local/lib/pango/1.8.0/modules/pango-basic-win32.dll.a +0 -0
- data/vendor/local/lib/pango/1.8.0/modules/pango-basic-win32.la +1 -1
- data/vendor/local/lib/pango/1.8.0/modules/pango-indic-lang.dll +0 -0
- data/vendor/local/lib/pango/1.8.0/modules/pango-indic-lang.dll.a +0 -0
- data/vendor/local/lib/pango/1.8.0/modules/pango-indic-lang.la +1 -1
- data/vendor/local/lib/pkgconfig/harfbuzz-icu.pc +13 -0
- data/vendor/local/lib/pkgconfig/harfbuzz.pc +1 -1
- data/vendor/local/lib/pkgconfig/icu-i18n.pc +38 -0
- data/vendor/local/lib/pkgconfig/icu-io.pc +38 -0
- data/vendor/local/lib/pkgconfig/icu-le.pc +38 -0
- data/vendor/local/lib/pkgconfig/icu-lx.pc +38 -0
- data/vendor/local/lib/pkgconfig/icu-uc.pc +38 -0
- data/vendor/local/lib/pkgconfig/pango.pc +1 -1
- data/vendor/local/lib/pkgconfig/pangocairo.pc +1 -1
- data/vendor/local/lib/pkgconfig/pangoft2.pc +1 -1
- data/vendor/local/lib/pkgconfig/pangowin32.pc +1 -1
- data/vendor/local/share/gir-1.0/Pango-1.0.gir +3009 -462
- data/vendor/local/share/gir-1.0/PangoCairo-1.0.gir +64 -22
- data/vendor/local/share/gir-1.0/PangoFT2-1.0.gir +4 -2
- data/vendor/local/share/gtk-doc/html/harfbuzz/annotation-glossary.html +30 -26
- data/vendor/local/share/gtk-doc/html/harfbuzz/api-index-full.html +343 -313
- data/vendor/local/share/gtk-doc/html/harfbuzz/ch01.html +5 -5
- data/vendor/local/share/gtk-doc/html/harfbuzz/deprecated-api-index.html +6 -8
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-blob.html +442 -247
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-buffer.html +1389 -654
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-common.html +954 -698
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-coretext.html +95 -18
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-deprecated.html +36 -27
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-face.html +477 -191
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-font.html +1951 -1039
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-ft.html +123 -65
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-glib.html +66 -21
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-gobject.html +11 -13
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-graphite2.html +67 -23
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-icu.html +66 -21
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-ot-layout.html +574 -347
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-ot-tag.html +104 -37
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-ot.html +10 -27
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-set.html +744 -318
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-shape-plan.html +294 -153
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-shape.html +196 -104
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-unicode.html +1100 -757
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-uniscribe.html +51 -18
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-version.html +110 -84
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb.html +11 -13
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz.devhelp2 +289 -503
- data/vendor/local/share/gtk-doc/html/harfbuzz/index.html +3 -3
- data/vendor/local/share/gtk-doc/html/harfbuzz/index.sgml +161 -316
- data/vendor/local/share/gtk-doc/html/harfbuzz/object-tree.html +31 -4
- data/vendor/local/share/gtk-doc/html/harfbuzz/style.css +260 -105
- data/vendor/local/share/gtk-doc/html/pango/PangoEngineLang.html +143 -105
- data/vendor/local/share/gtk-doc/html/pango/PangoEngineShape.html +150 -108
- data/vendor/local/share/gtk-doc/html/pango/PangoFcDecoder.html +163 -112
- data/vendor/local/share/gtk-doc/html/pango/PangoFcFont.html +348 -229
- data/vendor/local/share/gtk-doc/html/pango/PangoFcFontMap.html +746 -514
- data/vendor/local/share/gtk-doc/html/pango/PangoMarkupFormat.html +9 -9
- data/vendor/local/share/gtk-doc/html/pango/PangoRenderer.html +853 -623
- data/vendor/local/share/gtk-doc/html/pango/annotation-glossary.html +29 -13
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-10.html +31 -33
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-12.html +10 -12
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-14.html +12 -14
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-16.html +53 -55
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-18.html +28 -30
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-2.html +29 -31
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-20.html +17 -19
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-22.html +28 -30
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-24.html +17 -19
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-26.html +9 -11
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-30.html +6 -6
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-31-0.html +6 -6
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-32-4.html +11 -13
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-32.html +7 -9
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-34.html +5 -5
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-4.html +49 -51
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-6.html +36 -38
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-8.html +37 -39
- data/vendor/local/share/gtk-doc/html/pango/api-index-deprecated.html +68 -70
- data/vendor/local/share/gtk-doc/html/pango/api-index-full.html +568 -570
- data/vendor/local/share/gtk-doc/html/pango/index.html +3 -3
- data/vendor/local/share/gtk-doc/html/pango/index.sgml +229 -399
- data/vendor/local/share/gtk-doc/html/pango/lowlevel.html +4 -4
- data/vendor/local/share/gtk-doc/html/pango/pango-Bidirectional-Text.html +345 -259
- data/vendor/local/share/gtk-doc/html/pango/pango-Cairo-Rendering.html +979 -664
- data/vendor/local/share/gtk-doc/html/pango/pango-CoreText-Fonts.html +70 -43
- data/vendor/local/share/gtk-doc/html/pango/pango-Coverage-Maps.html +349 -229
- data/vendor/local/share/gtk-doc/html/pango/pango-Engines.html +236 -153
- data/vendor/local/share/gtk-doc/html/pango/pango-Fonts.html +3100 -2159
- data/vendor/local/share/gtk-doc/html/pango/pango-FreeType-Fonts-and-Rendering.html +659 -472
- data/vendor/local/share/gtk-doc/html/pango/pango-Glyph-Storage.html +1952 -1384
- data/vendor/local/share/gtk-doc/html/pango/pango-Layout-Objects.html +3050 -2135
- data/vendor/local/share/gtk-doc/html/pango/pango-Miscellaneous-Utilities.html +676 -463
- data/vendor/local/share/gtk-doc/html/pango/pango-Modules.html +223 -146
- data/vendor/local/share/gtk-doc/html/pango/pango-OpenType-Font-Handling.html +1589 -1199
- data/vendor/local/share/gtk-doc/html/pango/pango-Scripts-and-Languages.html +1072 -842
- data/vendor/local/share/gtk-doc/html/pango/pango-Tab-Stops.html +406 -276
- data/vendor/local/share/gtk-doc/html/pango/pango-Text-Attributes.html +2541 -1792
- data/vendor/local/share/gtk-doc/html/pango/pango-Text-Processing.html +1479 -1033
- data/vendor/local/share/gtk-doc/html/pango/pango-Version-Checking.html +214 -154
- data/vendor/local/share/gtk-doc/html/pango/pango-Vertical-Text.html +374 -291
- data/vendor/local/share/gtk-doc/html/pango/pango-Win32-Fonts-and-Rendering.html +733 -498
- data/vendor/local/share/gtk-doc/html/pango/pango-Xft-Fonts-and-Rendering.html +893 -617
- data/vendor/local/share/gtk-doc/html/pango/pango-hierarchy.html +59 -59
- data/vendor/local/share/gtk-doc/html/pango/pango-querymodules.html +5 -5
- data/vendor/local/share/gtk-doc/html/pango/pango.devhelp2 +578 -782
- data/vendor/local/share/gtk-doc/html/pango/pango.html +4 -4
- data/vendor/local/share/gtk-doc/html/pango/rendering.html +4 -4
- data/vendor/local/share/gtk-doc/html/pango/style.css +260 -105
- data/vendor/local/share/gtk-doc/html/pango/tools.html +4 -4
- data/vendor/local/share/icu/54.1/config/mh-mingw +158 -0
- data/vendor/local/share/icu/54.1/install-sh +251 -0
- data/vendor/local/share/icu/54.1/license.html +385 -0
- data/vendor/local/share/icu/54.1/mkinstalldirs +43 -0
- data/vendor/local/share/license/harfbuzz/AUTHORS +1 -0
- data/vendor/local/share/man/man1/derb.1 +196 -0
- data/vendor/local/share/man/man1/genbrk.1 +112 -0
- data/vendor/local/share/man/man1/gencfu.1 +91 -0
- data/vendor/local/share/man/man1/gencnval.1 +91 -0
- data/vendor/local/share/man/man1/gendict.1 +131 -0
- data/vendor/local/share/man/man1/genrb.1 +146 -0
- data/vendor/local/share/man/man1/icu-config.1 +288 -0
- data/vendor/local/share/man/man1/makeconv.1 +112 -0
- data/vendor/local/share/man/man1/pango-querymodules.1 +2 -2
- data/vendor/local/share/man/man1/pango-view.1 +1 -118
- data/vendor/local/share/man/man1/pkgdata.1 +258 -0
- data/vendor/local/share/man/man1/uconv.1 +443 -0
- data/vendor/local/share/man/man8/genccode.8 +106 -0
- data/vendor/local/share/man/man8/gencmn.8 +129 -0
- data/vendor/local/share/man/man8/gensprep.8 +102 -0
- data/vendor/local/share/man/man8/icupkg.8 +204 -0
- metadata +266 -14
- data/lib/1.9/pango.so +0 -0
- data/lib/2.1/pango.so +0 -0
@@ -0,0 +1,404 @@
|
|
1
|
+
/*
|
2
|
+
******************************************************************************
|
3
|
+
* Copyright (C) 1997-2014, International Business Machines
|
4
|
+
* Corporation and others. All Rights Reserved.
|
5
|
+
******************************************************************************
|
6
|
+
*/
|
7
|
+
|
8
|
+
/**
|
9
|
+
* \file
|
10
|
+
* \brief C++ API: Collation Element Iterator.
|
11
|
+
*/
|
12
|
+
|
13
|
+
/**
|
14
|
+
* File coleitr.h
|
15
|
+
*
|
16
|
+
* Created by: Helena Shih
|
17
|
+
*
|
18
|
+
* Modification History:
|
19
|
+
*
|
20
|
+
* Date Name Description
|
21
|
+
*
|
22
|
+
* 8/18/97 helena Added internal API documentation.
|
23
|
+
* 08/03/98 erm Synched with 1.2 version CollationElementIterator.java
|
24
|
+
* 12/10/99 aliu Ported Thai collation support from Java.
|
25
|
+
* 01/25/01 swquek Modified into a C++ wrapper calling C APIs (ucoliter.h)
|
26
|
+
* 02/19/01 swquek Removed CollationElementsIterator() since it is
|
27
|
+
* private constructor and no calls are made to it
|
28
|
+
* 2012-2014 markus Rewritten in C++ again.
|
29
|
+
*/
|
30
|
+
|
31
|
+
#ifndef COLEITR_H
|
32
|
+
#define COLEITR_H
|
33
|
+
|
34
|
+
#include "unicode/utypes.h"
|
35
|
+
|
36
|
+
#if !UCONFIG_NO_COLLATION
|
37
|
+
|
38
|
+
#include "unicode/unistr.h"
|
39
|
+
#include "unicode/uobject.h"
|
40
|
+
|
41
|
+
struct UCollationElements;
|
42
|
+
struct UHashtable;
|
43
|
+
|
44
|
+
U_NAMESPACE_BEGIN
|
45
|
+
|
46
|
+
struct CollationData;
|
47
|
+
|
48
|
+
class CollationIterator;
|
49
|
+
class RuleBasedCollator;
|
50
|
+
class UCollationPCE;
|
51
|
+
class UVector32;
|
52
|
+
|
53
|
+
/**
|
54
|
+
* The CollationElementIterator class is used as an iterator to walk through
|
55
|
+
* each character of an international string. Use the iterator to return the
|
56
|
+
* ordering priority of the positioned character. The ordering priority of a
|
57
|
+
* character, which we refer to as a key, defines how a character is collated in
|
58
|
+
* the given collation object.
|
59
|
+
* For example, consider the following in Slovak and in traditional Spanish collation:
|
60
|
+
* <pre>
|
61
|
+
* "ca" -> the first key is key('c') and second key is key('a').
|
62
|
+
* "cha" -> the first key is key('ch') and second key is key('a').</pre>
|
63
|
+
* And in German phonebook collation,
|
64
|
+
* <pre> \htmlonly "æb"-> the first key is key('a'), the second key is key('e'), and
|
65
|
+
* the third key is key('b'). \endhtmlonly </pre>
|
66
|
+
* The key of a character, is an integer composed of primary order(short),
|
67
|
+
* secondary order(char), and tertiary order(char). Java strictly defines the
|
68
|
+
* size and signedness of its primitive data types. Therefore, the static
|
69
|
+
* functions primaryOrder(), secondaryOrder(), and tertiaryOrder() return
|
70
|
+
* int32_t to ensure the correctness of the key value.
|
71
|
+
* <p>Example of the iterator usage: (without error checking)
|
72
|
+
* <pre>
|
73
|
+
* \code
|
74
|
+
* void CollationElementIterator_Example()
|
75
|
+
* {
|
76
|
+
* UnicodeString str = "This is a test";
|
77
|
+
* UErrorCode success = U_ZERO_ERROR;
|
78
|
+
* RuleBasedCollator* rbc =
|
79
|
+
* (RuleBasedCollator*) RuleBasedCollator::createInstance(success);
|
80
|
+
* CollationElementIterator* c =
|
81
|
+
* rbc->createCollationElementIterator( str );
|
82
|
+
* int32_t order = c->next(success);
|
83
|
+
* c->reset();
|
84
|
+
* order = c->previous(success);
|
85
|
+
* delete c;
|
86
|
+
* delete rbc;
|
87
|
+
* }
|
88
|
+
* \endcode
|
89
|
+
* </pre>
|
90
|
+
* <p>
|
91
|
+
* The method next() returns the collation order of the next character based on
|
92
|
+
* the comparison level of the collator. The method previous() returns the
|
93
|
+
* collation order of the previous character based on the comparison level of
|
94
|
+
* the collator. The Collation Element Iterator moves only in one direction
|
95
|
+
* between calls to reset(), setOffset(), or setText(). That is, next()
|
96
|
+
* and previous() can not be inter-used. Whenever previous() is to be called after
|
97
|
+
* next() or vice versa, reset(), setOffset() or setText() has to be called first
|
98
|
+
* to reset the status, shifting pointers to either the end or the start of
|
99
|
+
* the string (reset() or setText()), or the specified position (setOffset()).
|
100
|
+
* Hence at the next call of next() or previous(), the first or last collation order,
|
101
|
+
* or collation order at the spefcifieid position will be returned. If a change of
|
102
|
+
* direction is done without one of these calls, the result is undefined.
|
103
|
+
* <p>
|
104
|
+
* The result of a forward iterate (next()) and reversed result of the backward
|
105
|
+
* iterate (previous()) on the same string are equivalent, if collation orders
|
106
|
+
* with the value 0 are ignored.
|
107
|
+
* Character based on the comparison level of the collator. A collation order
|
108
|
+
* consists of primary order, secondary order and tertiary order. The data
|
109
|
+
* type of the collation order is <strong>int32_t</strong>.
|
110
|
+
*
|
111
|
+
* Note, CollationElementIterator should not be subclassed.
|
112
|
+
* @see Collator
|
113
|
+
* @see RuleBasedCollator
|
114
|
+
* @version 1.8 Jan 16 2001
|
115
|
+
*/
|
116
|
+
class U_I18N_API CollationElementIterator U_FINAL : public UObject {
|
117
|
+
public:
|
118
|
+
|
119
|
+
// CollationElementIterator public data member ------------------------------
|
120
|
+
|
121
|
+
enum {
|
122
|
+
/**
|
123
|
+
* NULLORDER indicates that an error has occured while processing
|
124
|
+
* @stable ICU 2.0
|
125
|
+
*/
|
126
|
+
NULLORDER = (int32_t)0xffffffff
|
127
|
+
};
|
128
|
+
|
129
|
+
// CollationElementIterator public constructor/destructor -------------------
|
130
|
+
|
131
|
+
/**
|
132
|
+
* Copy constructor.
|
133
|
+
*
|
134
|
+
* @param other the object to be copied from
|
135
|
+
* @stable ICU 2.0
|
136
|
+
*/
|
137
|
+
CollationElementIterator(const CollationElementIterator& other);
|
138
|
+
|
139
|
+
/**
|
140
|
+
* Destructor
|
141
|
+
* @stable ICU 2.0
|
142
|
+
*/
|
143
|
+
virtual ~CollationElementIterator();
|
144
|
+
|
145
|
+
// CollationElementIterator public methods ----------------------------------
|
146
|
+
|
147
|
+
/**
|
148
|
+
* Returns true if "other" is the same as "this"
|
149
|
+
*
|
150
|
+
* @param other the object to be compared
|
151
|
+
* @return true if "other" is the same as "this"
|
152
|
+
* @stable ICU 2.0
|
153
|
+
*/
|
154
|
+
UBool operator==(const CollationElementIterator& other) const;
|
155
|
+
|
156
|
+
/**
|
157
|
+
* Returns true if "other" is not the same as "this".
|
158
|
+
*
|
159
|
+
* @param other the object to be compared
|
160
|
+
* @return true if "other" is not the same as "this"
|
161
|
+
* @stable ICU 2.0
|
162
|
+
*/
|
163
|
+
UBool operator!=(const CollationElementIterator& other) const;
|
164
|
+
|
165
|
+
/**
|
166
|
+
* Resets the cursor to the beginning of the string.
|
167
|
+
* @stable ICU 2.0
|
168
|
+
*/
|
169
|
+
void reset(void);
|
170
|
+
|
171
|
+
/**
|
172
|
+
* Gets the ordering priority of the next character in the string.
|
173
|
+
* @param status the error code status.
|
174
|
+
* @return the next character's ordering. otherwise returns NULLORDER if an
|
175
|
+
* error has occured or if the end of string has been reached
|
176
|
+
* @stable ICU 2.0
|
177
|
+
*/
|
178
|
+
int32_t next(UErrorCode& status);
|
179
|
+
|
180
|
+
/**
|
181
|
+
* Get the ordering priority of the previous collation element in the string.
|
182
|
+
* @param status the error code status.
|
183
|
+
* @return the previous element's ordering. otherwise returns NULLORDER if an
|
184
|
+
* error has occured or if the start of string has been reached
|
185
|
+
* @stable ICU 2.0
|
186
|
+
*/
|
187
|
+
int32_t previous(UErrorCode& status);
|
188
|
+
|
189
|
+
/**
|
190
|
+
* Gets the primary order of a collation order.
|
191
|
+
* @param order the collation order
|
192
|
+
* @return the primary order of a collation order.
|
193
|
+
* @stable ICU 2.0
|
194
|
+
*/
|
195
|
+
static inline int32_t primaryOrder(int32_t order);
|
196
|
+
|
197
|
+
/**
|
198
|
+
* Gets the secondary order of a collation order.
|
199
|
+
* @param order the collation order
|
200
|
+
* @return the secondary order of a collation order.
|
201
|
+
* @stable ICU 2.0
|
202
|
+
*/
|
203
|
+
static inline int32_t secondaryOrder(int32_t order);
|
204
|
+
|
205
|
+
/**
|
206
|
+
* Gets the tertiary order of a collation order.
|
207
|
+
* @param order the collation order
|
208
|
+
* @return the tertiary order of a collation order.
|
209
|
+
* @stable ICU 2.0
|
210
|
+
*/
|
211
|
+
static inline int32_t tertiaryOrder(int32_t order);
|
212
|
+
|
213
|
+
/**
|
214
|
+
* Return the maximum length of any expansion sequences that end with the
|
215
|
+
* specified comparison order.
|
216
|
+
* @param order a collation order returned by previous or next.
|
217
|
+
* @return maximum size of the expansion sequences ending with the collation
|
218
|
+
* element or 1 if collation element does not occur at the end of any
|
219
|
+
* expansion sequence
|
220
|
+
* @stable ICU 2.0
|
221
|
+
*/
|
222
|
+
int32_t getMaxExpansion(int32_t order) const;
|
223
|
+
|
224
|
+
/**
|
225
|
+
* Gets the comparison order in the desired strength. Ignore the other
|
226
|
+
* differences.
|
227
|
+
* @param order The order value
|
228
|
+
* @stable ICU 2.0
|
229
|
+
*/
|
230
|
+
int32_t strengthOrder(int32_t order) const;
|
231
|
+
|
232
|
+
/**
|
233
|
+
* Sets the source string.
|
234
|
+
* @param str the source string.
|
235
|
+
* @param status the error code status.
|
236
|
+
* @stable ICU 2.0
|
237
|
+
*/
|
238
|
+
void setText(const UnicodeString& str, UErrorCode& status);
|
239
|
+
|
240
|
+
/**
|
241
|
+
* Sets the source string.
|
242
|
+
* @param str the source character iterator.
|
243
|
+
* @param status the error code status.
|
244
|
+
* @stable ICU 2.0
|
245
|
+
*/
|
246
|
+
void setText(CharacterIterator& str, UErrorCode& status);
|
247
|
+
|
248
|
+
/**
|
249
|
+
* Checks if a comparison order is ignorable.
|
250
|
+
* @param order the collation order.
|
251
|
+
* @return TRUE if a character is ignorable, FALSE otherwise.
|
252
|
+
* @stable ICU 2.0
|
253
|
+
*/
|
254
|
+
static inline UBool isIgnorable(int32_t order);
|
255
|
+
|
256
|
+
/**
|
257
|
+
* Gets the offset of the currently processed character in the source string.
|
258
|
+
* @return the offset of the character.
|
259
|
+
* @stable ICU 2.0
|
260
|
+
*/
|
261
|
+
int32_t getOffset(void) const;
|
262
|
+
|
263
|
+
/**
|
264
|
+
* Sets the offset of the currently processed character in the source string.
|
265
|
+
* @param newOffset the new offset.
|
266
|
+
* @param status the error code status.
|
267
|
+
* @return the offset of the character.
|
268
|
+
* @stable ICU 2.0
|
269
|
+
*/
|
270
|
+
void setOffset(int32_t newOffset, UErrorCode& status);
|
271
|
+
|
272
|
+
/**
|
273
|
+
* ICU "poor man's RTTI", returns a UClassID for the actual class.
|
274
|
+
*
|
275
|
+
* @stable ICU 2.2
|
276
|
+
*/
|
277
|
+
virtual UClassID getDynamicClassID() const;
|
278
|
+
|
279
|
+
/**
|
280
|
+
* ICU "poor man's RTTI", returns a UClassID for this class.
|
281
|
+
*
|
282
|
+
* @stable ICU 2.2
|
283
|
+
*/
|
284
|
+
static UClassID U_EXPORT2 getStaticClassID();
|
285
|
+
|
286
|
+
#ifndef U_HIDE_INTERNAL_API
|
287
|
+
/** @internal */
|
288
|
+
static inline CollationElementIterator *fromUCollationElements(UCollationElements *uc) {
|
289
|
+
return reinterpret_cast<CollationElementIterator *>(uc);
|
290
|
+
}
|
291
|
+
/** @internal */
|
292
|
+
static inline const CollationElementIterator *fromUCollationElements(const UCollationElements *uc) {
|
293
|
+
return reinterpret_cast<const CollationElementIterator *>(uc);
|
294
|
+
}
|
295
|
+
/** @internal */
|
296
|
+
inline UCollationElements *toUCollationElements() {
|
297
|
+
return reinterpret_cast<UCollationElements *>(this);
|
298
|
+
}
|
299
|
+
/** @internal */
|
300
|
+
inline const UCollationElements *toUCollationElements() const {
|
301
|
+
return reinterpret_cast<const UCollationElements *>(this);
|
302
|
+
}
|
303
|
+
#endif // U_HIDE_INTERNAL_API
|
304
|
+
|
305
|
+
private:
|
306
|
+
friend class RuleBasedCollator;
|
307
|
+
friend class UCollationPCE;
|
308
|
+
|
309
|
+
/**
|
310
|
+
* CollationElementIterator constructor. This takes the source string and the
|
311
|
+
* collation object. The cursor will walk thru the source string based on the
|
312
|
+
* predefined collation rules. If the source string is empty, NULLORDER will
|
313
|
+
* be returned on the calls to next().
|
314
|
+
* @param sourceText the source string.
|
315
|
+
* @param order the collation object.
|
316
|
+
* @param status the error code status.
|
317
|
+
*/
|
318
|
+
CollationElementIterator(const UnicodeString& sourceText,
|
319
|
+
const RuleBasedCollator* order, UErrorCode& status);
|
320
|
+
// Note: The constructors should take settings & tailoring, not a collator,
|
321
|
+
// to avoid circular dependencies.
|
322
|
+
// However, for operator==() we would need to be able to compare tailoring data for equality
|
323
|
+
// without making CollationData or CollationTailoring depend on TailoredSet.
|
324
|
+
// (See the implementation of RuleBasedCollator::operator==().)
|
325
|
+
// That might require creating an intermediate class that would be used
|
326
|
+
// by both CollationElementIterator and RuleBasedCollator
|
327
|
+
// but only contain the part of RBC== related to data and rules.
|
328
|
+
|
329
|
+
/**
|
330
|
+
* CollationElementIterator constructor. This takes the source string and the
|
331
|
+
* collation object. The cursor will walk thru the source string based on the
|
332
|
+
* predefined collation rules. If the source string is empty, NULLORDER will
|
333
|
+
* be returned on the calls to next().
|
334
|
+
* @param sourceText the source string.
|
335
|
+
* @param order the collation object.
|
336
|
+
* @param status the error code status.
|
337
|
+
*/
|
338
|
+
CollationElementIterator(const CharacterIterator& sourceText,
|
339
|
+
const RuleBasedCollator* order, UErrorCode& status);
|
340
|
+
|
341
|
+
/**
|
342
|
+
* Assignment operator
|
343
|
+
*
|
344
|
+
* @param other the object to be copied
|
345
|
+
*/
|
346
|
+
const CollationElementIterator&
|
347
|
+
operator=(const CollationElementIterator& other);
|
348
|
+
|
349
|
+
CollationElementIterator(); // default constructor not implemented
|
350
|
+
|
351
|
+
/** Normalizes dir_=1 (just after setOffset()) to dir_=0 (just after reset()). */
|
352
|
+
inline int8_t normalizeDir() const { return dir_ == 1 ? 0 : dir_; }
|
353
|
+
|
354
|
+
static UHashtable *computeMaxExpansions(const CollationData *data, UErrorCode &errorCode);
|
355
|
+
|
356
|
+
static int32_t getMaxExpansion(const UHashtable *maxExpansions, int32_t order);
|
357
|
+
|
358
|
+
// CollationElementIterator private data members ----------------------------
|
359
|
+
|
360
|
+
CollationIterator *iter_; // owned
|
361
|
+
const RuleBasedCollator *rbc_; // aliased
|
362
|
+
uint32_t otherHalf_;
|
363
|
+
/**
|
364
|
+
* <0: backwards; 0: just after reset() (previous() begins from end);
|
365
|
+
* 1: just after setOffset(); >1: forward
|
366
|
+
*/
|
367
|
+
int8_t dir_;
|
368
|
+
/**
|
369
|
+
* Stores offsets from expansions and from unsafe-backwards iteration,
|
370
|
+
* so that getOffset() returns intermediate offsets for the CEs
|
371
|
+
* that are consistent with forward iteration.
|
372
|
+
*/
|
373
|
+
UVector32 *offsets_;
|
374
|
+
|
375
|
+
UnicodeString string_;
|
376
|
+
};
|
377
|
+
|
378
|
+
// CollationElementIterator inline method definitions --------------------------
|
379
|
+
|
380
|
+
inline int32_t CollationElementIterator::primaryOrder(int32_t order)
|
381
|
+
{
|
382
|
+
return (order >> 16) & 0xffff;
|
383
|
+
}
|
384
|
+
|
385
|
+
inline int32_t CollationElementIterator::secondaryOrder(int32_t order)
|
386
|
+
{
|
387
|
+
return (order >> 8) & 0xff;
|
388
|
+
}
|
389
|
+
|
390
|
+
inline int32_t CollationElementIterator::tertiaryOrder(int32_t order)
|
391
|
+
{
|
392
|
+
return order & 0xff;
|
393
|
+
}
|
394
|
+
|
395
|
+
inline UBool CollationElementIterator::isIgnorable(int32_t order)
|
396
|
+
{
|
397
|
+
return (order & 0xffff0000) == 0;
|
398
|
+
}
|
399
|
+
|
400
|
+
U_NAMESPACE_END
|
401
|
+
|
402
|
+
#endif /* #if !UCONFIG_NO_COLLATION */
|
403
|
+
|
404
|
+
#endif
|
@@ -0,0 +1,1267 @@
|
|
1
|
+
/*
|
2
|
+
******************************************************************************
|
3
|
+
* Copyright (C) 1996-2014, International Business Machines
|
4
|
+
* Corporation and others. All Rights Reserved.
|
5
|
+
******************************************************************************
|
6
|
+
*/
|
7
|
+
|
8
|
+
/**
|
9
|
+
* \file
|
10
|
+
* \brief C++ API: Collation Service.
|
11
|
+
*/
|
12
|
+
|
13
|
+
/**
|
14
|
+
* File coll.h
|
15
|
+
*
|
16
|
+
* Created by: Helena Shih
|
17
|
+
*
|
18
|
+
* Modification History:
|
19
|
+
*
|
20
|
+
* Date Name Description
|
21
|
+
* 02/5/97 aliu Modified createDefault to load collation data from
|
22
|
+
* binary files when possible. Added related methods
|
23
|
+
* createCollationFromFile, chopLocale, createPathName.
|
24
|
+
* 02/11/97 aliu Added members addToCache, findInCache, and fgCache.
|
25
|
+
* 02/12/97 aliu Modified to create objects from RuleBasedCollator cache.
|
26
|
+
* Moved cache out of Collation class.
|
27
|
+
* 02/13/97 aliu Moved several methods out of this class and into
|
28
|
+
* RuleBasedCollator, with modifications. Modified
|
29
|
+
* createDefault() to call new RuleBasedCollator(Locale&)
|
30
|
+
* constructor. General clean up and documentation.
|
31
|
+
* 02/20/97 helena Added clone, operator==, operator!=, operator=, copy
|
32
|
+
* constructor and getDynamicClassID.
|
33
|
+
* 03/25/97 helena Updated with platform independent data types.
|
34
|
+
* 05/06/97 helena Added memory allocation error detection.
|
35
|
+
* 06/20/97 helena Java class name change.
|
36
|
+
* 09/03/97 helena Added createCollationKeyValues().
|
37
|
+
* 02/10/98 damiba Added compare() with length as parameter.
|
38
|
+
* 04/23/99 stephen Removed EDecompositionMode, merged with
|
39
|
+
* Normalizer::EMode.
|
40
|
+
* 11/02/99 helena Collator performance enhancements. Eliminates the
|
41
|
+
* UnicodeString construction and special case for NO_OP.
|
42
|
+
* 11/23/99 srl More performance enhancements. Inlining of
|
43
|
+
* critical accessors.
|
44
|
+
* 05/15/00 helena Added version information API.
|
45
|
+
* 01/29/01 synwee Modified into a C++ wrapper which calls C apis
|
46
|
+
* (ucol.h).
|
47
|
+
* 2012-2014 markus Rewritten in C++ again.
|
48
|
+
*/
|
49
|
+
|
50
|
+
#ifndef COLL_H
|
51
|
+
#define COLL_H
|
52
|
+
|
53
|
+
#include "unicode/utypes.h"
|
54
|
+
|
55
|
+
#if !UCONFIG_NO_COLLATION
|
56
|
+
|
57
|
+
#include "unicode/uobject.h"
|
58
|
+
#include "unicode/ucol.h"
|
59
|
+
#include "unicode/normlzr.h"
|
60
|
+
#include "unicode/locid.h"
|
61
|
+
#include "unicode/uniset.h"
|
62
|
+
#include "unicode/umisc.h"
|
63
|
+
#include "unicode/uiter.h"
|
64
|
+
#include "unicode/stringpiece.h"
|
65
|
+
|
66
|
+
U_NAMESPACE_BEGIN
|
67
|
+
|
68
|
+
class StringEnumeration;
|
69
|
+
|
70
|
+
#if !UCONFIG_NO_SERVICE
|
71
|
+
/**
|
72
|
+
* @stable ICU 2.6
|
73
|
+
*/
|
74
|
+
class CollatorFactory;
|
75
|
+
#endif
|
76
|
+
|
77
|
+
/**
|
78
|
+
* @stable ICU 2.0
|
79
|
+
*/
|
80
|
+
class CollationKey;
|
81
|
+
|
82
|
+
/**
|
83
|
+
* The <code>Collator</code> class performs locale-sensitive string
|
84
|
+
* comparison.<br>
|
85
|
+
* You use this class to build searching and sorting routines for natural
|
86
|
+
* language text.
|
87
|
+
* <p>
|
88
|
+
* <code>Collator</code> is an abstract base class. Subclasses implement
|
89
|
+
* specific collation strategies. One subclass,
|
90
|
+
* <code>RuleBasedCollator</code>, is currently provided and is applicable
|
91
|
+
* to a wide set of languages. Other subclasses may be created to handle more
|
92
|
+
* specialized needs.
|
93
|
+
* <p>
|
94
|
+
* Like other locale-sensitive classes, you can use the static factory method,
|
95
|
+
* <code>createInstance</code>, to obtain the appropriate
|
96
|
+
* <code>Collator</code> object for a given locale. You will only need to
|
97
|
+
* look at the subclasses of <code>Collator</code> if you need to
|
98
|
+
* understand the details of a particular collation strategy or if you need to
|
99
|
+
* modify that strategy.
|
100
|
+
* <p>
|
101
|
+
* The following example shows how to compare two strings using the
|
102
|
+
* <code>Collator</code> for the default locale.
|
103
|
+
* \htmlonly<blockquote>\endhtmlonly
|
104
|
+
* <pre>
|
105
|
+
* \code
|
106
|
+
* // Compare two strings in the default locale
|
107
|
+
* UErrorCode success = U_ZERO_ERROR;
|
108
|
+
* Collator* myCollator = Collator::createInstance(success);
|
109
|
+
* if (myCollator->compare("abc", "ABC") < 0)
|
110
|
+
* cout << "abc is less than ABC" << endl;
|
111
|
+
* else
|
112
|
+
* cout << "abc is greater than or equal to ABC" << endl;
|
113
|
+
* \endcode
|
114
|
+
* </pre>
|
115
|
+
* \htmlonly</blockquote>\endhtmlonly
|
116
|
+
* <p>
|
117
|
+
* You can set a <code>Collator</code>'s <em>strength</em> attribute to
|
118
|
+
* determine the level of difference considered significant in comparisons.
|
119
|
+
* Five strengths are provided: <code>PRIMARY</code>, <code>SECONDARY</code>,
|
120
|
+
* <code>TERTIARY</code>, <code>QUATERNARY</code> and <code>IDENTICAL</code>.
|
121
|
+
* The exact assignment of strengths to language features is locale dependent.
|
122
|
+
* For example, in Czech, "e" and "f" are considered primary differences,
|
123
|
+
* while "e" and "\u00EA" are secondary differences, "e" and "E" are tertiary
|
124
|
+
* differences and "e" and "e" are identical. The following shows how both case
|
125
|
+
* and accents could be ignored for US English.
|
126
|
+
* \htmlonly<blockquote>\endhtmlonly
|
127
|
+
* <pre>
|
128
|
+
* \code
|
129
|
+
* //Get the Collator for US English and set its strength to PRIMARY
|
130
|
+
* UErrorCode success = U_ZERO_ERROR;
|
131
|
+
* Collator* usCollator = Collator::createInstance(Locale::getUS(), success);
|
132
|
+
* usCollator->setStrength(Collator::PRIMARY);
|
133
|
+
* if (usCollator->compare("abc", "ABC") == 0)
|
134
|
+
* cout << "'abc' and 'ABC' strings are equivalent with strength PRIMARY" << endl;
|
135
|
+
* \endcode
|
136
|
+
* </pre>
|
137
|
+
* \htmlonly</blockquote>\endhtmlonly
|
138
|
+
*
|
139
|
+
* The <code>getSortKey</code> methods
|
140
|
+
* convert a string to a series of bytes that can be compared bitwise against
|
141
|
+
* other sort keys using <code>strcmp()</code>. Sort keys are written as
|
142
|
+
* zero-terminated byte strings.
|
143
|
+
*
|
144
|
+
* Another set of APIs returns a <code>CollationKey</code> object that wraps
|
145
|
+
* the sort key bytes instead of returning the bytes themselves.
|
146
|
+
* </p>
|
147
|
+
* <p>
|
148
|
+
* <strong>Note:</strong> <code>Collator</code>s with different Locale,
|
149
|
+
* and CollationStrength settings will return different sort
|
150
|
+
* orders for the same set of strings. Locales have specific collation rules,
|
151
|
+
* and the way in which secondary and tertiary differences are taken into
|
152
|
+
* account, for example, will result in a different sorting order for same
|
153
|
+
* strings.
|
154
|
+
* </p>
|
155
|
+
* @see RuleBasedCollator
|
156
|
+
* @see CollationKey
|
157
|
+
* @see CollationElementIterator
|
158
|
+
* @see Locale
|
159
|
+
* @see Normalizer
|
160
|
+
* @version 2.0 11/15/01
|
161
|
+
*/
|
162
|
+
|
163
|
+
class U_I18N_API Collator : public UObject {
|
164
|
+
public:
|
165
|
+
|
166
|
+
// Collator public enums -----------------------------------------------
|
167
|
+
|
168
|
+
/**
|
169
|
+
* Base letter represents a primary difference. Set comparison level to
|
170
|
+
* PRIMARY to ignore secondary and tertiary differences.<br>
|
171
|
+
* Use this to set the strength of a Collator object.<br>
|
172
|
+
* Example of primary difference, "abc" < "abd"
|
173
|
+
*
|
174
|
+
* Diacritical differences on the same base letter represent a secondary
|
175
|
+
* difference. Set comparison level to SECONDARY to ignore tertiary
|
176
|
+
* differences. Use this to set the strength of a Collator object.<br>
|
177
|
+
* Example of secondary difference, "ä" >> "a".
|
178
|
+
*
|
179
|
+
* Uppercase and lowercase versions of the same character represents a
|
180
|
+
* tertiary difference. Set comparison level to TERTIARY to include all
|
181
|
+
* comparison differences. Use this to set the strength of a Collator
|
182
|
+
* object.<br>
|
183
|
+
* Example of tertiary difference, "abc" <<< "ABC".
|
184
|
+
*
|
185
|
+
* Two characters are considered "identical" when they have the same unicode
|
186
|
+
* spellings.<br>
|
187
|
+
* For example, "ä" == "ä".
|
188
|
+
*
|
189
|
+
* UCollationStrength is also used to determine the strength of sort keys
|
190
|
+
* generated from Collator objects.
|
191
|
+
* @stable ICU 2.0
|
192
|
+
*/
|
193
|
+
enum ECollationStrength
|
194
|
+
{
|
195
|
+
PRIMARY = UCOL_PRIMARY, // 0
|
196
|
+
SECONDARY = UCOL_SECONDARY, // 1
|
197
|
+
TERTIARY = UCOL_TERTIARY, // 2
|
198
|
+
QUATERNARY = UCOL_QUATERNARY, // 3
|
199
|
+
IDENTICAL = UCOL_IDENTICAL // 15
|
200
|
+
};
|
201
|
+
|
202
|
+
/**
|
203
|
+
* LESS is returned if source string is compared to be less than target
|
204
|
+
* string in the compare() method.
|
205
|
+
* EQUAL is returned if source string is compared to be equal to target
|
206
|
+
* string in the compare() method.
|
207
|
+
* GREATER is returned if source string is compared to be greater than
|
208
|
+
* target string in the compare() method.
|
209
|
+
* @see Collator#compare
|
210
|
+
* @deprecated ICU 2.6. Use C enum UCollationResult defined in ucol.h
|
211
|
+
*/
|
212
|
+
enum EComparisonResult
|
213
|
+
{
|
214
|
+
LESS = UCOL_LESS, // -1
|
215
|
+
EQUAL = UCOL_EQUAL, // 0
|
216
|
+
GREATER = UCOL_GREATER // 1
|
217
|
+
};
|
218
|
+
|
219
|
+
// Collator public destructor -----------------------------------------
|
220
|
+
|
221
|
+
/**
|
222
|
+
* Destructor
|
223
|
+
* @stable ICU 2.0
|
224
|
+
*/
|
225
|
+
virtual ~Collator();
|
226
|
+
|
227
|
+
// Collator public methods --------------------------------------------
|
228
|
+
|
229
|
+
/**
|
230
|
+
* Returns TRUE if "other" is the same as "this".
|
231
|
+
*
|
232
|
+
* The base class implementation returns TRUE if "other" has the same type/class as "this":
|
233
|
+
* <code>typeid(*this) == typeid(other)</code>.
|
234
|
+
*
|
235
|
+
* Subclass implementations should do something like the following:
|
236
|
+
* <pre>
|
237
|
+
* if (this == &other) { return TRUE; }
|
238
|
+
* if (!Collator::operator==(other)) { return FALSE; } // not the same class
|
239
|
+
*
|
240
|
+
* const MyCollator &o = (const MyCollator&)other;
|
241
|
+
* (compare this vs. o's subclass fields)
|
242
|
+
* </pre>
|
243
|
+
* @param other Collator object to be compared
|
244
|
+
* @return TRUE if other is the same as this.
|
245
|
+
* @stable ICU 2.0
|
246
|
+
*/
|
247
|
+
virtual UBool operator==(const Collator& other) const;
|
248
|
+
|
249
|
+
/**
|
250
|
+
* Returns true if "other" is not the same as "this".
|
251
|
+
* Calls ! operator==(const Collator&) const which works for all subclasses.
|
252
|
+
* @param other Collator object to be compared
|
253
|
+
* @return TRUE if other is not the same as this.
|
254
|
+
* @stable ICU 2.0
|
255
|
+
*/
|
256
|
+
virtual UBool operator!=(const Collator& other) const;
|
257
|
+
|
258
|
+
/**
|
259
|
+
* Makes a copy of this object.
|
260
|
+
* @return a copy of this object, owned by the caller
|
261
|
+
* @stable ICU 2.0
|
262
|
+
*/
|
263
|
+
virtual Collator* clone(void) const = 0;
|
264
|
+
|
265
|
+
/**
|
266
|
+
* Creates the Collator object for the current default locale.
|
267
|
+
* The default locale is determined by Locale::getDefault.
|
268
|
+
* The UErrorCode& err parameter is used to return status information to the user.
|
269
|
+
* To check whether the construction succeeded or not, you should check the
|
270
|
+
* value of U_SUCCESS(err). If you wish more detailed information, you can
|
271
|
+
* check for informational error results which still indicate success.
|
272
|
+
* U_USING_FALLBACK_ERROR indicates that a fall back locale was used. For
|
273
|
+
* example, 'de_CH' was requested, but nothing was found there, so 'de' was
|
274
|
+
* used. U_USING_DEFAULT_ERROR indicates that the default locale data was
|
275
|
+
* used; neither the requested locale nor any of its fall back locales
|
276
|
+
* could be found.
|
277
|
+
* The caller owns the returned object and is responsible for deleting it.
|
278
|
+
*
|
279
|
+
* @param err the error code status.
|
280
|
+
* @return the collation object of the default locale.(for example, en_US)
|
281
|
+
* @see Locale#getDefault
|
282
|
+
* @stable ICU 2.0
|
283
|
+
*/
|
284
|
+
static Collator* U_EXPORT2 createInstance(UErrorCode& err);
|
285
|
+
|
286
|
+
/**
|
287
|
+
* Gets the collation object for the desired locale. The
|
288
|
+
* resource of the desired locale will be loaded.
|
289
|
+
*
|
290
|
+
* Locale::getRoot() is the base collation table and all other languages are
|
291
|
+
* built on top of it with additional language-specific modifications.
|
292
|
+
*
|
293
|
+
* For some languages, multiple collation types are available;
|
294
|
+
* for example, "de@collation=phonebook".
|
295
|
+
* Starting with ICU 54, collation attributes can be specified via locale keywords as well,
|
296
|
+
* in the old locale extension syntax ("el@colCaseFirst=upper")
|
297
|
+
* or in language tag syntax ("el-u-kf-upper").
|
298
|
+
* See <a href="http://userguide.icu-project.org/collation/api">User Guide: Collation API</a>.
|
299
|
+
*
|
300
|
+
* The UErrorCode& err parameter is used to return status information to the user.
|
301
|
+
* To check whether the construction succeeded or not, you should check
|
302
|
+
* the value of U_SUCCESS(err). If you wish more detailed information, you
|
303
|
+
* can check for informational error results which still indicate success.
|
304
|
+
* U_USING_FALLBACK_ERROR indicates that a fall back locale was used. For
|
305
|
+
* example, 'de_CH' was requested, but nothing was found there, so 'de' was
|
306
|
+
* used. U_USING_DEFAULT_ERROR indicates that the default locale data was
|
307
|
+
* used; neither the requested locale nor any of its fall back locales
|
308
|
+
* could be found.
|
309
|
+
*
|
310
|
+
* The caller owns the returned object and is responsible for deleting it.
|
311
|
+
* @param loc The locale ID for which to open a collator.
|
312
|
+
* @param err the error code status.
|
313
|
+
* @return the created table-based collation object based on the desired
|
314
|
+
* locale.
|
315
|
+
* @see Locale
|
316
|
+
* @see ResourceLoader
|
317
|
+
* @stable ICU 2.2
|
318
|
+
*/
|
319
|
+
static Collator* U_EXPORT2 createInstance(const Locale& loc, UErrorCode& err);
|
320
|
+
|
321
|
+
/**
|
322
|
+
* The comparison function compares the character data stored in two
|
323
|
+
* different strings. Returns information about whether a string is less
|
324
|
+
* than, greater than or equal to another string.
|
325
|
+
* @param source the source string to be compared with.
|
326
|
+
* @param target the string that is to be compared with the source string.
|
327
|
+
* @return Returns a byte value. GREATER if source is greater
|
328
|
+
* than target; EQUAL if source is equal to target; LESS if source is less
|
329
|
+
* than target
|
330
|
+
* @deprecated ICU 2.6 use the overload with UErrorCode &
|
331
|
+
*/
|
332
|
+
virtual EComparisonResult compare(const UnicodeString& source,
|
333
|
+
const UnicodeString& target) const;
|
334
|
+
|
335
|
+
/**
|
336
|
+
* The comparison function compares the character data stored in two
|
337
|
+
* different strings. Returns information about whether a string is less
|
338
|
+
* than, greater than or equal to another string.
|
339
|
+
* @param source the source string to be compared with.
|
340
|
+
* @param target the string that is to be compared with the source string.
|
341
|
+
* @param status possible error code
|
342
|
+
* @return Returns an enum value. UCOL_GREATER if source is greater
|
343
|
+
* than target; UCOL_EQUAL if source is equal to target; UCOL_LESS if source is less
|
344
|
+
* than target
|
345
|
+
* @stable ICU 2.6
|
346
|
+
*/
|
347
|
+
virtual UCollationResult compare(const UnicodeString& source,
|
348
|
+
const UnicodeString& target,
|
349
|
+
UErrorCode &status) const = 0;
|
350
|
+
|
351
|
+
/**
|
352
|
+
* Does the same thing as compare but limits the comparison to a specified
|
353
|
+
* length
|
354
|
+
* @param source the source string to be compared with.
|
355
|
+
* @param target the string that is to be compared with the source string.
|
356
|
+
* @param length the length the comparison is limited to
|
357
|
+
* @return Returns a byte value. GREATER if source (up to the specified
|
358
|
+
* length) is greater than target; EQUAL if source (up to specified
|
359
|
+
* length) is equal to target; LESS if source (up to the specified
|
360
|
+
* length) is less than target.
|
361
|
+
* @deprecated ICU 2.6 use the overload with UErrorCode &
|
362
|
+
*/
|
363
|
+
virtual EComparisonResult compare(const UnicodeString& source,
|
364
|
+
const UnicodeString& target,
|
365
|
+
int32_t length) const;
|
366
|
+
|
367
|
+
/**
|
368
|
+
* Does the same thing as compare but limits the comparison to a specified
|
369
|
+
* length
|
370
|
+
* @param source the source string to be compared with.
|
371
|
+
* @param target the string that is to be compared with the source string.
|
372
|
+
* @param length the length the comparison is limited to
|
373
|
+
* @param status possible error code
|
374
|
+
* @return Returns an enum value. UCOL_GREATER if source (up to the specified
|
375
|
+
* length) is greater than target; UCOL_EQUAL if source (up to specified
|
376
|
+
* length) is equal to target; UCOL_LESS if source (up to the specified
|
377
|
+
* length) is less than target.
|
378
|
+
* @stable ICU 2.6
|
379
|
+
*/
|
380
|
+
virtual UCollationResult compare(const UnicodeString& source,
|
381
|
+
const UnicodeString& target,
|
382
|
+
int32_t length,
|
383
|
+
UErrorCode &status) const = 0;
|
384
|
+
|
385
|
+
/**
|
386
|
+
* The comparison function compares the character data stored in two
|
387
|
+
* different string arrays. Returns information about whether a string array
|
388
|
+
* is less than, greater than or equal to another string array.
|
389
|
+
* <p>Example of use:
|
390
|
+
* <pre>
|
391
|
+
* . UChar ABC[] = {0x41, 0x42, 0x43, 0}; // = "ABC"
|
392
|
+
* . UChar abc[] = {0x61, 0x62, 0x63, 0}; // = "abc"
|
393
|
+
* . UErrorCode status = U_ZERO_ERROR;
|
394
|
+
* . Collator *myCollation =
|
395
|
+
* . Collator::createInstance(Locale::getUS(), status);
|
396
|
+
* . if (U_FAILURE(status)) return;
|
397
|
+
* . myCollation->setStrength(Collator::PRIMARY);
|
398
|
+
* . // result would be Collator::EQUAL ("abc" == "ABC")
|
399
|
+
* . // (no primary difference between "abc" and "ABC")
|
400
|
+
* . Collator::EComparisonResult result =
|
401
|
+
* . myCollation->compare(abc, 3, ABC, 3);
|
402
|
+
* . myCollation->setStrength(Collator::TERTIARY);
|
403
|
+
* . // result would be Collator::LESS ("abc" <<< "ABC")
|
404
|
+
* . // (with tertiary difference between "abc" and "ABC")
|
405
|
+
* . result = myCollation->compare(abc, 3, ABC, 3);
|
406
|
+
* </pre>
|
407
|
+
* @param source the source string array to be compared with.
|
408
|
+
* @param sourceLength the length of the source string array. If this value
|
409
|
+
* is equal to -1, the string array is null-terminated.
|
410
|
+
* @param target the string that is to be compared with the source string.
|
411
|
+
* @param targetLength the length of the target string array. If this value
|
412
|
+
* is equal to -1, the string array is null-terminated.
|
413
|
+
* @return Returns a byte value. GREATER if source is greater than target;
|
414
|
+
* EQUAL if source is equal to target; LESS if source is less than
|
415
|
+
* target
|
416
|
+
* @deprecated ICU 2.6 use the overload with UErrorCode &
|
417
|
+
*/
|
418
|
+
virtual EComparisonResult compare(const UChar* source, int32_t sourceLength,
|
419
|
+
const UChar* target, int32_t targetLength)
|
420
|
+
const;
|
421
|
+
|
422
|
+
/**
|
423
|
+
* The comparison function compares the character data stored in two
|
424
|
+
* different string arrays. Returns information about whether a string array
|
425
|
+
* is less than, greater than or equal to another string array.
|
426
|
+
* @param source the source string array to be compared with.
|
427
|
+
* @param sourceLength the length of the source string array. If this value
|
428
|
+
* is equal to -1, the string array is null-terminated.
|
429
|
+
* @param target the string that is to be compared with the source string.
|
430
|
+
* @param targetLength the length of the target string array. If this value
|
431
|
+
* is equal to -1, the string array is null-terminated.
|
432
|
+
* @param status possible error code
|
433
|
+
* @return Returns an enum value. UCOL_GREATER if source is greater
|
434
|
+
* than target; UCOL_EQUAL if source is equal to target; UCOL_LESS if source is less
|
435
|
+
* than target
|
436
|
+
* @stable ICU 2.6
|
437
|
+
*/
|
438
|
+
virtual UCollationResult compare(const UChar* source, int32_t sourceLength,
|
439
|
+
const UChar* target, int32_t targetLength,
|
440
|
+
UErrorCode &status) const = 0;
|
441
|
+
|
442
|
+
/**
|
443
|
+
* Compares two strings using the Collator.
|
444
|
+
* Returns whether the first one compares less than/equal to/greater than
|
445
|
+
* the second one.
|
446
|
+
* This version takes UCharIterator input.
|
447
|
+
* @param sIter the first ("source") string iterator
|
448
|
+
* @param tIter the second ("target") string iterator
|
449
|
+
* @param status ICU status
|
450
|
+
* @return UCOL_LESS, UCOL_EQUAL or UCOL_GREATER
|
451
|
+
* @stable ICU 4.2
|
452
|
+
*/
|
453
|
+
virtual UCollationResult compare(UCharIterator &sIter,
|
454
|
+
UCharIterator &tIter,
|
455
|
+
UErrorCode &status) const;
|
456
|
+
|
457
|
+
/**
|
458
|
+
* Compares two UTF-8 strings using the Collator.
|
459
|
+
* Returns whether the first one compares less than/equal to/greater than
|
460
|
+
* the second one.
|
461
|
+
* This version takes UTF-8 input.
|
462
|
+
* Note that a StringPiece can be implicitly constructed
|
463
|
+
* from a std::string or a NUL-terminated const char * string.
|
464
|
+
* @param source the first UTF-8 string
|
465
|
+
* @param target the second UTF-8 string
|
466
|
+
* @param status ICU status
|
467
|
+
* @return UCOL_LESS, UCOL_EQUAL or UCOL_GREATER
|
468
|
+
* @stable ICU 4.2
|
469
|
+
*/
|
470
|
+
virtual UCollationResult compareUTF8(const StringPiece &source,
|
471
|
+
const StringPiece &target,
|
472
|
+
UErrorCode &status) const;
|
473
|
+
|
474
|
+
/**
|
475
|
+
* Transforms the string into a series of characters that can be compared
|
476
|
+
* with CollationKey::compareTo. It is not possible to restore the original
|
477
|
+
* string from the chars in the sort key.
|
478
|
+
* <p>Use CollationKey::equals or CollationKey::compare to compare the
|
479
|
+
* generated sort keys.
|
480
|
+
* If the source string is null, a null collation key will be returned.
|
481
|
+
*
|
482
|
+
* Note that sort keys are often less efficient than simply doing comparison.
|
483
|
+
* For more details, see the ICU User Guide.
|
484
|
+
*
|
485
|
+
* @param source the source string to be transformed into a sort key.
|
486
|
+
* @param key the collation key to be filled in
|
487
|
+
* @param status the error code status.
|
488
|
+
* @return the collation key of the string based on the collation rules.
|
489
|
+
* @see CollationKey#compare
|
490
|
+
* @stable ICU 2.0
|
491
|
+
*/
|
492
|
+
virtual CollationKey& getCollationKey(const UnicodeString& source,
|
493
|
+
CollationKey& key,
|
494
|
+
UErrorCode& status) const = 0;
|
495
|
+
|
496
|
+
/**
|
497
|
+
* Transforms the string into a series of characters that can be compared
|
498
|
+
* with CollationKey::compareTo. It is not possible to restore the original
|
499
|
+
* string from the chars in the sort key.
|
500
|
+
* <p>Use CollationKey::equals or CollationKey::compare to compare the
|
501
|
+
* generated sort keys.
|
502
|
+
* <p>If the source string is null, a null collation key will be returned.
|
503
|
+
*
|
504
|
+
* Note that sort keys are often less efficient than simply doing comparison.
|
505
|
+
* For more details, see the ICU User Guide.
|
506
|
+
*
|
507
|
+
* @param source the source string to be transformed into a sort key.
|
508
|
+
* @param sourceLength length of the collation key
|
509
|
+
* @param key the collation key to be filled in
|
510
|
+
* @param status the error code status.
|
511
|
+
* @return the collation key of the string based on the collation rules.
|
512
|
+
* @see CollationKey#compare
|
513
|
+
* @stable ICU 2.0
|
514
|
+
*/
|
515
|
+
virtual CollationKey& getCollationKey(const UChar*source,
|
516
|
+
int32_t sourceLength,
|
517
|
+
CollationKey& key,
|
518
|
+
UErrorCode& status) const = 0;
|
519
|
+
/**
|
520
|
+
* Generates the hash code for the collation object
|
521
|
+
* @stable ICU 2.0
|
522
|
+
*/
|
523
|
+
virtual int32_t hashCode(void) const = 0;
|
524
|
+
|
525
|
+
/**
|
526
|
+
* Gets the locale of the Collator
|
527
|
+
*
|
528
|
+
* @param type can be either requested, valid or actual locale. For more
|
529
|
+
* information see the definition of ULocDataLocaleType in
|
530
|
+
* uloc.h
|
531
|
+
* @param status the error code status.
|
532
|
+
* @return locale where the collation data lives. If the collator
|
533
|
+
* was instantiated from rules, locale is empty.
|
534
|
+
* @deprecated ICU 2.8 This API is under consideration for revision
|
535
|
+
* in ICU 3.0.
|
536
|
+
*/
|
537
|
+
virtual Locale getLocale(ULocDataLocaleType type, UErrorCode& status) const = 0;
|
538
|
+
|
539
|
+
/**
|
540
|
+
* Convenience method for comparing two strings based on the collation rules.
|
541
|
+
* @param source the source string to be compared with.
|
542
|
+
* @param target the target string to be compared with.
|
543
|
+
* @return true if the first string is greater than the second one,
|
544
|
+
* according to the collation rules. false, otherwise.
|
545
|
+
* @see Collator#compare
|
546
|
+
* @stable ICU 2.0
|
547
|
+
*/
|
548
|
+
UBool greater(const UnicodeString& source, const UnicodeString& target)
|
549
|
+
const;
|
550
|
+
|
551
|
+
/**
|
552
|
+
* Convenience method for comparing two strings based on the collation rules.
|
553
|
+
* @param source the source string to be compared with.
|
554
|
+
* @param target the target string to be compared with.
|
555
|
+
* @return true if the first string is greater than or equal to the second
|
556
|
+
* one, according to the collation rules. false, otherwise.
|
557
|
+
* @see Collator#compare
|
558
|
+
* @stable ICU 2.0
|
559
|
+
*/
|
560
|
+
UBool greaterOrEqual(const UnicodeString& source,
|
561
|
+
const UnicodeString& target) const;
|
562
|
+
|
563
|
+
/**
|
564
|
+
* Convenience method for comparing two strings based on the collation rules.
|
565
|
+
* @param source the source string to be compared with.
|
566
|
+
* @param target the target string to be compared with.
|
567
|
+
* @return true if the strings are equal according to the collation rules.
|
568
|
+
* false, otherwise.
|
569
|
+
* @see Collator#compare
|
570
|
+
* @stable ICU 2.0
|
571
|
+
*/
|
572
|
+
UBool equals(const UnicodeString& source, const UnicodeString& target) const;
|
573
|
+
|
574
|
+
/**
|
575
|
+
* Determines the minimum strength that will be used in comparison or
|
576
|
+
* transformation.
|
577
|
+
* <p>E.g. with strength == SECONDARY, the tertiary difference is ignored
|
578
|
+
* <p>E.g. with strength == PRIMARY, the secondary and tertiary difference
|
579
|
+
* are ignored.
|
580
|
+
* @return the current comparison level.
|
581
|
+
* @see Collator#setStrength
|
582
|
+
* @deprecated ICU 2.6 Use getAttribute(UCOL_STRENGTH...) instead
|
583
|
+
*/
|
584
|
+
virtual ECollationStrength getStrength(void) const;
|
585
|
+
|
586
|
+
/**
|
587
|
+
* Sets the minimum strength to be used in comparison or transformation.
|
588
|
+
* <p>Example of use:
|
589
|
+
* <pre>
|
590
|
+
* \code
|
591
|
+
* UErrorCode status = U_ZERO_ERROR;
|
592
|
+
* Collator*myCollation = Collator::createInstance(Locale::getUS(), status);
|
593
|
+
* if (U_FAILURE(status)) return;
|
594
|
+
* myCollation->setStrength(Collator::PRIMARY);
|
595
|
+
* // result will be "abc" == "ABC"
|
596
|
+
* // tertiary differences will be ignored
|
597
|
+
* Collator::ComparisonResult result = myCollation->compare("abc", "ABC");
|
598
|
+
* \endcode
|
599
|
+
* </pre>
|
600
|
+
* @see Collator#getStrength
|
601
|
+
* @param newStrength the new comparison level.
|
602
|
+
* @deprecated ICU 2.6 Use setAttribute(UCOL_STRENGTH...) instead
|
603
|
+
*/
|
604
|
+
virtual void setStrength(ECollationStrength newStrength);
|
605
|
+
|
606
|
+
/**
|
607
|
+
* Retrieves the reordering codes for this collator.
|
608
|
+
* @param dest The array to fill with the script ordering.
|
609
|
+
* @param destCapacity The length of dest. If it is 0, then dest may be NULL and the function
|
610
|
+
* will only return the length of the result without writing any of the result string (pre-flighting).
|
611
|
+
* @param status A reference to an error code value, which must not indicate
|
612
|
+
* a failure before the function call.
|
613
|
+
* @return The length of the script ordering array.
|
614
|
+
* @see ucol_setReorderCodes
|
615
|
+
* @see Collator#getEquivalentReorderCodes
|
616
|
+
* @see Collator#setReorderCodes
|
617
|
+
* @see UScriptCode
|
618
|
+
* @see UColReorderCode
|
619
|
+
* @stable ICU 4.8
|
620
|
+
*/
|
621
|
+
virtual int32_t getReorderCodes(int32_t *dest,
|
622
|
+
int32_t destCapacity,
|
623
|
+
UErrorCode& status) const;
|
624
|
+
|
625
|
+
/**
|
626
|
+
* Sets the ordering of scripts for this collator.
|
627
|
+
*
|
628
|
+
* <p>The reordering codes are a combination of script codes and reorder codes.
|
629
|
+
* @param reorderCodes An array of script codes in the new order. This can be NULL if the
|
630
|
+
* length is also set to 0. An empty array will clear any reordering codes on the collator.
|
631
|
+
* @param reorderCodesLength The length of reorderCodes.
|
632
|
+
* @param status error code
|
633
|
+
* @see Collator#getReorderCodes
|
634
|
+
* @see Collator#getEquivalentReorderCodes
|
635
|
+
* @see UScriptCode
|
636
|
+
* @see UColReorderCode
|
637
|
+
* @stable ICU 4.8
|
638
|
+
*/
|
639
|
+
virtual void setReorderCodes(const int32_t* reorderCodes,
|
640
|
+
int32_t reorderCodesLength,
|
641
|
+
UErrorCode& status) ;
|
642
|
+
|
643
|
+
/**
|
644
|
+
* Retrieves the reorder codes that are grouped with the given reorder code. Some reorder
|
645
|
+
* codes will be grouped and must reorder together.
|
646
|
+
* @param reorderCode The reorder code to determine equivalence for.
|
647
|
+
* @param dest The array to fill with the script equivalence reordering codes.
|
648
|
+
* @param destCapacity The length of dest. If it is 0, then dest may be NULL and the
|
649
|
+
* function will only return the length of the result without writing any of the result
|
650
|
+
* string (pre-flighting).
|
651
|
+
* @param status A reference to an error code value, which must not indicate
|
652
|
+
* a failure before the function call.
|
653
|
+
* @return The length of the of the reordering code equivalence array.
|
654
|
+
* @see ucol_setReorderCodes
|
655
|
+
* @see Collator#getReorderCodes
|
656
|
+
* @see Collator#setReorderCodes
|
657
|
+
* @see UScriptCode
|
658
|
+
* @see UColReorderCode
|
659
|
+
* @stable ICU 4.8
|
660
|
+
*/
|
661
|
+
static int32_t U_EXPORT2 getEquivalentReorderCodes(int32_t reorderCode,
|
662
|
+
int32_t* dest,
|
663
|
+
int32_t destCapacity,
|
664
|
+
UErrorCode& status);
|
665
|
+
|
666
|
+
/**
|
667
|
+
* Get name of the object for the desired Locale, in the desired langauge
|
668
|
+
* @param objectLocale must be from getAvailableLocales
|
669
|
+
* @param displayLocale specifies the desired locale for output
|
670
|
+
* @param name the fill-in parameter of the return value
|
671
|
+
* @return display-able name of the object for the object locale in the
|
672
|
+
* desired language
|
673
|
+
* @stable ICU 2.0
|
674
|
+
*/
|
675
|
+
static UnicodeString& U_EXPORT2 getDisplayName(const Locale& objectLocale,
|
676
|
+
const Locale& displayLocale,
|
677
|
+
UnicodeString& name);
|
678
|
+
|
679
|
+
/**
|
680
|
+
* Get name of the object for the desired Locale, in the langauge of the
|
681
|
+
* default locale.
|
682
|
+
* @param objectLocale must be from getAvailableLocales
|
683
|
+
* @param name the fill-in parameter of the return value
|
684
|
+
* @return name of the object for the desired locale in the default language
|
685
|
+
* @stable ICU 2.0
|
686
|
+
*/
|
687
|
+
static UnicodeString& U_EXPORT2 getDisplayName(const Locale& objectLocale,
|
688
|
+
UnicodeString& name);
|
689
|
+
|
690
|
+
/**
|
691
|
+
* Get the set of Locales for which Collations are installed.
|
692
|
+
*
|
693
|
+
* <p>Note this does not include locales supported by registered collators.
|
694
|
+
* If collators might have been registered, use the overload of getAvailableLocales
|
695
|
+
* that returns a StringEnumeration.</p>
|
696
|
+
*
|
697
|
+
* @param count the output parameter of number of elements in the locale list
|
698
|
+
* @return the list of available locales for which collations are installed
|
699
|
+
* @stable ICU 2.0
|
700
|
+
*/
|
701
|
+
static const Locale* U_EXPORT2 getAvailableLocales(int32_t& count);
|
702
|
+
|
703
|
+
/**
|
704
|
+
* Return a StringEnumeration over the locales available at the time of the call,
|
705
|
+
* including registered locales. If a severe error occurs (such as out of memory
|
706
|
+
* condition) this will return null. If there is no locale data, an empty enumeration
|
707
|
+
* will be returned.
|
708
|
+
* @return a StringEnumeration over the locales available at the time of the call
|
709
|
+
* @stable ICU 2.6
|
710
|
+
*/
|
711
|
+
static StringEnumeration* U_EXPORT2 getAvailableLocales(void);
|
712
|
+
|
713
|
+
/**
|
714
|
+
* Create a string enumerator of all possible keywords that are relevant to
|
715
|
+
* collation. At this point, the only recognized keyword for this
|
716
|
+
* service is "collation".
|
717
|
+
* @param status input-output error code
|
718
|
+
* @return a string enumeration over locale strings. The caller is
|
719
|
+
* responsible for closing the result.
|
720
|
+
* @stable ICU 3.0
|
721
|
+
*/
|
722
|
+
static StringEnumeration* U_EXPORT2 getKeywords(UErrorCode& status);
|
723
|
+
|
724
|
+
/**
|
725
|
+
* Given a keyword, create a string enumeration of all values
|
726
|
+
* for that keyword that are currently in use.
|
727
|
+
* @param keyword a particular keyword as enumerated by
|
728
|
+
* ucol_getKeywords. If any other keyword is passed in, status is set
|
729
|
+
* to U_ILLEGAL_ARGUMENT_ERROR.
|
730
|
+
* @param status input-output error code
|
731
|
+
* @return a string enumeration over collation keyword values, or NULL
|
732
|
+
* upon error. The caller is responsible for deleting the result.
|
733
|
+
* @stable ICU 3.0
|
734
|
+
*/
|
735
|
+
static StringEnumeration* U_EXPORT2 getKeywordValues(const char *keyword, UErrorCode& status);
|
736
|
+
|
737
|
+
/**
|
738
|
+
* Given a key and a locale, returns an array of string values in a preferred
|
739
|
+
* order that would make a difference. These are all and only those values where
|
740
|
+
* the open (creation) of the service with the locale formed from the input locale
|
741
|
+
* plus input keyword and that value has different behavior than creation with the
|
742
|
+
* input locale alone.
|
743
|
+
* @param keyword one of the keys supported by this service. For now, only
|
744
|
+
* "collation" is supported.
|
745
|
+
* @param locale the locale
|
746
|
+
* @param commonlyUsed if set to true it will return only commonly used values
|
747
|
+
* with the given locale in preferred order. Otherwise,
|
748
|
+
* it will return all the available values for the locale.
|
749
|
+
* @param status ICU status
|
750
|
+
* @return a string enumeration over keyword values for the given key and the locale.
|
751
|
+
* @stable ICU 4.2
|
752
|
+
*/
|
753
|
+
static StringEnumeration* U_EXPORT2 getKeywordValuesForLocale(const char* keyword, const Locale& locale,
|
754
|
+
UBool commonlyUsed, UErrorCode& status);
|
755
|
+
|
756
|
+
/**
|
757
|
+
* Return the functionally equivalent locale for the given
|
758
|
+
* requested locale, with respect to given keyword, for the
|
759
|
+
* collation service. If two locales return the same result, then
|
760
|
+
* collators instantiated for these locales will behave
|
761
|
+
* equivalently. The converse is not always true; two collators
|
762
|
+
* may in fact be equivalent, but return different results, due to
|
763
|
+
* internal details. The return result has no other meaning than
|
764
|
+
* that stated above, and implies nothing as to the relationship
|
765
|
+
* between the two locales. This is intended for use by
|
766
|
+
* applications who wish to cache collators, or otherwise reuse
|
767
|
+
* collators when possible. The functional equivalent may change
|
768
|
+
* over time. For more information, please see the <a
|
769
|
+
* href="http://userguide.icu-project.org/locale#TOC-Locales-and-Services">
|
770
|
+
* Locales and Services</a> section of the ICU User Guide.
|
771
|
+
* @param keyword a particular keyword as enumerated by
|
772
|
+
* ucol_getKeywords.
|
773
|
+
* @param locale the requested locale
|
774
|
+
* @param isAvailable reference to a fillin parameter that
|
775
|
+
* indicates whether the requested locale was 'available' to the
|
776
|
+
* collation service. A locale is defined as 'available' if it
|
777
|
+
* physically exists within the collation locale data.
|
778
|
+
* @param status reference to input-output error code
|
779
|
+
* @return the functionally equivalent collation locale, or the root
|
780
|
+
* locale upon error.
|
781
|
+
* @stable ICU 3.0
|
782
|
+
*/
|
783
|
+
static Locale U_EXPORT2 getFunctionalEquivalent(const char* keyword, const Locale& locale,
|
784
|
+
UBool& isAvailable, UErrorCode& status);
|
785
|
+
|
786
|
+
#if !UCONFIG_NO_SERVICE
|
787
|
+
/**
|
788
|
+
* Register a new Collator. The collator will be adopted.
|
789
|
+
* Because ICU may choose to cache collators internally, this must be
|
790
|
+
* called at application startup, prior to any calls to
|
791
|
+
* Collator::createInstance to avoid undefined behavior.
|
792
|
+
* @param toAdopt the Collator instance to be adopted
|
793
|
+
* @param locale the locale with which the collator will be associated
|
794
|
+
* @param status the in/out status code, no special meanings are assigned
|
795
|
+
* @return a registry key that can be used to unregister this collator
|
796
|
+
* @stable ICU 2.6
|
797
|
+
*/
|
798
|
+
static URegistryKey U_EXPORT2 registerInstance(Collator* toAdopt, const Locale& locale, UErrorCode& status);
|
799
|
+
|
800
|
+
/**
|
801
|
+
* Register a new CollatorFactory. The factory will be adopted.
|
802
|
+
* Because ICU may choose to cache collators internally, this must be
|
803
|
+
* called at application startup, prior to any calls to
|
804
|
+
* Collator::createInstance to avoid undefined behavior.
|
805
|
+
* @param toAdopt the CollatorFactory instance to be adopted
|
806
|
+
* @param status the in/out status code, no special meanings are assigned
|
807
|
+
* @return a registry key that can be used to unregister this collator
|
808
|
+
* @stable ICU 2.6
|
809
|
+
*/
|
810
|
+
static URegistryKey U_EXPORT2 registerFactory(CollatorFactory* toAdopt, UErrorCode& status);
|
811
|
+
|
812
|
+
/**
|
813
|
+
* Unregister a previously-registered Collator or CollatorFactory
|
814
|
+
* using the key returned from the register call. Key becomes
|
815
|
+
* invalid after a successful call and should not be used again.
|
816
|
+
* The object corresponding to the key will be deleted.
|
817
|
+
* Because ICU may choose to cache collators internally, this should
|
818
|
+
* be called during application shutdown, after all calls to
|
819
|
+
* Collator::createInstance to avoid undefined behavior.
|
820
|
+
* @param key the registry key returned by a previous call to registerInstance
|
821
|
+
* @param status the in/out status code, no special meanings are assigned
|
822
|
+
* @return TRUE if the collator for the key was successfully unregistered
|
823
|
+
* @stable ICU 2.6
|
824
|
+
*/
|
825
|
+
static UBool U_EXPORT2 unregister(URegistryKey key, UErrorCode& status);
|
826
|
+
#endif /* UCONFIG_NO_SERVICE */
|
827
|
+
|
828
|
+
/**
|
829
|
+
* Gets the version information for a Collator.
|
830
|
+
* @param info the version # information, the result will be filled in
|
831
|
+
* @stable ICU 2.0
|
832
|
+
*/
|
833
|
+
virtual void getVersion(UVersionInfo info) const = 0;
|
834
|
+
|
835
|
+
/**
|
836
|
+
* Returns a unique class ID POLYMORPHICALLY. Pure virtual method.
|
837
|
+
* This method is to implement a simple version of RTTI, since not all C++
|
838
|
+
* compilers support genuine RTTI. Polymorphic operator==() and clone()
|
839
|
+
* methods call this method.
|
840
|
+
* @return The class ID for this object. All objects of a given class have
|
841
|
+
* the same class ID. Objects of other classes have different class
|
842
|
+
* IDs.
|
843
|
+
* @stable ICU 2.0
|
844
|
+
*/
|
845
|
+
virtual UClassID getDynamicClassID(void) const = 0;
|
846
|
+
|
847
|
+
/**
|
848
|
+
* Universal attribute setter
|
849
|
+
* @param attr attribute type
|
850
|
+
* @param value attribute value
|
851
|
+
* @param status to indicate whether the operation went on smoothly or
|
852
|
+
* there were errors
|
853
|
+
* @stable ICU 2.2
|
854
|
+
*/
|
855
|
+
virtual void setAttribute(UColAttribute attr, UColAttributeValue value,
|
856
|
+
UErrorCode &status) = 0;
|
857
|
+
|
858
|
+
/**
|
859
|
+
* Universal attribute getter
|
860
|
+
* @param attr attribute type
|
861
|
+
* @param status to indicate whether the operation went on smoothly or
|
862
|
+
* there were errors
|
863
|
+
* @return attribute value
|
864
|
+
* @stable ICU 2.2
|
865
|
+
*/
|
866
|
+
virtual UColAttributeValue getAttribute(UColAttribute attr,
|
867
|
+
UErrorCode &status) const = 0;
|
868
|
+
|
869
|
+
/* Cannot use #ifndef U_HIDE_DRAFT_API for the following draft methods since they are virtual */
|
870
|
+
/**
|
871
|
+
* Sets the variable top to the top of the specified reordering group.
|
872
|
+
* The variable top determines the highest-sorting character
|
873
|
+
* which is affected by UCOL_ALTERNATE_HANDLING.
|
874
|
+
* If that attribute is set to UCOL_NON_IGNORABLE, then the variable top has no effect.
|
875
|
+
*
|
876
|
+
* The base class implementation sets U_UNSUPPORTED_ERROR.
|
877
|
+
* @param group one of UCOL_REORDER_CODE_SPACE, UCOL_REORDER_CODE_PUNCTUATION,
|
878
|
+
* UCOL_REORDER_CODE_SYMBOL, UCOL_REORDER_CODE_CURRENCY;
|
879
|
+
* or UCOL_REORDER_CODE_DEFAULT to restore the default max variable group
|
880
|
+
* @param errorCode Standard ICU error code. Its input value must
|
881
|
+
* pass the U_SUCCESS() test, or else the function returns
|
882
|
+
* immediately. Check for U_FAILURE() on output or use with
|
883
|
+
* function chaining. (See User Guide for details.)
|
884
|
+
* @return *this
|
885
|
+
* @see getMaxVariable
|
886
|
+
* @draft ICU 53
|
887
|
+
*/
|
888
|
+
virtual Collator &setMaxVariable(UColReorderCode group, UErrorCode &errorCode);
|
889
|
+
|
890
|
+
/**
|
891
|
+
* Returns the maximum reordering group whose characters are affected by UCOL_ALTERNATE_HANDLING.
|
892
|
+
*
|
893
|
+
* The base class implementation returns UCOL_REORDER_CODE_PUNCTUATION.
|
894
|
+
* @return the maximum variable reordering group.
|
895
|
+
* @see setMaxVariable
|
896
|
+
* @draft ICU 53
|
897
|
+
*/
|
898
|
+
virtual UColReorderCode getMaxVariable() const;
|
899
|
+
|
900
|
+
/**
|
901
|
+
* Sets the variable top to the primary weight of the specified string.
|
902
|
+
*
|
903
|
+
* Beginning with ICU 53, the variable top is pinned to
|
904
|
+
* the top of one of the supported reordering groups,
|
905
|
+
* and it must not be beyond the last of those groups.
|
906
|
+
* See setMaxVariable().
|
907
|
+
* @param varTop one or more (if contraction) UChars to which the variable top should be set
|
908
|
+
* @param len length of variable top string. If -1 it is considered to be zero terminated.
|
909
|
+
* @param status error code. If error code is set, the return value is undefined. Errors set by this function are: <br>
|
910
|
+
* U_CE_NOT_FOUND_ERROR if more than one character was passed and there is no such contraction<br>
|
911
|
+
* U_ILLEGAL_ARGUMENT_ERROR if the variable top is beyond
|
912
|
+
* the last reordering group supported by setMaxVariable()
|
913
|
+
* @return variable top primary weight
|
914
|
+
* @deprecated ICU 53 Call setMaxVariable() instead.
|
915
|
+
*/
|
916
|
+
virtual uint32_t setVariableTop(const UChar *varTop, int32_t len, UErrorCode &status) = 0;
|
917
|
+
|
918
|
+
/**
|
919
|
+
* Sets the variable top to the primary weight of the specified string.
|
920
|
+
*
|
921
|
+
* Beginning with ICU 53, the variable top is pinned to
|
922
|
+
* the top of one of the supported reordering groups,
|
923
|
+
* and it must not be beyond the last of those groups.
|
924
|
+
* See setMaxVariable().
|
925
|
+
* @param varTop a UnicodeString size 1 or more (if contraction) of UChars to which the variable top should be set
|
926
|
+
* @param status error code. If error code is set, the return value is undefined. Errors set by this function are: <br>
|
927
|
+
* U_CE_NOT_FOUND_ERROR if more than one character was passed and there is no such contraction<br>
|
928
|
+
* U_ILLEGAL_ARGUMENT_ERROR if the variable top is beyond
|
929
|
+
* the last reordering group supported by setMaxVariable()
|
930
|
+
* @return variable top primary weight
|
931
|
+
* @deprecated ICU 53 Call setMaxVariable() instead.
|
932
|
+
*/
|
933
|
+
virtual uint32_t setVariableTop(const UnicodeString &varTop, UErrorCode &status) = 0;
|
934
|
+
|
935
|
+
/**
|
936
|
+
* Sets the variable top to the specified primary weight.
|
937
|
+
*
|
938
|
+
* Beginning with ICU 53, the variable top is pinned to
|
939
|
+
* the top of one of the supported reordering groups,
|
940
|
+
* and it must not be beyond the last of those groups.
|
941
|
+
* See setMaxVariable().
|
942
|
+
* @param varTop primary weight, as returned by setVariableTop or ucol_getVariableTop
|
943
|
+
* @param status error code
|
944
|
+
* @deprecated ICU 53 Call setMaxVariable() instead.
|
945
|
+
*/
|
946
|
+
virtual void setVariableTop(uint32_t varTop, UErrorCode &status) = 0;
|
947
|
+
|
948
|
+
/**
|
949
|
+
* Gets the variable top value of a Collator.
|
950
|
+
* @param status error code (not changed by function). If error code is set, the return value is undefined.
|
951
|
+
* @return the variable top primary weight
|
952
|
+
* @see getMaxVariable
|
953
|
+
* @stable ICU 2.0
|
954
|
+
*/
|
955
|
+
virtual uint32_t getVariableTop(UErrorCode &status) const = 0;
|
956
|
+
|
957
|
+
/**
|
958
|
+
* Get a UnicodeSet that contains all the characters and sequences
|
959
|
+
* tailored in this collator.
|
960
|
+
* @param status error code of the operation
|
961
|
+
* @return a pointer to a UnicodeSet object containing all the
|
962
|
+
* code points and sequences that may sort differently than
|
963
|
+
* in the root collator. The object must be disposed of by using delete
|
964
|
+
* @stable ICU 2.4
|
965
|
+
*/
|
966
|
+
virtual UnicodeSet *getTailoredSet(UErrorCode &status) const;
|
967
|
+
|
968
|
+
/**
|
969
|
+
* Same as clone().
|
970
|
+
* The base class implementation simply calls clone().
|
971
|
+
* @return a copy of this object, owned by the caller
|
972
|
+
* @see clone()
|
973
|
+
* @deprecated ICU 50 no need to have two methods for cloning
|
974
|
+
*/
|
975
|
+
virtual Collator* safeClone(void) const;
|
976
|
+
|
977
|
+
/**
|
978
|
+
* Get the sort key as an array of bytes from a UnicodeString.
|
979
|
+
* Sort key byte arrays are zero-terminated and can be compared using
|
980
|
+
* strcmp().
|
981
|
+
*
|
982
|
+
* Note that sort keys are often less efficient than simply doing comparison.
|
983
|
+
* For more details, see the ICU User Guide.
|
984
|
+
*
|
985
|
+
* @param source string to be processed.
|
986
|
+
* @param result buffer to store result in. If NULL, number of bytes needed
|
987
|
+
* will be returned.
|
988
|
+
* @param resultLength length of the result buffer. If if not enough the
|
989
|
+
* buffer will be filled to capacity.
|
990
|
+
* @return Number of bytes needed for storing the sort key
|
991
|
+
* @stable ICU 2.2
|
992
|
+
*/
|
993
|
+
virtual int32_t getSortKey(const UnicodeString& source,
|
994
|
+
uint8_t* result,
|
995
|
+
int32_t resultLength) const = 0;
|
996
|
+
|
997
|
+
/**
|
998
|
+
* Get the sort key as an array of bytes from a UChar buffer.
|
999
|
+
* Sort key byte arrays are zero-terminated and can be compared using
|
1000
|
+
* strcmp().
|
1001
|
+
*
|
1002
|
+
* Note that sort keys are often less efficient than simply doing comparison.
|
1003
|
+
* For more details, see the ICU User Guide.
|
1004
|
+
*
|
1005
|
+
* @param source string to be processed.
|
1006
|
+
* @param sourceLength length of string to be processed.
|
1007
|
+
* If -1, the string is 0 terminated and length will be decided by the
|
1008
|
+
* function.
|
1009
|
+
* @param result buffer to store result in. If NULL, number of bytes needed
|
1010
|
+
* will be returned.
|
1011
|
+
* @param resultLength length of the result buffer. If if not enough the
|
1012
|
+
* buffer will be filled to capacity.
|
1013
|
+
* @return Number of bytes needed for storing the sort key
|
1014
|
+
* @stable ICU 2.2
|
1015
|
+
*/
|
1016
|
+
virtual int32_t getSortKey(const UChar*source, int32_t sourceLength,
|
1017
|
+
uint8_t*result, int32_t resultLength) const = 0;
|
1018
|
+
|
1019
|
+
/**
|
1020
|
+
* Produce a bound for a given sortkey and a number of levels.
|
1021
|
+
* Return value is always the number of bytes needed, regardless of
|
1022
|
+
* whether the result buffer was big enough or even valid.<br>
|
1023
|
+
* Resulting bounds can be used to produce a range of strings that are
|
1024
|
+
* between upper and lower bounds. For example, if bounds are produced
|
1025
|
+
* for a sortkey of string "smith", strings between upper and lower
|
1026
|
+
* bounds with one level would include "Smith", "SMITH", "sMiTh".<br>
|
1027
|
+
* There are two upper bounds that can be produced. If UCOL_BOUND_UPPER
|
1028
|
+
* is produced, strings matched would be as above. However, if bound
|
1029
|
+
* produced using UCOL_BOUND_UPPER_LONG is used, the above example will
|
1030
|
+
* also match "Smithsonian" and similar.<br>
|
1031
|
+
* For more on usage, see example in cintltst/capitst.c in procedure
|
1032
|
+
* TestBounds.
|
1033
|
+
* Sort keys may be compared using <TT>strcmp</TT>.
|
1034
|
+
* @param source The source sortkey.
|
1035
|
+
* @param sourceLength The length of source, or -1 if null-terminated.
|
1036
|
+
* (If an unmodified sortkey is passed, it is always null
|
1037
|
+
* terminated).
|
1038
|
+
* @param boundType Type of bound required. It can be UCOL_BOUND_LOWER, which
|
1039
|
+
* produces a lower inclusive bound, UCOL_BOUND_UPPER, that
|
1040
|
+
* produces upper bound that matches strings of the same length
|
1041
|
+
* or UCOL_BOUND_UPPER_LONG that matches strings that have the
|
1042
|
+
* same starting substring as the source string.
|
1043
|
+
* @param noOfLevels Number of levels required in the resulting bound (for most
|
1044
|
+
* uses, the recommended value is 1). See users guide for
|
1045
|
+
* explanation on number of levels a sortkey can have.
|
1046
|
+
* @param result A pointer to a buffer to receive the resulting sortkey.
|
1047
|
+
* @param resultLength The maximum size of result.
|
1048
|
+
* @param status Used for returning error code if something went wrong. If the
|
1049
|
+
* number of levels requested is higher than the number of levels
|
1050
|
+
* in the source key, a warning (U_SORT_KEY_TOO_SHORT_WARNING) is
|
1051
|
+
* issued.
|
1052
|
+
* @return The size needed to fully store the bound.
|
1053
|
+
* @see ucol_keyHashCode
|
1054
|
+
* @stable ICU 2.1
|
1055
|
+
*/
|
1056
|
+
static int32_t U_EXPORT2 getBound(const uint8_t *source,
|
1057
|
+
int32_t sourceLength,
|
1058
|
+
UColBoundMode boundType,
|
1059
|
+
uint32_t noOfLevels,
|
1060
|
+
uint8_t *result,
|
1061
|
+
int32_t resultLength,
|
1062
|
+
UErrorCode &status);
|
1063
|
+
|
1064
|
+
|
1065
|
+
protected:
|
1066
|
+
|
1067
|
+
// Collator protected constructors -------------------------------------
|
1068
|
+
|
1069
|
+
/**
|
1070
|
+
* Default constructor.
|
1071
|
+
* Constructor is different from the old default Collator constructor.
|
1072
|
+
* The task for determing the default collation strength and normalization
|
1073
|
+
* mode is left to the child class.
|
1074
|
+
* @stable ICU 2.0
|
1075
|
+
*/
|
1076
|
+
Collator();
|
1077
|
+
|
1078
|
+
#ifndef U_HIDE_DEPRECATED_API
|
1079
|
+
/**
|
1080
|
+
* Constructor.
|
1081
|
+
* Empty constructor, does not handle the arguments.
|
1082
|
+
* This constructor is done for backward compatibility with 1.7 and 1.8.
|
1083
|
+
* The task for handling the argument collation strength and normalization
|
1084
|
+
* mode is left to the child class.
|
1085
|
+
* @param collationStrength collation strength
|
1086
|
+
* @param decompositionMode
|
1087
|
+
* @deprecated ICU 2.4. Subclasses should use the default constructor
|
1088
|
+
* instead and handle the strength and normalization mode themselves.
|
1089
|
+
*/
|
1090
|
+
Collator(UCollationStrength collationStrength,
|
1091
|
+
UNormalizationMode decompositionMode);
|
1092
|
+
#endif /* U_HIDE_DEPRECATED_API */
|
1093
|
+
|
1094
|
+
/**
|
1095
|
+
* Copy constructor.
|
1096
|
+
* @param other Collator object to be copied from
|
1097
|
+
* @stable ICU 2.0
|
1098
|
+
*/
|
1099
|
+
Collator(const Collator& other);
|
1100
|
+
|
1101
|
+
public:
|
1102
|
+
/**
|
1103
|
+
* Used internally by registration to define the requested and valid locales.
|
1104
|
+
* @param requestedLocale the requested locale
|
1105
|
+
* @param validLocale the valid locale
|
1106
|
+
* @param actualLocale the actual locale
|
1107
|
+
* @internal
|
1108
|
+
*/
|
1109
|
+
virtual void setLocales(const Locale& requestedLocale, const Locale& validLocale, const Locale& actualLocale);
|
1110
|
+
|
1111
|
+
/** Get the short definition string for a collator. This internal API harvests the collator's
|
1112
|
+
* locale and the attribute set and produces a string that can be used for opening
|
1113
|
+
* a collator with the same attributes using the ucol_openFromShortString API.
|
1114
|
+
* This string will be normalized.
|
1115
|
+
* The structure and the syntax of the string is defined in the "Naming collators"
|
1116
|
+
* section of the users guide:
|
1117
|
+
* http://userguide.icu-project.org/collation/concepts#TOC-Collator-naming-scheme
|
1118
|
+
* This function supports preflighting.
|
1119
|
+
*
|
1120
|
+
* This is internal, and intended to be used with delegate converters.
|
1121
|
+
*
|
1122
|
+
* @param locale a locale that will appear as a collators locale in the resulting
|
1123
|
+
* short string definition. If NULL, the locale will be harvested
|
1124
|
+
* from the collator.
|
1125
|
+
* @param buffer space to hold the resulting string
|
1126
|
+
* @param capacity capacity of the buffer
|
1127
|
+
* @param status for returning errors. All the preflighting errors are featured
|
1128
|
+
* @return length of the resulting string
|
1129
|
+
* @see ucol_openFromShortString
|
1130
|
+
* @see ucol_normalizeShortDefinitionString
|
1131
|
+
* @see ucol_getShortDefinitionString
|
1132
|
+
* @internal
|
1133
|
+
*/
|
1134
|
+
virtual int32_t internalGetShortDefinitionString(const char *locale,
|
1135
|
+
char *buffer,
|
1136
|
+
int32_t capacity,
|
1137
|
+
UErrorCode &status) const;
|
1138
|
+
|
1139
|
+
/**
|
1140
|
+
* Implements ucol_strcollUTF8().
|
1141
|
+
* @internal
|
1142
|
+
*/
|
1143
|
+
virtual UCollationResult internalCompareUTF8(
|
1144
|
+
const char *left, int32_t leftLength,
|
1145
|
+
const char *right, int32_t rightLength,
|
1146
|
+
UErrorCode &errorCode) const;
|
1147
|
+
|
1148
|
+
/**
|
1149
|
+
* Implements ucol_nextSortKeyPart().
|
1150
|
+
* @internal
|
1151
|
+
*/
|
1152
|
+
virtual int32_t
|
1153
|
+
internalNextSortKeyPart(
|
1154
|
+
UCharIterator *iter, uint32_t state[2],
|
1155
|
+
uint8_t *dest, int32_t count, UErrorCode &errorCode) const;
|
1156
|
+
|
1157
|
+
#ifndef U_HIDE_INTERNAL_API
|
1158
|
+
/** @internal */
|
1159
|
+
static inline Collator *fromUCollator(UCollator *uc) {
|
1160
|
+
return reinterpret_cast<Collator *>(uc);
|
1161
|
+
}
|
1162
|
+
/** @internal */
|
1163
|
+
static inline const Collator *fromUCollator(const UCollator *uc) {
|
1164
|
+
return reinterpret_cast<const Collator *>(uc);
|
1165
|
+
}
|
1166
|
+
/** @internal */
|
1167
|
+
inline UCollator *toUCollator() {
|
1168
|
+
return reinterpret_cast<UCollator *>(this);
|
1169
|
+
}
|
1170
|
+
/** @internal */
|
1171
|
+
inline const UCollator *toUCollator() const {
|
1172
|
+
return reinterpret_cast<const UCollator *>(this);
|
1173
|
+
}
|
1174
|
+
#endif // U_HIDE_INTERNAL_API
|
1175
|
+
|
1176
|
+
private:
|
1177
|
+
/**
|
1178
|
+
* Assignment operator. Private for now.
|
1179
|
+
*/
|
1180
|
+
Collator& operator=(const Collator& other);
|
1181
|
+
|
1182
|
+
friend class CFactory;
|
1183
|
+
friend class SimpleCFactory;
|
1184
|
+
friend class ICUCollatorFactory;
|
1185
|
+
friend class ICUCollatorService;
|
1186
|
+
static Collator* makeInstance(const Locale& desiredLocale,
|
1187
|
+
UErrorCode& status);
|
1188
|
+
};
|
1189
|
+
|
1190
|
+
#if !UCONFIG_NO_SERVICE
|
1191
|
+
/**
|
1192
|
+
* A factory, used with registerFactory, the creates multiple collators and provides
|
1193
|
+
* display names for them. A factory supports some number of locales-- these are the
|
1194
|
+
* locales for which it can create collators. The factory can be visible, in which
|
1195
|
+
* case the supported locales will be enumerated by getAvailableLocales, or invisible,
|
1196
|
+
* in which they are not. Invisible locales are still supported, they are just not
|
1197
|
+
* listed by getAvailableLocales.
|
1198
|
+
* <p>
|
1199
|
+
* If standard locale display names are sufficient, Collator instances can
|
1200
|
+
* be registered using registerInstance instead.</p>
|
1201
|
+
* <p>
|
1202
|
+
* Note: if the collators are to be used from C APIs, they must be instances
|
1203
|
+
* of RuleBasedCollator.</p>
|
1204
|
+
*
|
1205
|
+
* @stable ICU 2.6
|
1206
|
+
*/
|
1207
|
+
class U_I18N_API CollatorFactory : public UObject {
|
1208
|
+
public:
|
1209
|
+
|
1210
|
+
/**
|
1211
|
+
* Destructor
|
1212
|
+
* @stable ICU 3.0
|
1213
|
+
*/
|
1214
|
+
virtual ~CollatorFactory();
|
1215
|
+
|
1216
|
+
/**
|
1217
|
+
* Return true if this factory is visible. Default is true.
|
1218
|
+
* If not visible, the locales supported by this factory will not
|
1219
|
+
* be listed by getAvailableLocales.
|
1220
|
+
* @return true if the factory is visible.
|
1221
|
+
* @stable ICU 2.6
|
1222
|
+
*/
|
1223
|
+
virtual UBool visible(void) const;
|
1224
|
+
|
1225
|
+
/**
|
1226
|
+
* Return a collator for the provided locale. If the locale
|
1227
|
+
* is not supported, return NULL.
|
1228
|
+
* @param loc the locale identifying the collator to be created.
|
1229
|
+
* @return a new collator if the locale is supported, otherwise NULL.
|
1230
|
+
* @stable ICU 2.6
|
1231
|
+
*/
|
1232
|
+
virtual Collator* createCollator(const Locale& loc) = 0;
|
1233
|
+
|
1234
|
+
/**
|
1235
|
+
* Return the name of the collator for the objectLocale, localized for the displayLocale.
|
1236
|
+
* If objectLocale is not supported, or the factory is not visible, set the result string
|
1237
|
+
* to bogus.
|
1238
|
+
* @param objectLocale the locale identifying the collator
|
1239
|
+
* @param displayLocale the locale for which the display name of the collator should be localized
|
1240
|
+
* @param result an output parameter for the display name, set to bogus if not supported.
|
1241
|
+
* @return the display name
|
1242
|
+
* @stable ICU 2.6
|
1243
|
+
*/
|
1244
|
+
virtual UnicodeString& getDisplayName(const Locale& objectLocale,
|
1245
|
+
const Locale& displayLocale,
|
1246
|
+
UnicodeString& result);
|
1247
|
+
|
1248
|
+
/**
|
1249
|
+
* Return an array of all the locale names directly supported by this factory.
|
1250
|
+
* The number of names is returned in count. This array is owned by the factory.
|
1251
|
+
* Its contents must never change.
|
1252
|
+
* @param count output parameter for the number of locales supported by the factory
|
1253
|
+
* @param status the in/out error code
|
1254
|
+
* @return a pointer to an array of count UnicodeStrings.
|
1255
|
+
* @stable ICU 2.6
|
1256
|
+
*/
|
1257
|
+
virtual const UnicodeString * getSupportedIDs(int32_t &count, UErrorCode& status) = 0;
|
1258
|
+
};
|
1259
|
+
#endif /* UCONFIG_NO_SERVICE */
|
1260
|
+
|
1261
|
+
// Collator inline methods -----------------------------------------------
|
1262
|
+
|
1263
|
+
U_NAMESPACE_END
|
1264
|
+
|
1265
|
+
#endif /* #if !UCONFIG_NO_COLLATION */
|
1266
|
+
|
1267
|
+
#endif
|