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,1093 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (C) 2007-2013, International Business Machines Corporation and
|
3
|
+
* others. All Rights Reserved.
|
4
|
+
********************************************************************************
|
5
|
+
*
|
6
|
+
* File MSGFMT.H
|
7
|
+
*
|
8
|
+
* Modification History:
|
9
|
+
*
|
10
|
+
* Date Name Description
|
11
|
+
* 02/19/97 aliu Converted from java.
|
12
|
+
* 03/20/97 helena Finished first cut of implementation.
|
13
|
+
* 07/22/98 stephen Removed operator!= (defined in Format)
|
14
|
+
* 08/19/2002 srl Removing Javaisms
|
15
|
+
*******************************************************************************/
|
16
|
+
|
17
|
+
#ifndef MSGFMT_H
|
18
|
+
#define MSGFMT_H
|
19
|
+
|
20
|
+
#include "unicode/utypes.h"
|
21
|
+
|
22
|
+
/**
|
23
|
+
* \file
|
24
|
+
* \brief C++ API: Formats messages in a language-neutral way.
|
25
|
+
*/
|
26
|
+
|
27
|
+
#if !UCONFIG_NO_FORMATTING
|
28
|
+
|
29
|
+
#include "unicode/format.h"
|
30
|
+
#include "unicode/locid.h"
|
31
|
+
#include "unicode/messagepattern.h"
|
32
|
+
#include "unicode/parseerr.h"
|
33
|
+
#include "unicode/plurfmt.h"
|
34
|
+
#include "unicode/plurrule.h"
|
35
|
+
|
36
|
+
U_CDECL_BEGIN
|
37
|
+
// Forward declaration.
|
38
|
+
struct UHashtable;
|
39
|
+
typedef struct UHashtable UHashtable; /**< @internal */
|
40
|
+
U_CDECL_END
|
41
|
+
|
42
|
+
U_NAMESPACE_BEGIN
|
43
|
+
|
44
|
+
class AppendableWrapper;
|
45
|
+
class DateFormat;
|
46
|
+
class NumberFormat;
|
47
|
+
|
48
|
+
/**
|
49
|
+
* <p>MessageFormat prepares strings for display to users,
|
50
|
+
* with optional arguments (variables/placeholders).
|
51
|
+
* The arguments can occur in any order, which is necessary for translation
|
52
|
+
* into languages with different grammars.
|
53
|
+
*
|
54
|
+
* <p>A MessageFormat is constructed from a <em>pattern</em> string
|
55
|
+
* with arguments in {curly braces} which will be replaced by formatted values.
|
56
|
+
*
|
57
|
+
* <p><code>MessageFormat</code> differs from the other <code>Format</code>
|
58
|
+
* classes in that you create a <code>MessageFormat</code> object with one
|
59
|
+
* of its constructors (not with a <code>createInstance</code> style factory
|
60
|
+
* method). Factory methods aren't necessary because <code>MessageFormat</code>
|
61
|
+
* itself doesn't implement locale-specific behavior. Any locale-specific
|
62
|
+
* behavior is defined by the pattern that you provide and the
|
63
|
+
* subformats used for inserted arguments.
|
64
|
+
*
|
65
|
+
* <p>Arguments can be named (using identifiers) or numbered (using small ASCII-digit integers).
|
66
|
+
* Some of the API methods work only with argument numbers and throw an exception
|
67
|
+
* if the pattern has named arguments (see {@link #usesNamedArguments()}).
|
68
|
+
*
|
69
|
+
* <p>An argument might not specify any format type. In this case,
|
70
|
+
* a Number value is formatted with a default (for the locale) NumberFormat,
|
71
|
+
* a Date value is formatted with a default (for the locale) DateFormat,
|
72
|
+
* and for any other value its toString() value is used.
|
73
|
+
*
|
74
|
+
* <p>An argument might specify a "simple" type for which the specified
|
75
|
+
* Format object is created, cached and used.
|
76
|
+
*
|
77
|
+
* <p>An argument might have a "complex" type with nested MessageFormat sub-patterns.
|
78
|
+
* During formatting, one of these sub-messages is selected according to the argument value
|
79
|
+
* and recursively formatted.
|
80
|
+
*
|
81
|
+
* <p>After construction, a custom Format object can be set for
|
82
|
+
* a top-level argument, overriding the default formatting and parsing behavior
|
83
|
+
* for that argument.
|
84
|
+
* However, custom formatting can be achieved more simply by writing
|
85
|
+
* a typeless argument in the pattern string
|
86
|
+
* and supplying it with a preformatted string value.
|
87
|
+
*
|
88
|
+
* <p>When formatting, MessageFormat takes a collection of argument values
|
89
|
+
* and writes an output string.
|
90
|
+
* The argument values may be passed as an array
|
91
|
+
* (when the pattern contains only numbered arguments)
|
92
|
+
* or as an array of names and and an array of arguments (which works for both named
|
93
|
+
* and numbered arguments).
|
94
|
+
*
|
95
|
+
* <p>Each argument is matched with one of the input values by array index or argument name
|
96
|
+
* and formatted according to its pattern specification
|
97
|
+
* (or using a custom Format object if one was set).
|
98
|
+
* A numbered pattern argument is matched with an argument name that contains that number
|
99
|
+
* as an ASCII-decimal-digit string (without leading zero).
|
100
|
+
*
|
101
|
+
* <h4><a name="patterns">Patterns and Their Interpretation</a></h4>
|
102
|
+
*
|
103
|
+
* <code>MessageFormat</code> uses patterns of the following form:
|
104
|
+
* <pre>
|
105
|
+
* message = messageText (argument messageText)*
|
106
|
+
* argument = noneArg | simpleArg | complexArg
|
107
|
+
* complexArg = choiceArg | pluralArg | selectArg | selectordinalArg
|
108
|
+
*
|
109
|
+
* noneArg = '{' argNameOrNumber '}'
|
110
|
+
* simpleArg = '{' argNameOrNumber ',' argType [',' argStyle] '}'
|
111
|
+
* choiceArg = '{' argNameOrNumber ',' "choice" ',' choiceStyle '}'
|
112
|
+
* pluralArg = '{' argNameOrNumber ',' "plural" ',' pluralStyle '}'
|
113
|
+
* selectArg = '{' argNameOrNumber ',' "select" ',' selectStyle '}'
|
114
|
+
* selectordinalArg = '{' argNameOrNumber ',' "selectordinal" ',' pluralStyle '}'
|
115
|
+
*
|
116
|
+
* choiceStyle: see {@link ChoiceFormat}
|
117
|
+
* pluralStyle: see {@link PluralFormat}
|
118
|
+
* selectStyle: see {@link SelectFormat}
|
119
|
+
*
|
120
|
+
* argNameOrNumber = argName | argNumber
|
121
|
+
* argName = [^[[:Pattern_Syntax:][:Pattern_White_Space:]]]+
|
122
|
+
* argNumber = '0' | ('1'..'9' ('0'..'9')*)
|
123
|
+
*
|
124
|
+
* argType = "number" | "date" | "time" | "spellout" | "ordinal" | "duration"
|
125
|
+
* argStyle = "short" | "medium" | "long" | "full" | "integer" | "currency" | "percent" | argStyleText
|
126
|
+
* </pre>
|
127
|
+
*
|
128
|
+
* <ul>
|
129
|
+
* <li>messageText can contain quoted literal strings including syntax characters.
|
130
|
+
* A quoted literal string begins with an ASCII apostrophe and a syntax character
|
131
|
+
* (usually a {curly brace}) and continues until the next single apostrophe.
|
132
|
+
* A double ASCII apostrohpe inside or outside of a quoted string represents
|
133
|
+
* one literal apostrophe.
|
134
|
+
* <li>Quotable syntax characters are the {curly braces} in all messageText parts,
|
135
|
+
* plus the '#' sign in a messageText immediately inside a pluralStyle,
|
136
|
+
* and the '|' symbol in a messageText immediately inside a choiceStyle.
|
137
|
+
* <li>See also {@link #UMessagePatternApostropheMode}
|
138
|
+
* <li>In argStyleText, every single ASCII apostrophe begins and ends quoted literal text,
|
139
|
+
* and unquoted {curly braces} must occur in matched pairs.
|
140
|
+
* </ul>
|
141
|
+
*
|
142
|
+
* <p>Recommendation: Use the real apostrophe (single quote) character
|
143
|
+
* \htmlonly’\endhtmlonly (U+2019) for
|
144
|
+
* human-readable text, and use the ASCII apostrophe ' (U+0027)
|
145
|
+
* only in program syntax, like quoting in MessageFormat.
|
146
|
+
* See the annotations for U+0027 Apostrophe in The Unicode Standard.
|
147
|
+
*
|
148
|
+
* <p>The <code>choice</code> argument type is deprecated.
|
149
|
+
* Use <code>plural</code> arguments for proper plural selection,
|
150
|
+
* and <code>select</code> arguments for simple selection among a fixed set of choices.
|
151
|
+
*
|
152
|
+
* <p>The <code>argType</code> and <code>argStyle</code> values are used to create
|
153
|
+
* a <code>Format</code> instance for the format element. The following
|
154
|
+
* table shows how the values map to Format instances. Combinations not
|
155
|
+
* shown in the table are illegal. Any <code>argStyleText</code> must
|
156
|
+
* be a valid pattern string for the Format subclass used.
|
157
|
+
*
|
158
|
+
* <p><table border=1>
|
159
|
+
* <tr>
|
160
|
+
* <th>argType
|
161
|
+
* <th>argStyle
|
162
|
+
* <th>resulting Format object
|
163
|
+
* <tr>
|
164
|
+
* <td colspan=2><i>(none)</i>
|
165
|
+
* <td><code>null</code>
|
166
|
+
* <tr>
|
167
|
+
* <td rowspan=5><code>number</code>
|
168
|
+
* <td><i>(none)</i>
|
169
|
+
* <td><code>NumberFormat.createInstance(getLocale(), status)</code>
|
170
|
+
* <tr>
|
171
|
+
* <td><code>integer</code>
|
172
|
+
* <td><code>NumberFormat.createInstance(getLocale(), kNumberStyle, status)</code>
|
173
|
+
* <tr>
|
174
|
+
* <td><code>currency</code>
|
175
|
+
* <td><code>NumberFormat.createCurrencyInstance(getLocale(), status)</code>
|
176
|
+
* <tr>
|
177
|
+
* <td><code>percent</code>
|
178
|
+
* <td><code>NumberFormat.createPercentInstance(getLocale(), status)</code>
|
179
|
+
* <tr>
|
180
|
+
* <td><i>argStyleText</i>
|
181
|
+
* <td><code>new DecimalFormat(argStyleText, new DecimalFormatSymbols(getLocale(), status), status)</code>
|
182
|
+
* <tr>
|
183
|
+
* <td rowspan=6><code>date</code>
|
184
|
+
* <td><i>(none)</i>
|
185
|
+
* <td><code>DateFormat.createDateInstance(kDefault, getLocale(), status)</code>
|
186
|
+
* <tr>
|
187
|
+
* <td><code>short</code>
|
188
|
+
* <td><code>DateFormat.createDateInstance(kShort, getLocale(), status)</code>
|
189
|
+
* <tr>
|
190
|
+
* <td><code>medium</code>
|
191
|
+
* <td><code>DateFormat.createDateInstance(kDefault, getLocale(), status)</code>
|
192
|
+
* <tr>
|
193
|
+
* <td><code>long</code>
|
194
|
+
* <td><code>DateFormat.createDateInstance(kLong, getLocale(), status)</code>
|
195
|
+
* <tr>
|
196
|
+
* <td><code>full</code>
|
197
|
+
* <td><code>DateFormat.createDateInstance(kFull, getLocale(), status)</code>
|
198
|
+
* <tr>
|
199
|
+
* <td><i>argStyleText</i>
|
200
|
+
* <td><code>new SimpleDateFormat(argStyleText, getLocale(), status)
|
201
|
+
* <tr>
|
202
|
+
* <td rowspan=6><code>time</code>
|
203
|
+
* <td><i>(none)</i>
|
204
|
+
* <td><code>DateFormat.createTimeInstance(kDefault, getLocale(), status)</code>
|
205
|
+
* <tr>
|
206
|
+
* <td><code>short</code>
|
207
|
+
* <td><code>DateFormat.createTimeInstance(kShort, getLocale(), status)</code>
|
208
|
+
* <tr>
|
209
|
+
* <td><code>medium</code>
|
210
|
+
* <td><code>DateFormat.createTimeInstance(kDefault, getLocale(), status)</code>
|
211
|
+
* <tr>
|
212
|
+
* <td><code>long</code>
|
213
|
+
* <td><code>DateFormat.createTimeInstance(kLong, getLocale(), status)</code>
|
214
|
+
* <tr>
|
215
|
+
* <td><code>full</code>
|
216
|
+
* <td><code>DateFormat.createTimeInstance(kFull, getLocale(), status)</code>
|
217
|
+
* <tr>
|
218
|
+
* <td><i>argStyleText</i>
|
219
|
+
* <td><code>new SimpleDateFormat(argStyleText, getLocale(), status)
|
220
|
+
* <tr>
|
221
|
+
* <td><code>spellout</code>
|
222
|
+
* <td><i>argStyleText (optional)</i>
|
223
|
+
* <td><code>new RuleBasedNumberFormat(URBNF_SPELLOUT, getLocale(), status)
|
224
|
+
* <br/> .setDefaultRuleset(argStyleText, status);</code>
|
225
|
+
* <tr>
|
226
|
+
* <td><code>ordinal</code>
|
227
|
+
* <td><i>argStyleText (optional)</i>
|
228
|
+
* <td><code>new RuleBasedNumberFormat(URBNF_ORDINAL, getLocale(), status)
|
229
|
+
* <br/> .setDefaultRuleset(argStyleText, status);</code>
|
230
|
+
* <tr>
|
231
|
+
* <td><code>duration</code>
|
232
|
+
* <td><i>argStyleText (optional)</i>
|
233
|
+
* <td><code>new RuleBasedNumberFormat(URBNF_DURATION, getLocale(), status)
|
234
|
+
* <br/> .setDefaultRuleset(argStyleText, status);</code>
|
235
|
+
* </table>
|
236
|
+
* <p>
|
237
|
+
*
|
238
|
+
* <h4>Usage Information</h4>
|
239
|
+
*
|
240
|
+
* <p>Here are some examples of usage:
|
241
|
+
* Example 1:
|
242
|
+
*
|
243
|
+
* <pre>
|
244
|
+
* \code
|
245
|
+
* UErrorCode success = U_ZERO_ERROR;
|
246
|
+
* GregorianCalendar cal(success);
|
247
|
+
* Formattable arguments[] = {
|
248
|
+
* 7L,
|
249
|
+
* Formattable( (Date) cal.getTime(success), Formattable::kIsDate),
|
250
|
+
* "a disturbance in the Force"
|
251
|
+
* };
|
252
|
+
*
|
253
|
+
* UnicodeString result;
|
254
|
+
* MessageFormat::format(
|
255
|
+
* "At {1,time} on {1,date}, there was {2} on planet {0,number}.",
|
256
|
+
* arguments, 3, result, success );
|
257
|
+
*
|
258
|
+
* cout << "result: " << result << endl;
|
259
|
+
* //<output>: At 4:34:20 PM on 23-Mar-98, there was a disturbance
|
260
|
+
* // in the Force on planet 7.
|
261
|
+
* \endcode
|
262
|
+
* </pre>
|
263
|
+
*
|
264
|
+
* Typically, the message format will come from resources, and the
|
265
|
+
* arguments will be dynamically set at runtime.
|
266
|
+
*
|
267
|
+
* <p>Example 2:
|
268
|
+
*
|
269
|
+
* <pre>
|
270
|
+
* \code
|
271
|
+
* success = U_ZERO_ERROR;
|
272
|
+
* Formattable testArgs[] = {3L, "MyDisk"};
|
273
|
+
*
|
274
|
+
* MessageFormat form(
|
275
|
+
* "The disk \"{1}\" contains {0} file(s).", success );
|
276
|
+
*
|
277
|
+
* UnicodeString string;
|
278
|
+
* FieldPosition fpos = 0;
|
279
|
+
* cout << "format: " << form.format(testArgs, 2, string, fpos, success ) << endl;
|
280
|
+
*
|
281
|
+
* // output, with different testArgs:
|
282
|
+
* // output: The disk "MyDisk" contains 0 file(s).
|
283
|
+
* // output: The disk "MyDisk" contains 1 file(s).
|
284
|
+
* // output: The disk "MyDisk" contains 1,273 file(s).
|
285
|
+
* \endcode
|
286
|
+
* </pre>
|
287
|
+
*
|
288
|
+
*
|
289
|
+
* <p>For messages that include plural forms, you can use a plural argument:
|
290
|
+
* <pre>
|
291
|
+
* \code
|
292
|
+
* success = U_ZERO_ERROR;
|
293
|
+
* MessageFormat msgFmt(
|
294
|
+
* "{num_files, plural, "
|
295
|
+
* "=0{There are no files on disk \"{disk_name}\".}"
|
296
|
+
* "=1{There is one file on disk \"{disk_name}\".}"
|
297
|
+
* "other{There are # files on disk \"{disk_name}\".}}",
|
298
|
+
* Locale("en"),
|
299
|
+
* success);
|
300
|
+
* FieldPosition fpos = 0;
|
301
|
+
* Formattable testArgs[] = {0L, "MyDisk"};
|
302
|
+
* UnicodeString testArgsNames[] = {"num_files", "disk_name"};
|
303
|
+
* UnicodeString result;
|
304
|
+
* cout << msgFmt.format(testArgs, testArgsNames, 2, result, fpos, 0, success);
|
305
|
+
* testArgs[0] = 3L;
|
306
|
+
* cout << msgFmt.format(testArgs, testArgsNames, 2, result, fpos, 0, success);
|
307
|
+
* \endcode
|
308
|
+
* <em>output</em>:
|
309
|
+
* There are no files on disk "MyDisk".
|
310
|
+
* There are 3 files on "MyDisk".
|
311
|
+
* </pre>
|
312
|
+
* See {@link PluralFormat} and {@link PluralRules} for details.
|
313
|
+
*
|
314
|
+
* <h4><a name="synchronization">Synchronization</a></h4>
|
315
|
+
*
|
316
|
+
* <p>MessageFormats are not synchronized.
|
317
|
+
* It is recommended to create separate format instances for each thread.
|
318
|
+
* If multiple threads access a format concurrently, it must be synchronized
|
319
|
+
* externally.
|
320
|
+
*
|
321
|
+
* @stable ICU 2.0
|
322
|
+
*/
|
323
|
+
class U_I18N_API MessageFormat : public Format {
|
324
|
+
public:
|
325
|
+
#ifndef U_HIDE_OBSOLETE_API
|
326
|
+
/**
|
327
|
+
* Enum type for kMaxFormat.
|
328
|
+
* @obsolete ICU 3.0. The 10-argument limit was removed as of ICU 2.6,
|
329
|
+
* rendering this enum type obsolete.
|
330
|
+
*/
|
331
|
+
enum EFormatNumber {
|
332
|
+
/**
|
333
|
+
* The maximum number of arguments.
|
334
|
+
* @obsolete ICU 3.0. The 10-argument limit was removed as of ICU 2.6,
|
335
|
+
* rendering this constant obsolete.
|
336
|
+
*/
|
337
|
+
kMaxFormat = 10
|
338
|
+
};
|
339
|
+
#endif /* U_HIDE_OBSOLETE_API */
|
340
|
+
|
341
|
+
/**
|
342
|
+
* Constructs a new MessageFormat using the given pattern and the
|
343
|
+
* default locale.
|
344
|
+
*
|
345
|
+
* @param pattern Pattern used to construct object.
|
346
|
+
* @param status Input/output error code. If the
|
347
|
+
* pattern cannot be parsed, set to failure code.
|
348
|
+
* @stable ICU 2.0
|
349
|
+
*/
|
350
|
+
MessageFormat(const UnicodeString& pattern,
|
351
|
+
UErrorCode &status);
|
352
|
+
|
353
|
+
/**
|
354
|
+
* Constructs a new MessageFormat using the given pattern and locale.
|
355
|
+
* @param pattern Pattern used to construct object.
|
356
|
+
* @param newLocale The locale to use for formatting dates and numbers.
|
357
|
+
* @param status Input/output error code. If the
|
358
|
+
* pattern cannot be parsed, set to failure code.
|
359
|
+
* @stable ICU 2.0
|
360
|
+
*/
|
361
|
+
MessageFormat(const UnicodeString& pattern,
|
362
|
+
const Locale& newLocale,
|
363
|
+
UErrorCode& status);
|
364
|
+
/**
|
365
|
+
* Constructs a new MessageFormat using the given pattern and locale.
|
366
|
+
* @param pattern Pattern used to construct object.
|
367
|
+
* @param newLocale The locale to use for formatting dates and numbers.
|
368
|
+
* @param parseError Struct to receive information on the position
|
369
|
+
* of an error within the pattern.
|
370
|
+
* @param status Input/output error code. If the
|
371
|
+
* pattern cannot be parsed, set to failure code.
|
372
|
+
* @stable ICU 2.0
|
373
|
+
*/
|
374
|
+
MessageFormat(const UnicodeString& pattern,
|
375
|
+
const Locale& newLocale,
|
376
|
+
UParseError& parseError,
|
377
|
+
UErrorCode& status);
|
378
|
+
/**
|
379
|
+
* Constructs a new MessageFormat from an existing one.
|
380
|
+
* @stable ICU 2.0
|
381
|
+
*/
|
382
|
+
MessageFormat(const MessageFormat&);
|
383
|
+
|
384
|
+
/**
|
385
|
+
* Assignment operator.
|
386
|
+
* @stable ICU 2.0
|
387
|
+
*/
|
388
|
+
const MessageFormat& operator=(const MessageFormat&);
|
389
|
+
|
390
|
+
/**
|
391
|
+
* Destructor.
|
392
|
+
* @stable ICU 2.0
|
393
|
+
*/
|
394
|
+
virtual ~MessageFormat();
|
395
|
+
|
396
|
+
/**
|
397
|
+
* Clones this Format object polymorphically. The caller owns the
|
398
|
+
* result and should delete it when done.
|
399
|
+
* @stable ICU 2.0
|
400
|
+
*/
|
401
|
+
virtual Format* clone(void) const;
|
402
|
+
|
403
|
+
/**
|
404
|
+
* Returns true if the given Format objects are semantically equal.
|
405
|
+
* Objects of different subclasses are considered unequal.
|
406
|
+
* @param other the object to be compared with.
|
407
|
+
* @return true if the given Format objects are semantically equal.
|
408
|
+
* @stable ICU 2.0
|
409
|
+
*/
|
410
|
+
virtual UBool operator==(const Format& other) const;
|
411
|
+
|
412
|
+
/**
|
413
|
+
* Sets the locale to be used for creating argument Format objects.
|
414
|
+
* @param theLocale the new locale value to be set.
|
415
|
+
* @stable ICU 2.0
|
416
|
+
*/
|
417
|
+
virtual void setLocale(const Locale& theLocale);
|
418
|
+
|
419
|
+
/**
|
420
|
+
* Gets the locale used for creating argument Format objects.
|
421
|
+
* format information.
|
422
|
+
* @return the locale of the object.
|
423
|
+
* @stable ICU 2.0
|
424
|
+
*/
|
425
|
+
virtual const Locale& getLocale(void) const;
|
426
|
+
|
427
|
+
/**
|
428
|
+
* Applies the given pattern string to this message format.
|
429
|
+
*
|
430
|
+
* @param pattern The pattern to be applied.
|
431
|
+
* @param status Input/output error code. If the
|
432
|
+
* pattern cannot be parsed, set to failure code.
|
433
|
+
* @stable ICU 2.0
|
434
|
+
*/
|
435
|
+
virtual void applyPattern(const UnicodeString& pattern,
|
436
|
+
UErrorCode& status);
|
437
|
+
/**
|
438
|
+
* Applies the given pattern string to this message format.
|
439
|
+
*
|
440
|
+
* @param pattern The pattern to be applied.
|
441
|
+
* @param parseError Struct to receive information on the position
|
442
|
+
* of an error within the pattern.
|
443
|
+
* @param status Input/output error code. If the
|
444
|
+
* pattern cannot be parsed, set to failure code.
|
445
|
+
* @stable ICU 2.0
|
446
|
+
*/
|
447
|
+
virtual void applyPattern(const UnicodeString& pattern,
|
448
|
+
UParseError& parseError,
|
449
|
+
UErrorCode& status);
|
450
|
+
|
451
|
+
/**
|
452
|
+
* Sets the UMessagePatternApostropheMode and the pattern used by this message format.
|
453
|
+
* Parses the pattern and caches Format objects for simple argument types.
|
454
|
+
* Patterns and their interpretation are specified in the
|
455
|
+
* <a href="#patterns">class description</a>.
|
456
|
+
* <p>
|
457
|
+
* This method is best used only once on a given object to avoid confusion about the mode,
|
458
|
+
* and after constructing the object with an empty pattern string to minimize overhead.
|
459
|
+
*
|
460
|
+
* @param pattern The pattern to be applied.
|
461
|
+
* @param aposMode The new apostrophe mode.
|
462
|
+
* @param parseError Struct to receive information on the position
|
463
|
+
* of an error within the pattern.
|
464
|
+
* Can be NULL.
|
465
|
+
* @param status Input/output error code. If the
|
466
|
+
* pattern cannot be parsed, set to failure code.
|
467
|
+
* @stable ICU 4.8
|
468
|
+
*/
|
469
|
+
virtual void applyPattern(const UnicodeString& pattern,
|
470
|
+
UMessagePatternApostropheMode aposMode,
|
471
|
+
UParseError* parseError,
|
472
|
+
UErrorCode& status);
|
473
|
+
|
474
|
+
/**
|
475
|
+
* @return this instance's UMessagePatternApostropheMode.
|
476
|
+
* @stable ICU 4.8
|
477
|
+
*/
|
478
|
+
UMessagePatternApostropheMode getApostropheMode() const {
|
479
|
+
return msgPattern.getApostropheMode();
|
480
|
+
}
|
481
|
+
|
482
|
+
/**
|
483
|
+
* Returns a pattern that can be used to recreate this object.
|
484
|
+
*
|
485
|
+
* @param appendTo Output parameter to receive the pattern.
|
486
|
+
* Result is appended to existing contents.
|
487
|
+
* @return Reference to 'appendTo' parameter.
|
488
|
+
* @stable ICU 2.0
|
489
|
+
*/
|
490
|
+
virtual UnicodeString& toPattern(UnicodeString& appendTo) const;
|
491
|
+
|
492
|
+
/**
|
493
|
+
* Sets subformats.
|
494
|
+
* See the class description about format numbering.
|
495
|
+
* The caller should not delete the Format objects after this call.
|
496
|
+
* <EM>The array formatsToAdopt is not itself adopted.</EM> Its
|
497
|
+
* ownership is retained by the caller. If the call fails because
|
498
|
+
* memory cannot be allocated, then the formats will be deleted
|
499
|
+
* by this method, and this object will remain unchanged.
|
500
|
+
*
|
501
|
+
* <p>If this format uses named arguments, the new formats are discarded
|
502
|
+
* and this format remains unchanged.
|
503
|
+
*
|
504
|
+
* @stable ICU 2.0
|
505
|
+
* @param formatsToAdopt the format to be adopted.
|
506
|
+
* @param count the size of the array.
|
507
|
+
*/
|
508
|
+
virtual void adoptFormats(Format** formatsToAdopt, int32_t count);
|
509
|
+
|
510
|
+
/**
|
511
|
+
* Sets subformats.
|
512
|
+
* See the class description about format numbering.
|
513
|
+
* Each item in the array is cloned into the internal array.
|
514
|
+
* If the call fails because memory cannot be allocated, then this
|
515
|
+
* object will remain unchanged.
|
516
|
+
*
|
517
|
+
* <p>If this format uses named arguments, the new formats are discarded
|
518
|
+
* and this format remains unchanged.
|
519
|
+
*
|
520
|
+
* @stable ICU 2.0
|
521
|
+
* @param newFormats the new format to be set.
|
522
|
+
* @param cnt the size of the array.
|
523
|
+
*/
|
524
|
+
virtual void setFormats(const Format** newFormats, int32_t cnt);
|
525
|
+
|
526
|
+
|
527
|
+
/**
|
528
|
+
* Sets one subformat.
|
529
|
+
* See the class description about format numbering.
|
530
|
+
* The caller should not delete the Format object after this call.
|
531
|
+
* If the number is over the number of formats already set,
|
532
|
+
* the item will be deleted and ignored.
|
533
|
+
*
|
534
|
+
* <p>If this format uses named arguments, the new format is discarded
|
535
|
+
* and this format remains unchanged.
|
536
|
+
*
|
537
|
+
* @stable ICU 2.0
|
538
|
+
* @param formatNumber index of the subformat.
|
539
|
+
* @param formatToAdopt the format to be adopted.
|
540
|
+
*/
|
541
|
+
virtual void adoptFormat(int32_t formatNumber, Format* formatToAdopt);
|
542
|
+
|
543
|
+
/**
|
544
|
+
* Sets one subformat.
|
545
|
+
* See the class description about format numbering.
|
546
|
+
* If the number is over the number of formats already set,
|
547
|
+
* the item will be ignored.
|
548
|
+
* @param formatNumber index of the subformat.
|
549
|
+
* @param format the format to be set.
|
550
|
+
* @stable ICU 2.0
|
551
|
+
*/
|
552
|
+
virtual void setFormat(int32_t formatNumber, const Format& format);
|
553
|
+
|
554
|
+
/**
|
555
|
+
* Gets format names. This function returns formatNames in StringEnumerations
|
556
|
+
* which can be used with getFormat() and setFormat() to export formattable
|
557
|
+
* array from current MessageFormat to another. It is the caller's responsibility
|
558
|
+
* to delete the returned formatNames.
|
559
|
+
* @param status output param set to success/failure code.
|
560
|
+
* @stable ICU 4.0
|
561
|
+
*/
|
562
|
+
virtual StringEnumeration* getFormatNames(UErrorCode& status);
|
563
|
+
|
564
|
+
/**
|
565
|
+
* Gets subformat pointer for given format name.
|
566
|
+
* This function supports both named and numbered
|
567
|
+
* arguments. If numbered, the formatName is the
|
568
|
+
* corresponding UnicodeStrings (e.g. "0", "1", "2"...).
|
569
|
+
* The returned Format object should not be deleted by the caller,
|
570
|
+
* nor should the ponter of other object . The pointer and its
|
571
|
+
* contents remain valid only until the next call to any method
|
572
|
+
* of this class is made with this object.
|
573
|
+
* @param formatName the name or number specifying a format
|
574
|
+
* @param status output param set to success/failure code.
|
575
|
+
* @stable ICU 4.0
|
576
|
+
*/
|
577
|
+
virtual Format* getFormat(const UnicodeString& formatName, UErrorCode& status);
|
578
|
+
|
579
|
+
/**
|
580
|
+
* Sets one subformat for given format name.
|
581
|
+
* See the class description about format name.
|
582
|
+
* This function supports both named and numbered
|
583
|
+
* arguments-- if numbered, the formatName is the
|
584
|
+
* corresponding UnicodeStrings (e.g. "0", "1", "2"...).
|
585
|
+
* If there is no matched formatName or wrong type,
|
586
|
+
* the item will be ignored.
|
587
|
+
* @param formatName Name of the subformat.
|
588
|
+
* @param format the format to be set.
|
589
|
+
* @param status output param set to success/failure code.
|
590
|
+
* @stable ICU 4.0
|
591
|
+
*/
|
592
|
+
virtual void setFormat(const UnicodeString& formatName, const Format& format, UErrorCode& status);
|
593
|
+
|
594
|
+
/**
|
595
|
+
* Sets one subformat for given format name.
|
596
|
+
* See the class description about format name.
|
597
|
+
* This function supports both named and numbered
|
598
|
+
* arguments-- if numbered, the formatName is the
|
599
|
+
* corresponding UnicodeStrings (e.g. "0", "1", "2"...).
|
600
|
+
* If there is no matched formatName or wrong type,
|
601
|
+
* the item will be ignored.
|
602
|
+
* The caller should not delete the Format object after this call.
|
603
|
+
* @param formatName Name of the subformat.
|
604
|
+
* @param formatToAdopt Format to be adopted.
|
605
|
+
* @param status output param set to success/failure code.
|
606
|
+
* @stable ICU 4.0
|
607
|
+
*/
|
608
|
+
virtual void adoptFormat(const UnicodeString& formatName, Format* formatToAdopt, UErrorCode& status);
|
609
|
+
|
610
|
+
/**
|
611
|
+
* Gets an array of subformats of this object. The returned array
|
612
|
+
* should not be deleted by the caller, nor should the pointers
|
613
|
+
* within the array. The array and its contents remain valid only
|
614
|
+
* until the next call to this format. See the class description
|
615
|
+
* about format numbering.
|
616
|
+
*
|
617
|
+
* @param count output parameter to receive the size of the array
|
618
|
+
* @return an array of count Format* objects, or NULL if out of
|
619
|
+
* memory. Any or all of the array elements may be NULL.
|
620
|
+
* @stable ICU 2.0
|
621
|
+
*/
|
622
|
+
virtual const Format** getFormats(int32_t& count) const;
|
623
|
+
|
624
|
+
|
625
|
+
using Format::format;
|
626
|
+
|
627
|
+
/**
|
628
|
+
* Formats the given array of arguments into a user-readable string.
|
629
|
+
* Does not take ownership of the Formattable* array or its contents.
|
630
|
+
*
|
631
|
+
* <p>If this format uses named arguments, appendTo is unchanged and
|
632
|
+
* status is set to U_ILLEGAL_ARGUMENT_ERROR.
|
633
|
+
*
|
634
|
+
* @param source An array of objects to be formatted.
|
635
|
+
* @param count The number of elements of 'source'.
|
636
|
+
* @param appendTo Output parameter to receive result.
|
637
|
+
* Result is appended to existing contents.
|
638
|
+
* @param ignore Not used; inherited from base class API.
|
639
|
+
* @param status Input/output error code. If the
|
640
|
+
* pattern cannot be parsed, set to failure code.
|
641
|
+
* @return Reference to 'appendTo' parameter.
|
642
|
+
* @stable ICU 2.0
|
643
|
+
*/
|
644
|
+
UnicodeString& format(const Formattable* source,
|
645
|
+
int32_t count,
|
646
|
+
UnicodeString& appendTo,
|
647
|
+
FieldPosition& ignore,
|
648
|
+
UErrorCode& status) const;
|
649
|
+
|
650
|
+
/**
|
651
|
+
* Formats the given array of arguments into a user-readable string
|
652
|
+
* using the given pattern.
|
653
|
+
*
|
654
|
+
* <p>If this format uses named arguments, appendTo is unchanged and
|
655
|
+
* status is set to U_ILLEGAL_ARGUMENT_ERROR.
|
656
|
+
*
|
657
|
+
* @param pattern The pattern.
|
658
|
+
* @param arguments An array of objects to be formatted.
|
659
|
+
* @param count The number of elements of 'source'.
|
660
|
+
* @param appendTo Output parameter to receive result.
|
661
|
+
* Result is appended to existing contents.
|
662
|
+
* @param status Input/output error code. If the
|
663
|
+
* pattern cannot be parsed, set to failure code.
|
664
|
+
* @return Reference to 'appendTo' parameter.
|
665
|
+
* @stable ICU 2.0
|
666
|
+
*/
|
667
|
+
static UnicodeString& format(const UnicodeString& pattern,
|
668
|
+
const Formattable* arguments,
|
669
|
+
int32_t count,
|
670
|
+
UnicodeString& appendTo,
|
671
|
+
UErrorCode& status);
|
672
|
+
|
673
|
+
/**
|
674
|
+
* Formats the given array of arguments into a user-readable
|
675
|
+
* string. The array must be stored within a single Formattable
|
676
|
+
* object of type kArray. If the Formattable object type is not of
|
677
|
+
* type kArray, then returns a failing UErrorCode.
|
678
|
+
*
|
679
|
+
* <p>If this format uses named arguments, appendTo is unchanged and
|
680
|
+
* status is set to U_ILLEGAL_ARGUMENT_ERROR.
|
681
|
+
*
|
682
|
+
* @param obj A Formattable of type kArray containing
|
683
|
+
* arguments to be formatted.
|
684
|
+
* @param appendTo Output parameter to receive result.
|
685
|
+
* Result is appended to existing contents.
|
686
|
+
* @param pos On input: an alignment field, if desired.
|
687
|
+
* On output: the offsets of the alignment field.
|
688
|
+
* @param status Input/output error code. If the
|
689
|
+
* pattern cannot be parsed, set to failure code.
|
690
|
+
* @return Reference to 'appendTo' parameter.
|
691
|
+
* @stable ICU 2.0
|
692
|
+
*/
|
693
|
+
virtual UnicodeString& format(const Formattable& obj,
|
694
|
+
UnicodeString& appendTo,
|
695
|
+
FieldPosition& pos,
|
696
|
+
UErrorCode& status) const;
|
697
|
+
|
698
|
+
/**
|
699
|
+
* Formats the given array of arguments into a user-defined argument name
|
700
|
+
* array. This function supports both named and numbered
|
701
|
+
* arguments-- if numbered, the formatName is the
|
702
|
+
* corresponding UnicodeStrings (e.g. "0", "1", "2"...).
|
703
|
+
*
|
704
|
+
* @param argumentNames argument name array
|
705
|
+
* @param arguments An array of objects to be formatted.
|
706
|
+
* @param count The number of elements of 'argumentNames' and
|
707
|
+
* arguments. The number of argumentNames and arguments
|
708
|
+
* must be the same.
|
709
|
+
* @param appendTo Output parameter to receive result.
|
710
|
+
* Result is appended to existing contents.
|
711
|
+
* @param status Input/output error code. If the
|
712
|
+
* pattern cannot be parsed, set to failure code.
|
713
|
+
* @return Reference to 'appendTo' parameter.
|
714
|
+
* @stable ICU 4.0
|
715
|
+
*/
|
716
|
+
UnicodeString& format(const UnicodeString* argumentNames,
|
717
|
+
const Formattable* arguments,
|
718
|
+
int32_t count,
|
719
|
+
UnicodeString& appendTo,
|
720
|
+
UErrorCode& status) const;
|
721
|
+
/**
|
722
|
+
* Parses the given string into an array of output arguments.
|
723
|
+
*
|
724
|
+
* @param source String to be parsed.
|
725
|
+
* @param pos On input, starting position for parse. On output,
|
726
|
+
* final position after parse. Unchanged if parse
|
727
|
+
* fails.
|
728
|
+
* @param count Output parameter to receive the number of arguments
|
729
|
+
* parsed.
|
730
|
+
* @return an array of parsed arguments. The caller owns both
|
731
|
+
* the array and its contents.
|
732
|
+
* @stable ICU 2.0
|
733
|
+
*/
|
734
|
+
virtual Formattable* parse(const UnicodeString& source,
|
735
|
+
ParsePosition& pos,
|
736
|
+
int32_t& count) const;
|
737
|
+
|
738
|
+
/**
|
739
|
+
* Parses the given string into an array of output arguments.
|
740
|
+
*
|
741
|
+
* <p>If this format uses named arguments, status is set to
|
742
|
+
* U_ARGUMENT_TYPE_MISMATCH.
|
743
|
+
*
|
744
|
+
* @param source String to be parsed.
|
745
|
+
* @param count Output param to receive size of returned array.
|
746
|
+
* @param status Input/output error code. If the
|
747
|
+
* pattern cannot be parsed, set to failure code.
|
748
|
+
* @return an array of parsed arguments. The caller owns both
|
749
|
+
* the array and its contents. Returns NULL if status is not U_ZERO_ERROR.
|
750
|
+
*
|
751
|
+
* @stable ICU 2.0
|
752
|
+
*/
|
753
|
+
virtual Formattable* parse(const UnicodeString& source,
|
754
|
+
int32_t& count,
|
755
|
+
UErrorCode& status) const;
|
756
|
+
|
757
|
+
/**
|
758
|
+
* Parses the given string into an array of output arguments
|
759
|
+
* stored within a single Formattable of type kArray.
|
760
|
+
*
|
761
|
+
* @param source The string to be parsed into an object.
|
762
|
+
* @param result Formattable to be set to the parse result.
|
763
|
+
* If parse fails, return contents are undefined.
|
764
|
+
* @param pos On input, starting position for parse. On output,
|
765
|
+
* final position after parse. Unchanged if parse
|
766
|
+
* fails.
|
767
|
+
* @stable ICU 2.0
|
768
|
+
*/
|
769
|
+
virtual void parseObject(const UnicodeString& source,
|
770
|
+
Formattable& result,
|
771
|
+
ParsePosition& pos) const;
|
772
|
+
|
773
|
+
/**
|
774
|
+
* Convert an 'apostrophe-friendly' pattern into a standard
|
775
|
+
* pattern. Standard patterns treat all apostrophes as
|
776
|
+
* quotes, which is problematic in some languages, e.g.
|
777
|
+
* French, where apostrophe is commonly used. This utility
|
778
|
+
* assumes that only an unpaired apostrophe immediately before
|
779
|
+
* a brace is a true quote. Other unpaired apostrophes are paired,
|
780
|
+
* and the resulting standard pattern string is returned.
|
781
|
+
*
|
782
|
+
* <p><b>Note</b> it is not guaranteed that the returned pattern
|
783
|
+
* is indeed a valid pattern. The only effect is to convert
|
784
|
+
* between patterns having different quoting semantics.
|
785
|
+
*
|
786
|
+
* @param pattern the 'apostrophe-friendly' patttern to convert
|
787
|
+
* @param status Input/output error code. If the pattern
|
788
|
+
* cannot be parsed, the failure code is set.
|
789
|
+
* @return the standard equivalent of the original pattern
|
790
|
+
* @stable ICU 3.4
|
791
|
+
*/
|
792
|
+
static UnicodeString autoQuoteApostrophe(const UnicodeString& pattern,
|
793
|
+
UErrorCode& status);
|
794
|
+
|
795
|
+
|
796
|
+
/**
|
797
|
+
* Returns true if this MessageFormat uses named arguments,
|
798
|
+
* and false otherwise. See class description.
|
799
|
+
*
|
800
|
+
* @return true if named arguments are used.
|
801
|
+
* @stable ICU 4.0
|
802
|
+
*/
|
803
|
+
UBool usesNamedArguments() const;
|
804
|
+
|
805
|
+
|
806
|
+
#ifndef U_HIDE_INTERNAL_API
|
807
|
+
/**
|
808
|
+
* This API is for ICU internal use only.
|
809
|
+
* Please do not use it.
|
810
|
+
*
|
811
|
+
* Returns argument types count in the parsed pattern.
|
812
|
+
* Used to distinguish pattern "{0} d" and "d".
|
813
|
+
*
|
814
|
+
* @return The number of formattable types in the pattern
|
815
|
+
* @internal
|
816
|
+
*/
|
817
|
+
int32_t getArgTypeCount() const;
|
818
|
+
#endif /* U_HIDE_INTERNAL_API */
|
819
|
+
|
820
|
+
/**
|
821
|
+
* Returns a unique class ID POLYMORPHICALLY. Pure virtual override.
|
822
|
+
* This method is to implement a simple version of RTTI, since not all
|
823
|
+
* C++ compilers support genuine RTTI. Polymorphic operator==() and
|
824
|
+
* clone() methods call this method.
|
825
|
+
*
|
826
|
+
* @return The class ID for this object. All objects of a
|
827
|
+
* given class have the same class ID. Objects of
|
828
|
+
* other classes have different class IDs.
|
829
|
+
* @stable ICU 2.0
|
830
|
+
*/
|
831
|
+
virtual UClassID getDynamicClassID(void) const;
|
832
|
+
|
833
|
+
/**
|
834
|
+
* Return the class ID for this class. This is useful only for
|
835
|
+
* comparing to a return value from getDynamicClassID(). For example:
|
836
|
+
* <pre>
|
837
|
+
* . Base* polymorphic_pointer = createPolymorphicObject();
|
838
|
+
* . if (polymorphic_pointer->getDynamicClassID() ==
|
839
|
+
* . Derived::getStaticClassID()) ...
|
840
|
+
* </pre>
|
841
|
+
* @return The class ID for all objects of this class.
|
842
|
+
* @stable ICU 2.0
|
843
|
+
*/
|
844
|
+
static UClassID U_EXPORT2 getStaticClassID(void);
|
845
|
+
|
846
|
+
#ifndef U_HIDE_INTERNAL_API
|
847
|
+
/**
|
848
|
+
* Compares two Format objects. This is used for constructing the hash
|
849
|
+
* tables.
|
850
|
+
*
|
851
|
+
* @param left pointer to a Format object. Must not be NULL.
|
852
|
+
* @param right pointer to a Format object. Must not be NULL.
|
853
|
+
*
|
854
|
+
* @return whether the two objects are the same
|
855
|
+
* @internal
|
856
|
+
*/
|
857
|
+
static UBool equalFormats(const void* left, const void* right);
|
858
|
+
#endif /* U_HIDE_INTERNAL_API */
|
859
|
+
|
860
|
+
private:
|
861
|
+
|
862
|
+
Locale fLocale;
|
863
|
+
MessagePattern msgPattern;
|
864
|
+
Format** formatAliases; // see getFormats
|
865
|
+
int32_t formatAliasesCapacity;
|
866
|
+
|
867
|
+
MessageFormat(); // default constructor not implemented
|
868
|
+
|
869
|
+
/**
|
870
|
+
* This provider helps defer instantiation of a PluralRules object
|
871
|
+
* until we actually need to select a keyword.
|
872
|
+
* For example, if the number matches an explicit-value selector like "=1"
|
873
|
+
* we do not need any PluralRules.
|
874
|
+
*/
|
875
|
+
class U_I18N_API PluralSelectorProvider : public PluralFormat::PluralSelector {
|
876
|
+
public:
|
877
|
+
PluralSelectorProvider(const MessageFormat &mf, UPluralType type);
|
878
|
+
virtual ~PluralSelectorProvider();
|
879
|
+
virtual UnicodeString select(void *ctx, double number, UErrorCode& ec) const;
|
880
|
+
|
881
|
+
void reset();
|
882
|
+
private:
|
883
|
+
const MessageFormat &msgFormat;
|
884
|
+
PluralRules* rules;
|
885
|
+
UPluralType type;
|
886
|
+
};
|
887
|
+
|
888
|
+
/**
|
889
|
+
* A MessageFormat formats an array of arguments. Each argument
|
890
|
+
* has an expected type, based on the pattern. For example, if
|
891
|
+
* the pattern contains the subformat "{3,number,integer}", then
|
892
|
+
* we expect argument 3 to have type Formattable::kLong. This
|
893
|
+
* array needs to grow dynamically if the MessageFormat is
|
894
|
+
* modified.
|
895
|
+
*/
|
896
|
+
Formattable::Type* argTypes;
|
897
|
+
int32_t argTypeCount;
|
898
|
+
int32_t argTypeCapacity;
|
899
|
+
|
900
|
+
/**
|
901
|
+
* TRUE if there are different argTypes for the same argument.
|
902
|
+
* This only matters when the MessageFormat is used in the plain C (umsg_xxx) API
|
903
|
+
* where the pattern argTypes determine how the va_arg list is read.
|
904
|
+
*/
|
905
|
+
UBool hasArgTypeConflicts;
|
906
|
+
|
907
|
+
// Variable-size array management
|
908
|
+
UBool allocateArgTypes(int32_t capacity, UErrorCode& status);
|
909
|
+
|
910
|
+
/**
|
911
|
+
* Default Format objects used when no format is specified and a
|
912
|
+
* numeric or date argument is formatted. These are volatile
|
913
|
+
* cache objects maintained only for performance. They do not
|
914
|
+
* participate in operator=(), copy constructor(), nor
|
915
|
+
* operator==().
|
916
|
+
*/
|
917
|
+
NumberFormat* defaultNumberFormat;
|
918
|
+
DateFormat* defaultDateFormat;
|
919
|
+
|
920
|
+
UHashtable* cachedFormatters;
|
921
|
+
UHashtable* customFormatArgStarts;
|
922
|
+
|
923
|
+
PluralSelectorProvider pluralProvider;
|
924
|
+
PluralSelectorProvider ordinalProvider;
|
925
|
+
|
926
|
+
/**
|
927
|
+
* Method to retrieve default formats (or NULL on failure).
|
928
|
+
* These are semantically const, but may modify *this.
|
929
|
+
*/
|
930
|
+
const NumberFormat* getDefaultNumberFormat(UErrorCode&) const;
|
931
|
+
const DateFormat* getDefaultDateFormat(UErrorCode&) const;
|
932
|
+
|
933
|
+
/**
|
934
|
+
* Finds the word s, in the keyword list and returns the located index.
|
935
|
+
* @param s the keyword to be searched for.
|
936
|
+
* @param list the list of keywords to be searched with.
|
937
|
+
* @return the index of the list which matches the keyword s.
|
938
|
+
*/
|
939
|
+
static int32_t findKeyword( const UnicodeString& s,
|
940
|
+
const UChar * const *list);
|
941
|
+
|
942
|
+
/**
|
943
|
+
* Thin wrapper around the format(... AppendableWrapper ...) variant.
|
944
|
+
* Wraps the destination UnicodeString into an AppendableWrapper and
|
945
|
+
* supplies default values for some other parameters.
|
946
|
+
*/
|
947
|
+
UnicodeString& format(const Formattable* arguments,
|
948
|
+
const UnicodeString *argumentNames,
|
949
|
+
int32_t cnt,
|
950
|
+
UnicodeString& appendTo,
|
951
|
+
FieldPosition* pos,
|
952
|
+
UErrorCode& status) const;
|
953
|
+
|
954
|
+
/**
|
955
|
+
* Formats the arguments and writes the result into the
|
956
|
+
* AppendableWrapper, updates the field position.
|
957
|
+
*
|
958
|
+
* @param msgStart Index to msgPattern part to start formatting from.
|
959
|
+
* @param plNumber NULL except when formatting a plural argument sub-message
|
960
|
+
* where a '#' is replaced by the format string for this number.
|
961
|
+
* @param arguments The formattable objects array. (Must not be NULL.)
|
962
|
+
* @param argumentNames NULL if numbered values are used. Otherwise the same
|
963
|
+
* length as "arguments", and each entry is the name of the
|
964
|
+
* corresponding argument in "arguments".
|
965
|
+
* @param cnt The length of arguments (and of argumentNames if that is not NULL).
|
966
|
+
* @param appendTo Output parameter to receive the result.
|
967
|
+
* The result string is appended to existing contents.
|
968
|
+
* @param pos Field position status.
|
969
|
+
* @param success The error code status.
|
970
|
+
*/
|
971
|
+
void format(int32_t msgStart,
|
972
|
+
const void *plNumber,
|
973
|
+
const Formattable* arguments,
|
974
|
+
const UnicodeString *argumentNames,
|
975
|
+
int32_t cnt,
|
976
|
+
AppendableWrapper& appendTo,
|
977
|
+
FieldPosition* pos,
|
978
|
+
UErrorCode& success) const;
|
979
|
+
|
980
|
+
UnicodeString getArgName(int32_t partIndex);
|
981
|
+
|
982
|
+
void setArgStartFormat(int32_t argStart, Format* formatter, UErrorCode& status);
|
983
|
+
|
984
|
+
void setCustomArgStartFormat(int32_t argStart, Format* formatter, UErrorCode& status);
|
985
|
+
|
986
|
+
int32_t nextTopLevelArgStart(int32_t partIndex) const;
|
987
|
+
|
988
|
+
UBool argNameMatches(int32_t partIndex, const UnicodeString& argName, int32_t argNumber);
|
989
|
+
|
990
|
+
void cacheExplicitFormats(UErrorCode& status);
|
991
|
+
|
992
|
+
Format* createAppropriateFormat(UnicodeString& type,
|
993
|
+
UnicodeString& style,
|
994
|
+
Formattable::Type& formattableType,
|
995
|
+
UParseError& parseError,
|
996
|
+
UErrorCode& ec);
|
997
|
+
|
998
|
+
const Formattable* getArgFromListByName(const Formattable* arguments,
|
999
|
+
const UnicodeString *argumentNames,
|
1000
|
+
int32_t cnt, UnicodeString& name) const;
|
1001
|
+
|
1002
|
+
Formattable* parse(int32_t msgStart,
|
1003
|
+
const UnicodeString& source,
|
1004
|
+
ParsePosition& pos,
|
1005
|
+
int32_t& count,
|
1006
|
+
UErrorCode& ec) const;
|
1007
|
+
|
1008
|
+
FieldPosition* updateMetaData(AppendableWrapper& dest, int32_t prevLength,
|
1009
|
+
FieldPosition* fp, const Formattable* argId) const;
|
1010
|
+
|
1011
|
+
/**
|
1012
|
+
* Finds the "other" sub-message.
|
1013
|
+
* @param partIndex the index of the first PluralFormat argument style part.
|
1014
|
+
* @return the "other" sub-message start part index.
|
1015
|
+
*/
|
1016
|
+
int32_t findOtherSubMessage(int32_t partIndex) const;
|
1017
|
+
|
1018
|
+
/**
|
1019
|
+
* Returns the ARG_START index of the first occurrence of the plural number in a sub-message.
|
1020
|
+
* Returns -1 if it is a REPLACE_NUMBER.
|
1021
|
+
* Returns 0 if there is neither.
|
1022
|
+
*/
|
1023
|
+
int32_t findFirstPluralNumberArg(int32_t msgStart, const UnicodeString &argName) const;
|
1024
|
+
|
1025
|
+
Format* getCachedFormatter(int32_t argumentNumber) const;
|
1026
|
+
|
1027
|
+
UnicodeString getLiteralStringUntilNextArgument(int32_t from) const;
|
1028
|
+
|
1029
|
+
void copyObjects(const MessageFormat& that, UErrorCode& ec);
|
1030
|
+
|
1031
|
+
void formatComplexSubMessage(int32_t msgStart,
|
1032
|
+
const void *plNumber,
|
1033
|
+
const Formattable* arguments,
|
1034
|
+
const UnicodeString *argumentNames,
|
1035
|
+
int32_t cnt,
|
1036
|
+
AppendableWrapper& appendTo,
|
1037
|
+
UErrorCode& success) const;
|
1038
|
+
|
1039
|
+
/**
|
1040
|
+
* Convenience method that ought to be in NumberFormat
|
1041
|
+
*/
|
1042
|
+
NumberFormat* createIntegerFormat(const Locale& locale, UErrorCode& status) const;
|
1043
|
+
|
1044
|
+
/**
|
1045
|
+
* Returns array of argument types in the parsed pattern
|
1046
|
+
* for use in C API. Only for the use of umsg_vformat(). Not
|
1047
|
+
* for public consumption.
|
1048
|
+
* @param listCount Output parameter to receive the size of array
|
1049
|
+
* @return The array of formattable types in the pattern
|
1050
|
+
*/
|
1051
|
+
const Formattable::Type* getArgTypeList(int32_t& listCount) const {
|
1052
|
+
listCount = argTypeCount;
|
1053
|
+
return argTypes;
|
1054
|
+
}
|
1055
|
+
|
1056
|
+
/**
|
1057
|
+
* Resets the internal MessagePattern, and other associated caches.
|
1058
|
+
*/
|
1059
|
+
void resetPattern();
|
1060
|
+
|
1061
|
+
/**
|
1062
|
+
* A DummyFormatter that we use solely to store a NULL value. UHash does
|
1063
|
+
* not support storing NULL values.
|
1064
|
+
*/
|
1065
|
+
class U_I18N_API DummyFormat : public Format {
|
1066
|
+
public:
|
1067
|
+
virtual UBool operator==(const Format&) const;
|
1068
|
+
virtual Format* clone() const;
|
1069
|
+
virtual UnicodeString& format(const Formattable& obj,
|
1070
|
+
UnicodeString& appendTo,
|
1071
|
+
UErrorCode& status) const;
|
1072
|
+
virtual UnicodeString& format(const Formattable&,
|
1073
|
+
UnicodeString& appendTo,
|
1074
|
+
FieldPosition&,
|
1075
|
+
UErrorCode& status) const;
|
1076
|
+
virtual UnicodeString& format(const Formattable& obj,
|
1077
|
+
UnicodeString& appendTo,
|
1078
|
+
FieldPositionIterator* posIter,
|
1079
|
+
UErrorCode& status) const;
|
1080
|
+
virtual void parseObject(const UnicodeString&,
|
1081
|
+
Formattable&,
|
1082
|
+
ParsePosition&) const;
|
1083
|
+
};
|
1084
|
+
|
1085
|
+
friend class MessageFormatAdapter; // getFormatTypeList() access
|
1086
|
+
};
|
1087
|
+
|
1088
|
+
U_NAMESPACE_END
|
1089
|
+
|
1090
|
+
#endif /* #if !UCONFIG_NO_FORMATTING */
|
1091
|
+
|
1092
|
+
#endif // _MSGFMT
|
1093
|
+
//eof
|