pango 2.2.4-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README +33 -0
- data/Rakefile +65 -0
- data/ext/pango/depend +12 -0
- data/ext/pango/extconf.rb +90 -0
- data/ext/pango/pango.def +18 -0
- data/ext/pango/rbpango.c +318 -0
- data/ext/pango/rbpango.h +96 -0
- data/ext/pango/rbpangoanalysis.c +218 -0
- data/ext/pango/rbpangoattribute.c +499 -0
- data/ext/pango/rbpangoattriterator.c +141 -0
- data/ext/pango/rbpangoattrlist.c +101 -0
- data/ext/pango/rbpangocairo.c +122 -0
- data/ext/pango/rbpangocairocontext.c +131 -0
- data/ext/pango/rbpangocolor.c +120 -0
- data/ext/pango/rbpangocontext.c +309 -0
- data/ext/pango/rbpangoconversions.h +111 -0
- data/ext/pango/rbpangocoverage.c +106 -0
- data/ext/pango/rbpangoengine.c +73 -0
- data/ext/pango/rbpangofont.c +110 -0
- data/ext/pango/rbpangofontdescription.c +282 -0
- data/ext/pango/rbpangofontface.c +73 -0
- data/ext/pango/rbpangofontfamily.c +79 -0
- data/ext/pango/rbpangofontmap.c +102 -0
- data/ext/pango/rbpangofontmetrics.c +85 -0
- data/ext/pango/rbpangofontset.c +69 -0
- data/ext/pango/rbpangofontsetsimple.c +60 -0
- data/ext/pango/rbpangoglyphinfo.c +123 -0
- data/ext/pango/rbpangoglyphitem.c +125 -0
- data/ext/pango/rbpangoglyphstring.c +151 -0
- data/ext/pango/rbpangogravity.c +54 -0
- data/ext/pango/rbpangoitem.c +95 -0
- data/ext/pango/rbpangolanguage.c +86 -0
- data/ext/pango/rbpangolayout.c +572 -0
- data/ext/pango/rbpangolayoutiter.c +189 -0
- data/ext/pango/rbpangolayoutline.c +239 -0
- data/ext/pango/rbpangologattr.c +109 -0
- data/ext/pango/rbpangomatrix.c +143 -0
- data/ext/pango/rbpangoprivate.h +49 -0
- data/ext/pango/rbpangorectangle.c +170 -0
- data/ext/pango/rbpangorenderer.c +193 -0
- data/ext/pango/rbpangoscript.c +84 -0
- data/ext/pango/rbpangoscriptiter.c +92 -0
- data/ext/pango/rbpangotabarray.c +128 -0
- data/extconf.rb +49 -0
- data/lib/2.0/pango.so +0 -0
- data/lib/2.1/pango.so +0 -0
- data/lib/2.2/pango.so +0 -0
- data/lib/pango.rb +79 -0
- data/sample/attribute.rb +82 -0
- data/sample/break.rb +28 -0
- data/sample/gdk_layout.rb +27 -0
- data/sample/glyphstring.rb +61 -0
- data/sample/item.rb +37 -0
- data/sample/label.rb +23 -0
- data/sample/layout.rb +102 -0
- data/sample/pango_cairo.rb +66 -0
- data/sample/parse.rb +33 -0
- data/sample/sample.txt +10 -0
- data/sample/script.rb +23 -0
- data/test/pango-test-utils.rb +9 -0
- data/test/run-test.rb +28 -0
- data/test/test-analysis.rb +26 -0
- data/test/test-attribute.rb +19 -0
- data/test/test-color.rb +47 -0
- data/test/test-language.rb +7 -0
- data/test/test-layout.rb +34 -0
- data/test/test-log-attr.rb +26 -0
- data/test/test-matrix.rb +26 -0
- data/test/test-rectangle.rb +26 -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/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 +19 -0
- data/vendor/local/include/harfbuzz/hb-blob.h +126 -0
- data/vendor/local/include/harfbuzz/hb-buffer.h +344 -0
- data/vendor/local/include/harfbuzz/hb-common.h +344 -0
- data/vendor/local/include/harfbuzz/hb-deprecated.h +51 -0
- data/vendor/local/include/harfbuzz/hb-face.h +117 -0
- data/vendor/local/include/harfbuzz/hb-font.h +507 -0
- data/vendor/local/include/harfbuzz/hb-ft.h +62 -0
- data/vendor/local/include/harfbuzz/hb-glib.h +52 -0
- 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 +302 -0
- data/vendor/local/include/harfbuzz/hb-ot-shape.h +53 -0
- data/vendor/local/include/harfbuzz/hb-ot-tag.h +59 -0
- data/vendor/local/include/harfbuzz/hb-ot.h +43 -0
- data/vendor/local/include/harfbuzz/hb-set.h +154 -0
- data/vendor/local/include/harfbuzz/hb-shape-plan.h +89 -0
- data/vendor/local/include/harfbuzz/hb-shape.h +81 -0
- data/vendor/local/include/harfbuzz/hb-unicode.h +445 -0
- data/vendor/local/include/harfbuzz/hb-version.h +66 -0
- data/vendor/local/include/harfbuzz/hb.h +47 -0
- 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-attributes.h +514 -0
- data/vendor/local/include/pango-1.0/pango/pango-bidi-type.h +136 -0
- data/vendor/local/include/pango-1.0/pango/pango-break.h +173 -0
- data/vendor/local/include/pango-1.0/pango/pango-context.h +112 -0
- data/vendor/local/include/pango-1.0/pango/pango-coverage.h +79 -0
- data/vendor/local/include/pango-1.0/pango/pango-engine.h +429 -0
- data/vendor/local/include/pango-1.0/pango/pango-enum-types.h +69 -0
- data/vendor/local/include/pango-1.0/pango/pango-features.h +12 -0
- data/vendor/local/include/pango-1.0/pango/pango-font.h +622 -0
- data/vendor/local/include/pango-1.0/pango/pango-fontmap.h +167 -0
- data/vendor/local/include/pango-1.0/pango/pango-fontset.h +169 -0
- data/vendor/local/include/pango-1.0/pango/pango-glyph-item.h +158 -0
- data/vendor/local/include/pango-1.0/pango/pango-glyph.h +197 -0
- data/vendor/local/include/pango-1.0/pango/pango-gravity.h +128 -0
- data/vendor/local/include/pango-1.0/pango/pango-item.h +109 -0
- data/vendor/local/include/pango-1.0/pango/pango-language.h +61 -0
- data/vendor/local/include/pango-1.0/pango/pango-layout.h +340 -0
- data/vendor/local/include/pango-1.0/pango/pango-matrix.h +117 -0
- data/vendor/local/include/pango-1.0/pango/pango-modules.h +71 -0
- data/vendor/local/include/pango-1.0/pango/pango-ot.h +391 -0
- data/vendor/local/include/pango-1.0/pango/pango-renderer.h +260 -0
- data/vendor/local/include/pango-1.0/pango/pango-script.h +260 -0
- data/vendor/local/include/pango-1.0/pango/pango-tabs.h +87 -0
- data/vendor/local/include/pango-1.0/pango/pango-types.h +200 -0
- data/vendor/local/include/pango-1.0/pango/pango-utils.h +189 -0
- data/vendor/local/include/pango-1.0/pango/pango.h +48 -0
- data/vendor/local/include/pango-1.0/pango/pangocairo.h +169 -0
- data/vendor/local/include/pango-1.0/pango/pangofc-decoder.h +110 -0
- data/vendor/local/include/pango-1.0/pango/pangofc-font.h +153 -0
- data/vendor/local/include/pango-1.0/pango/pangofc-fontmap.h +289 -0
- data/vendor/local/include/pango-1.0/pango/pangoft2.h +133 -0
- data/vendor/local/include/pango-1.0/pango/pangowin32.h +128 -0
- 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 +41 -0
- 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 +41 -0
- data/vendor/local/lib/libpangocairo-1.0.dll.a +0 -0
- data/vendor/local/lib/libpangocairo-1.0.la +41 -0
- data/vendor/local/lib/libpangoft2-1.0.dll.a +0 -0
- data/vendor/local/lib/libpangoft2-1.0.la +41 -0
- data/vendor/local/lib/libpangowin32-1.0.dll.a +0 -0
- data/vendor/local/lib/libpangowin32-1.0.la +41 -0
- 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 +41 -0
- 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 +41 -0
- 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 +41 -0
- 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 +41 -0
- data/vendor/local/lib/pkgconfig/harfbuzz-icu.pc +13 -0
- data/vendor/local/lib/pkgconfig/harfbuzz.pc +11 -0
- 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 +14 -0
- data/vendor/local/lib/pkgconfig/pangocairo.pc +11 -0
- data/vendor/local/lib/pkgconfig/pangoft2.pc +12 -0
- data/vendor/local/lib/pkgconfig/pangowin32.pc +11 -0
- data/vendor/local/share/gir-1.0/Pango-1.0.gir +13329 -0
- data/vendor/local/share/gir-1.0/PangoCairo-1.0.gir +833 -0
- data/vendor/local/share/gir-1.0/PangoFT2-1.0.gir +354 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/annotation-glossary.html +75 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/api-index-full.html +1449 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/ch01.html +98 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/deprecated-api-index.html +46 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-blob.html +610 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-buffer.html +1780 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-common.html +1337 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-coretext.html +144 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-deprecated.html +99 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-face.html +630 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-font.html +2529 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-ft.html +188 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-glib.html +120 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-gobject.html +50 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-graphite2.html +120 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-icu.html +120 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-ot-layout.html +771 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-ot-tag.html +172 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-ot.html +50 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-set.html +966 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-shape-plan.html +405 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-shape.html +286 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-unicode.html +1523 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-uniscribe.html +100 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-version.html +182 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb.html +50 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz.devhelp2 +378 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/home.png +0 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/index.html +105 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/index.sgml +496 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/left-insensitive.png +0 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/left.png +0 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/object-tree.html +59 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/right-insensitive.png +0 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/right.png +0 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/style.css +476 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/up-insensitive.png +0 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/up.png +0 -0
- data/vendor/local/share/gtk-doc/html/pango/PangoEngineLang.html +224 -0
- data/vendor/local/share/gtk-doc/html/pango/PangoEngineShape.html +255 -0
- data/vendor/local/share/gtk-doc/html/pango/PangoFcDecoder.html +246 -0
- data/vendor/local/share/gtk-doc/html/pango/PangoFcFont.html +500 -0
- data/vendor/local/share/gtk-doc/html/pango/PangoFcFontMap.html +1001 -0
- data/vendor/local/share/gtk-doc/html/pango/PangoMarkupFormat.html +301 -0
- data/vendor/local/share/gtk-doc/html/pango/PangoRenderer.html +1219 -0
- data/vendor/local/share/gtk-doc/html/pango/annotation-glossary.html +89 -0
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-10.html +135 -0
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-12.html +49 -0
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-14.html +64 -0
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-16.html +228 -0
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-18.html +152 -0
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-2.html +122 -0
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-20.html +87 -0
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-22.html +124 -0
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-24.html +97 -0
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-26.html +46 -0
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-30.html +39 -0
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-31-0.html +39 -0
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-32-4.html +53 -0
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-32.html +42 -0
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-34.html +38 -0
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-4.html +201 -0
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-6.html +165 -0
- data/vendor/local/share/gtk-doc/html/pango/api-index-1-8.html +171 -0
- data/vendor/local/share/gtk-doc/html/pango/api-index-deprecated.html +284 -0
- data/vendor/local/share/gtk-doc/html/pango/api-index-full.html +2968 -0
- data/vendor/local/share/gtk-doc/html/pango/home.png +0 -0
- data/vendor/local/share/gtk-doc/html/pango/index.html +146 -0
- data/vendor/local/share/gtk-doc/html/pango/index.sgml +957 -0
- data/vendor/local/share/gtk-doc/html/pango/layout.gif +0 -0
- data/vendor/local/share/gtk-doc/html/pango/left-insensitive.png +0 -0
- data/vendor/local/share/gtk-doc/html/pango/left.png +0 -0
- data/vendor/local/share/gtk-doc/html/pango/lowlevel.html +68 -0
- data/vendor/local/share/gtk-doc/html/pango/pango-Bidirectional-Text.html +514 -0
- data/vendor/local/share/gtk-doc/html/pango/pango-Cairo-Rendering.html +1632 -0
- data/vendor/local/share/gtk-doc/html/pango/pango-CoreText-Fonts.html +115 -0
- data/vendor/local/share/gtk-doc/html/pango/pango-Coverage-Maps.html +508 -0
- data/vendor/local/share/gtk-doc/html/pango/pango-Engines.html +358 -0
- data/vendor/local/share/gtk-doc/html/pango/pango-Fonts.html +4154 -0
- data/vendor/local/share/gtk-doc/html/pango/pango-FreeType-Fonts-and-Rendering.html +956 -0
- data/vendor/local/share/gtk-doc/html/pango/pango-Glyph-Storage.html +2627 -0
- data/vendor/local/share/gtk-doc/html/pango/pango-Layout-Objects.html +4153 -0
- data/vendor/local/share/gtk-doc/html/pango/pango-Miscellaneous-Utilities.html +965 -0
- data/vendor/local/share/gtk-doc/html/pango/pango-Modules.html +331 -0
- data/vendor/local/share/gtk-doc/html/pango/pango-OpenType-Font-Handling.html +2202 -0
- data/vendor/local/share/gtk-doc/html/pango/pango-Scripts-and-Languages.html +1430 -0
- data/vendor/local/share/gtk-doc/html/pango/pango-Tab-Stops.html +582 -0
- data/vendor/local/share/gtk-doc/html/pango/pango-Text-Attributes.html +3356 -0
- data/vendor/local/share/gtk-doc/html/pango/pango-Text-Processing.html +2079 -0
- data/vendor/local/share/gtk-doc/html/pango/pango-Version-Checking.html +325 -0
- data/vendor/local/share/gtk-doc/html/pango/pango-Vertical-Text.html +523 -0
- data/vendor/local/share/gtk-doc/html/pango/pango-Win32-Fonts-and-Rendering.html +1028 -0
- data/vendor/local/share/gtk-doc/html/pango/pango-Xft-Fonts-and-Rendering.html +1275 -0
- data/vendor/local/share/gtk-doc/html/pango/pango-hierarchy.html +91 -0
- data/vendor/local/share/gtk-doc/html/pango/pango-querymodules.html +131 -0
- data/vendor/local/share/gtk-doc/html/pango/pango.devhelp2 +786 -0
- data/vendor/local/share/gtk-doc/html/pango/pango.html +63 -0
- data/vendor/local/share/gtk-doc/html/pango/rendering.html +47 -0
- data/vendor/local/share/gtk-doc/html/pango/right-insensitive.png +0 -0
- data/vendor/local/share/gtk-doc/html/pango/right.png +0 -0
- data/vendor/local/share/gtk-doc/html/pango/rotated-text.png +0 -0
- data/vendor/local/share/gtk-doc/html/pango/style.css +476 -0
- data/vendor/local/share/gtk-doc/html/pango/tools.html +33 -0
- data/vendor/local/share/gtk-doc/html/pango/up-insensitive.png +0 -0
- data/vendor/local/share/gtk-doc/html/pango/up.png +0 -0
- data/vendor/local/share/icu/54.1/config/mh-mingw64 +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 +9 -0
- data/vendor/local/share/license/harfbuzz/COPYING +36 -0
- data/vendor/local/share/license/pango/AUTHORS +2 -0
- data/vendor/local/share/license/pango/COPYING +482 -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 +106 -0
- data/vendor/local/share/man/man1/pango-view.1 +1 -0
- 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 +599 -0
@@ -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
|