pango 2.2.5-x64-mingw32 → 3.0.0-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +19 -3
- data/ext/pango/depend +0 -1
- data/ext/pango/extconf.rb +0 -2
- data/ext/pango/rbpango.c +44 -6
- data/ext/pango/rbpango.h +0 -1
- data/ext/pango/rbpangoattribute.c +2 -2
- data/ext/pango/rbpangocairo.c +4 -4
- data/ext/pango/rbpangocontext.c +2 -2
- data/ext/pango/rbpangofontdescription.c +2 -2
- data/ext/pango/rbpangogravity.c +2 -2
- data/ext/pango/rbpangolanguage.c +8 -0
- data/ext/pango/rbpangolayout.c +15 -4
- data/ext/pango/rbpangomatrix.c +2 -2
- data/ext/pango/rbpangoscript.c +3 -3
- 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/test/test-language.rb +5 -0
- data/test/test-layout.rb +7 -1
- 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 +6 -6
- 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 +1 -1
- data/vendor/local/include/harfbuzz/hb-buffer.h +26 -1
- data/vendor/local/include/harfbuzz/hb-common.h +7 -0
- data/vendor/local/include/harfbuzz/hb-font.h +7 -6
- data/vendor/local/include/harfbuzz/hb-ft.h +58 -1
- data/vendor/local/include/harfbuzz/hb-glib.h +3 -0
- data/vendor/local/include/harfbuzz/hb-ot-font.h +4 -0
- data/vendor/local/include/harfbuzz/hb-shape.h +0 -3
- data/vendor/local/include/harfbuzz/hb-unicode.h +28 -3
- data/vendor/local/include/harfbuzz/hb-version.h +4 -4
- data/vendor/local/include/layout/LEFontInstance.h +2 -28
- data/vendor/local/include/layout/LETableReference.h +7 -2
- data/vendor/local/include/unicode/calendar.h +32 -2
- data/vendor/local/include/unicode/coll.h +9 -7
- data/vendor/local/include/unicode/datefmt.h +102 -13
- data/vendor/local/include/unicode/dcfmtsym.h +4 -2
- data/vendor/local/include/unicode/decimfmt.h +4 -5
- data/vendor/local/include/unicode/dtfmtsym.h +60 -1
- data/vendor/local/include/unicode/dtptngen.h +21 -7
- data/vendor/local/include/unicode/localpointer.h +49 -1
- data/vendor/local/include/unicode/locid.h +2 -3
- data/vendor/local/include/unicode/measfmt.h +30 -37
- data/vendor/local/include/unicode/measunit.h +65 -152
- data/vendor/local/include/unicode/measure.h +3 -3
- data/vendor/local/include/unicode/numfmt.h +3 -5
- data/vendor/local/include/unicode/platform.h +12 -2
- data/vendor/local/include/unicode/plurrule.h +18 -14
- data/vendor/local/include/unicode/rbnf.h +3 -4
- data/vendor/local/include/unicode/regex.h +42 -26
- data/vendor/local/include/unicode/region.h +9 -9
- data/vendor/local/include/unicode/reldatefmt.h +50 -45
- data/vendor/local/include/unicode/scientificnumberformatter.h +222 -0
- data/vendor/local/include/unicode/smpdtfmt.h +30 -24
- data/vendor/local/include/unicode/tblcoll.h +5 -4
- data/vendor/local/include/unicode/timezone.h +18 -1
- data/vendor/local/include/unicode/ucal.h +2 -2
- data/vendor/local/include/unicode/ucol.h +22 -18
- data/vendor/local/include/unicode/uconfig.h +17 -2
- data/vendor/local/include/unicode/udat.h +164 -56
- data/vendor/local/include/unicode/udatpg.h +9 -7
- data/vendor/local/include/unicode/ufieldpositer.h +121 -0
- data/vendor/local/include/unicode/uidna.h +21 -13
- data/vendor/local/include/unicode/ulistformatter.h +130 -0
- data/vendor/local/include/unicode/ulocdata.h +4 -3
- data/vendor/local/include/unicode/unistr.h +101 -53
- data/vendor/local/include/unicode/unum.h +7 -10
- data/vendor/local/include/unicode/uregex.h +52 -29
- data/vendor/local/include/unicode/urename.h +14 -3
- data/vendor/local/include/unicode/uscript.h +30 -16
- data/vendor/local/include/unicode/uspoof.h +13 -9
- data/vendor/local/include/unicode/utrans.h +5 -7
- data/vendor/local/include/unicode/utypes.h +9 -3
- data/vendor/local/include/unicode/uvernum.h +8 -8
- data/vendor/local/lib/icu/{54.1 → 55.1}/Makefile.inc +5 -5
- data/vendor/local/lib/icu/{54.1 → 55.1}/pkgdata.inc +1 -1
- data/vendor/local/lib/icu/Makefile.inc +5 -5
- data/vendor/local/lib/icu/pkgdata.inc +1 -1
- data/vendor/local/lib/icudt.dll +0 -0
- data/vendor/local/lib/{icudt54.dll → icudt55.dll} +0 -0
- data/vendor/local/lib/icuin.dll +0 -0
- data/vendor/local/lib/icuin55.dll +0 -0
- data/vendor/local/lib/icuio.dll +0 -0
- data/vendor/local/lib/icuio55.dll +0 -0
- data/vendor/local/lib/icule.dll +0 -0
- data/vendor/local/lib/icule55.dll +0 -0
- data/vendor/local/lib/iculx.dll +0 -0
- data/vendor/local/lib/iculx55.dll +0 -0
- data/vendor/local/lib/icutest.dll +0 -0
- data/vendor/local/lib/icutest55.dll +0 -0
- data/vendor/local/lib/icutu.dll +0 -0
- data/vendor/local/lib/icutu55.dll +0 -0
- data/vendor/local/lib/icuuc.dll +0 -0
- data/vendor/local/lib/icuuc55.dll +0 -0
- data/vendor/local/lib/libharfbuzz-icu.a +0 -0
- data/vendor/local/lib/libharfbuzz-icu.la +7 -7
- data/vendor/local/lib/libharfbuzz.dll.a +0 -0
- data/vendor/local/lib/libharfbuzz.la +7 -7
- 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 +1 -1
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- data/vendor/local/lib/pkgconfig/harfbuzz-icu.pc +1 -1
- data/vendor/local/lib/pkgconfig/harfbuzz.pc +3 -1
- data/vendor/local/lib/pkgconfig/icu-i18n.pc +5 -5
- data/vendor/local/lib/pkgconfig/icu-io.pc +5 -5
- data/vendor/local/lib/pkgconfig/icu-le.pc +5 -5
- data/vendor/local/lib/pkgconfig/icu-lx.pc +5 -5
- data/vendor/local/lib/pkgconfig/icu-uc.pc +5 -5
- data/vendor/local/share/gtk-doc/html/harfbuzz/adding-text-to-the-buffer.html +35 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/annotation-glossary.html +30 -35
- data/vendor/local/share/gtk-doc/html/harfbuzz/api-index-full.html +158 -27
- data/vendor/local/share/gtk-doc/html/harfbuzz/buffers-language-script-and-direction.html +87 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/{ch01.html → ch06.html} +12 -13
- data/vendor/local/share/gtk-doc/html/harfbuzz/customizing-unicode-functions.html +31 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/deprecated-api-index.html +7 -8
- data/vendor/local/share/gtk-doc/html/harfbuzz/fonts-and-faces.html +40 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-Shaping.html +352 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-blob.html +88 -47
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-buffer.html +128 -204
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-common.html +290 -304
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-coretext.html +14 -23
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-deprecated.html +14 -17
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-face.html +40 -51
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-font.html +126 -190
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-ft.html +19 -24
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-glib.html +14 -29
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-gobject.html +438 -11
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-graphite2.html +14 -25
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-icu.html +14 -29
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-ot-layout.html +19 -160
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-ot-tag.html +21 -36
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-ot.html +14 -11
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-set.html +70 -81
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-shape-plan.html +33 -44
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-unicode.html +290 -323
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-uniscribe.html +14 -23
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-version.html +59 -27
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb.html +16 -13
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz.devhelp2 +415 -104
- data/vendor/local/share/gtk-doc/html/harfbuzz/hello-harfbuzz.html +181 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/index.html +43 -12
- data/vendor/local/share/gtk-doc/html/harfbuzz/object-tree.html +11 -13
- data/vendor/local/share/gtk-doc/html/harfbuzz/plans-and-caching.html +31 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/pt01.html +70 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/pt02.html +107 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/setting-buffer-properties.html +31 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/shaping-and-shape-plans.html +39 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/style.css +9 -6
- data/vendor/local/share/gtk-doc/html/harfbuzz/using-harfbuzzs-native-opentype-implementation.html +31 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/using-your-own-font-functions.html +31 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/what-about-the-other-scripts.html +31 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/what-is-harfbuzz.html +124 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/why-is-it-called-harfbuzz.html +38 -0
- data/vendor/local/share/icu/{54.1 → 55.1}/config/mh-mingw64 +0 -0
- data/vendor/local/share/icu/{54.1 → 55.1}/install-sh +0 -0
- data/vendor/local/share/icu/{54.1 → 55.1}/license.html +3 -4
- data/vendor/local/share/icu/{54.1 → 55.1}/mkinstalldirs +0 -0
- data/vendor/local/share/man/man1/derb.1 +2 -2
- data/vendor/local/share/man/man1/genbrk.1 +2 -2
- data/vendor/local/share/man/man1/gencfu.1 +1 -1
- data/vendor/local/share/man/man1/gencnval.1 +3 -3
- data/vendor/local/share/man/man1/gendict.1 +2 -2
- data/vendor/local/share/man/man1/genrb.1 +3 -3
- data/vendor/local/share/man/man1/icu-config.1 +2 -2
- data/vendor/local/share/man/man1/makeconv.1 +3 -3
- data/vendor/local/share/man/man1/pkgdata.1 +2 -2
- data/vendor/local/share/man/man1/uconv.1 +2 -2
- data/vendor/local/share/man/man8/genccode.8 +2 -2
- data/vendor/local/share/man/man8/gencmn.8 +3 -3
- data/vendor/local/share/man/man8/gensprep.8 +3 -3
- data/vendor/local/share/man/man8/icupkg.8 +1 -1
- metadata +38 -22
- data/vendor/local/include/unicode/scientificformathelper.h +0 -139
- data/vendor/local/lib/icuin54.dll +0 -0
- data/vendor/local/lib/icuio54.dll +0 -0
- data/vendor/local/lib/icule54.dll +0 -0
- data/vendor/local/lib/iculx54.dll +0 -0
- data/vendor/local/lib/icutest54.dll +0 -0
- data/vendor/local/lib/icutu54.dll +0 -0
- data/vendor/local/lib/icuuc54.dll +0 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-shape.html +0 -286
- data/vendor/local/share/gtk-doc/html/harfbuzz/index.sgml +0 -496
@@ -1,7 +1,7 @@
|
|
1
1
|
/*
|
2
2
|
*******************************************************************************
|
3
3
|
*
|
4
|
-
* Copyright (C) 2003-
|
4
|
+
* Copyright (C) 2003-2014, International Business Machines
|
5
5
|
* Corporation and others. All Rights Reserved.
|
6
6
|
*
|
7
7
|
*******************************************************************************
|
@@ -32,8 +32,10 @@
|
|
32
32
|
*
|
33
33
|
* The C API functions which do take a UIDNA * service object pointer
|
34
34
|
* implement UTS #46 and IDNA2008.
|
35
|
+
*
|
36
|
+
* IDNA2003 is obsolete.
|
35
37
|
* The C API functions which do not take a service object pointer
|
36
|
-
* implement IDNA2003.
|
38
|
+
* implement IDNA2003. They are all deprecated.
|
37
39
|
*/
|
38
40
|
|
39
41
|
/*
|
@@ -46,14 +48,16 @@ enum {
|
|
46
48
|
* @stable ICU 2.6
|
47
49
|
*/
|
48
50
|
UIDNA_DEFAULT=0,
|
51
|
+
#ifndef U_HIDE_DEPRECATED_API
|
49
52
|
/**
|
50
53
|
* Option to allow unassigned code points in domain names and labels.
|
51
54
|
* For use in static worker and factory methods.
|
52
55
|
* <p>This option is ignored by the UTS46 implementation.
|
53
56
|
* (UTS #46 disallows unassigned code points.)
|
54
|
-
* @
|
57
|
+
* @deprecated ICU 55 Use UTS #46 instead via uidna_openUTS46() or class IDNA.
|
55
58
|
*/
|
56
59
|
UIDNA_ALLOW_UNASSIGNED=1,
|
60
|
+
#endif /* U_HIDE_DEPRECATED_API */
|
57
61
|
/**
|
58
62
|
* Option to check whether the input conforms to the STD3 ASCII rules,
|
59
63
|
* for example the restriction of labels to LDH characters
|
@@ -503,6 +507,8 @@ enum {
|
|
503
507
|
UIDNA_ERROR_CONTEXTO_DIGITS=0x4000
|
504
508
|
};
|
505
509
|
|
510
|
+
#ifndef U_HIDE_DEPRECATED_API
|
511
|
+
|
506
512
|
/* IDNA2003 API ------------------------------------------------------------- */
|
507
513
|
|
508
514
|
/**
|
@@ -562,9 +568,9 @@ enum {
|
|
562
568
|
* U_BUFFER_OVERFLOW_ERROR if destCapacity is not enough
|
563
569
|
* @return The length of the result string, if successful - or in case of a buffer overflow,
|
564
570
|
* in which case it will be greater than destCapacity.
|
565
|
-
* @
|
571
|
+
* @deprecated ICU 55 Use UTS #46 instead via uidna_openUTS46() or class IDNA.
|
566
572
|
*/
|
567
|
-
|
573
|
+
U_DEPRECATED int32_t U_EXPORT2
|
568
574
|
uidna_toASCII(const UChar* src, int32_t srcLength,
|
569
575
|
UChar* dest, int32_t destCapacity,
|
570
576
|
int32_t options,
|
@@ -610,9 +616,9 @@ uidna_toASCII(const UChar* src, int32_t srcLength,
|
|
610
616
|
* U_BUFFER_OVERFLOW_ERROR if destCapacity is not enough
|
611
617
|
* @return The length of the result string, if successful - or in case of a buffer overflow,
|
612
618
|
* in which case it will be greater than destCapacity.
|
613
|
-
* @
|
619
|
+
* @deprecated ICU 55 Use UTS #46 instead via uidna_openUTS46() or class IDNA.
|
614
620
|
*/
|
615
|
-
|
621
|
+
U_DEPRECATED int32_t U_EXPORT2
|
616
622
|
uidna_toUnicode(const UChar* src, int32_t srcLength,
|
617
623
|
UChar* dest, int32_t destCapacity,
|
618
624
|
int32_t options,
|
@@ -661,9 +667,9 @@ uidna_toUnicode(const UChar* src, int32_t srcLength,
|
|
661
667
|
* U_BUFFER_OVERFLOW_ERROR if destCapacity is not enough
|
662
668
|
* @return The length of the result string, if successful - or in case of a buffer overflow,
|
663
669
|
* in which case it will be greater than destCapacity.
|
664
|
-
* @
|
670
|
+
* @deprecated ICU 55 Use UTS #46 instead via uidna_openUTS46() or class IDNA.
|
665
671
|
*/
|
666
|
-
|
672
|
+
U_DEPRECATED int32_t U_EXPORT2
|
667
673
|
uidna_IDNToASCII( const UChar* src, int32_t srcLength,
|
668
674
|
UChar* dest, int32_t destCapacity,
|
669
675
|
int32_t options,
|
@@ -708,9 +714,9 @@ uidna_IDNToASCII( const UChar* src, int32_t srcLength,
|
|
708
714
|
* U_BUFFER_OVERFLOW_ERROR if destCapacity is not enough
|
709
715
|
* @return The length of the result string, if successful - or in case of a buffer overflow,
|
710
716
|
* in which case it will be greater than destCapacity.
|
711
|
-
* @
|
717
|
+
* @deprecated ICU 55 Use UTS #46 instead via uidna_openUTS46() or class IDNA.
|
712
718
|
*/
|
713
|
-
|
719
|
+
U_DEPRECATED int32_t U_EXPORT2
|
714
720
|
uidna_IDNToUnicode( const UChar* src, int32_t srcLength,
|
715
721
|
UChar* dest, int32_t destCapacity,
|
716
722
|
int32_t options,
|
@@ -749,14 +755,16 @@ uidna_IDNToUnicode( const UChar* src, int32_t srcLength,
|
|
749
755
|
* @param status ICU error code in/out parameter.
|
750
756
|
* Must fulfill U_SUCCESS before the function call.
|
751
757
|
* @return <0 or 0 or >0 as usual for string comparisons
|
752
|
-
* @
|
758
|
+
* @deprecated ICU 55 Use UTS #46 instead via uidna_openUTS46() or class IDNA.
|
753
759
|
*/
|
754
|
-
|
760
|
+
U_DEPRECATED int32_t U_EXPORT2
|
755
761
|
uidna_compare( const UChar *s1, int32_t length1,
|
756
762
|
const UChar *s2, int32_t length2,
|
757
763
|
int32_t options,
|
758
764
|
UErrorCode* status);
|
759
765
|
|
766
|
+
#endif /* U_HIDE_DEPRECATED_API */
|
767
|
+
|
760
768
|
#endif /* #if !UCONFIG_NO_IDNA */
|
761
769
|
|
762
770
|
#endif
|
@@ -0,0 +1,130 @@
|
|
1
|
+
/*
|
2
|
+
*****************************************************************************************
|
3
|
+
* Copyright (C) 2015, International Business Machines
|
4
|
+
* Corporation and others. All Rights Reserved.
|
5
|
+
*****************************************************************************************
|
6
|
+
*/
|
7
|
+
|
8
|
+
#ifndef ULISTFORMATTER_H
|
9
|
+
#define ULISTFORMATTER_H
|
10
|
+
|
11
|
+
#include "unicode/utypes.h"
|
12
|
+
|
13
|
+
#if !UCONFIG_NO_FORMATTING
|
14
|
+
#ifndef U_HIDE_DRAFT_API
|
15
|
+
|
16
|
+
#include "unicode/localpointer.h"
|
17
|
+
|
18
|
+
/**
|
19
|
+
* \file
|
20
|
+
* \brief C API: Format a list in a locale-appropriate way.
|
21
|
+
*
|
22
|
+
* A UListFormatter is used to format a list of items in a locale-appropriate way,
|
23
|
+
* using data from CLDR.
|
24
|
+
* Example: Input data ["Alice", "Bob", "Charlie", "Delta"] will be formatted
|
25
|
+
* as "Alice, Bob, Charlie, and Delta" in English.
|
26
|
+
*/
|
27
|
+
|
28
|
+
/**
|
29
|
+
* Opaque UListFormatter object for use in C
|
30
|
+
* @draft ICU 55
|
31
|
+
*/
|
32
|
+
struct UListFormatter;
|
33
|
+
typedef struct UListFormatter UListFormatter; /**< C typedef for struct UListFormatter. @draft ICU 55 */
|
34
|
+
|
35
|
+
/**
|
36
|
+
* Open a new UListFormatter object using the rules for a given locale.
|
37
|
+
* @param locale
|
38
|
+
* The locale whose rules should be used; may be NULL for
|
39
|
+
* default locale.
|
40
|
+
* @param status
|
41
|
+
* A pointer to a standard ICU UErrorCode (input/output parameter).
|
42
|
+
* Its input value must pass the U_SUCCESS() test, or else the
|
43
|
+
* function returns immediately. The caller should check its output
|
44
|
+
* value with U_FAILURE(), or use with function chaining (see User
|
45
|
+
* Guide for details).
|
46
|
+
* @return
|
47
|
+
* A pointer to a UListFormatter object for the specified locale,
|
48
|
+
* or NULL if an error occurred.
|
49
|
+
* @draft ICU 55
|
50
|
+
*/
|
51
|
+
U_DRAFT UListFormatter* U_EXPORT2
|
52
|
+
ulistfmt_open(const char* locale,
|
53
|
+
UErrorCode* status);
|
54
|
+
|
55
|
+
/**
|
56
|
+
* Close a UListFormatter object. Once closed it may no longer be used.
|
57
|
+
* @param listfmt
|
58
|
+
* The UListFormatter object to close.
|
59
|
+
* @draft ICU 55
|
60
|
+
*/
|
61
|
+
U_DRAFT void U_EXPORT2
|
62
|
+
ulistfmt_close(UListFormatter *listfmt);
|
63
|
+
|
64
|
+
|
65
|
+
#if U_SHOW_CPLUSPLUS_API
|
66
|
+
|
67
|
+
U_NAMESPACE_BEGIN
|
68
|
+
|
69
|
+
/**
|
70
|
+
* \class LocalUListFormatterPointer
|
71
|
+
* "Smart pointer" class, closes a UListFormatter via ulistfmt_close().
|
72
|
+
* For most methods see the LocalPointerBase base class.
|
73
|
+
*
|
74
|
+
* @see LocalPointerBase
|
75
|
+
* @see LocalPointer
|
76
|
+
* @draft ICU 55
|
77
|
+
*/
|
78
|
+
U_DEFINE_LOCAL_OPEN_POINTER(LocalUListFormatterPointer, UListFormatter, ulistfmt_close);
|
79
|
+
|
80
|
+
U_NAMESPACE_END
|
81
|
+
|
82
|
+
#endif
|
83
|
+
|
84
|
+
/**
|
85
|
+
* Formats a list of strings using the conventions established for the
|
86
|
+
* UListFormatter object.
|
87
|
+
* @param listfmt
|
88
|
+
* The UListFormatter object specifying the list conventions.
|
89
|
+
* @param strings
|
90
|
+
* An array of pointers to UChar strings; the array length is
|
91
|
+
* specified by stringCount. Must be non-NULL if stringCount > 0.
|
92
|
+
* @param stringLengths
|
93
|
+
* An array of string lengths corresponding to the strings[]
|
94
|
+
* parameter; any individual length value may be negative to indicate
|
95
|
+
* that the corresponding strings[] entry is 0-terminated, or
|
96
|
+
* stringLengths itself may be NULL if all of the strings are
|
97
|
+
* 0-terminated. If non-NULL, the stringLengths array must have
|
98
|
+
* stringCount entries.
|
99
|
+
* @param stringCount
|
100
|
+
* the number of entries in strings[], and the number of entries
|
101
|
+
* in the stringLengths array if it is not NULL. Must be >= 0.
|
102
|
+
* @param result
|
103
|
+
* A pointer to a buffer to receive the formatted list.
|
104
|
+
* @param resultCapacity
|
105
|
+
* The maximum size of result.
|
106
|
+
* @param status
|
107
|
+
* A pointer to a standard ICU UErrorCode (input/output parameter).
|
108
|
+
* Its input value must pass the U_SUCCESS() test, or else the
|
109
|
+
* function returns immediately. The caller should check its output
|
110
|
+
* value with U_FAILURE(), or use with function chaining (see User
|
111
|
+
* Guide for details).
|
112
|
+
* @return
|
113
|
+
* The total buffer size needed; if greater than resultLength, the
|
114
|
+
* output was truncated. May be <=0 if unable to determine the
|
115
|
+
* total buffer size needed (e.g. for illegal arguments).
|
116
|
+
* @draft ICU 55
|
117
|
+
*/
|
118
|
+
U_DRAFT int32_t U_EXPORT2
|
119
|
+
ulistfmt_format(const UListFormatter* listfmt,
|
120
|
+
const UChar* const strings[],
|
121
|
+
const int32_t * stringLengths,
|
122
|
+
int32_t stringCount,
|
123
|
+
UChar* result,
|
124
|
+
int32_t resultCapacity,
|
125
|
+
UErrorCode* status);
|
126
|
+
|
127
|
+
#endif /* U_HIDE_DRAFT_API */
|
128
|
+
#endif /* #if !UCONFIG_NO_FORMATTING */
|
129
|
+
|
130
|
+
#endif
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/*
|
2
2
|
******************************************************************************
|
3
3
|
* *
|
4
|
-
* Copyright (C) 2003-
|
4
|
+
* Copyright (C) 2003-2015, International Business Machines *
|
5
5
|
* Corporation and others. All Rights Reserved. *
|
6
6
|
* *
|
7
7
|
******************************************************************************
|
@@ -186,8 +186,9 @@ ulocdata_getDelimiter(ULocaleData *uld, ULocaleDataDelimiterType type, UChar *re
|
|
186
186
|
* @stable ICU 2.8
|
187
187
|
*/
|
188
188
|
typedef enum UMeasurementSystem {
|
189
|
-
UMS_SI,
|
190
|
-
UMS_US,
|
189
|
+
UMS_SI, /**< Measurement system specified by SI otherwise known as Metric system. @stable ICU 2.8 */
|
190
|
+
UMS_US, /**< Measurement system followed in the United States of America. @stable ICU 2.8 */
|
191
|
+
UMS_UK, /**< Mix of metric and imperial units used in Great Britain. @stable ICU 55 */
|
191
192
|
UMS_LIMIT
|
192
193
|
} UMeasurementSystem;
|
193
194
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
**********************************************************************
|
3
|
-
* Copyright (C) 1998-
|
3
|
+
* Copyright (C) 1998-2014, International Business Machines
|
4
4
|
* Corporation and others. All Rights Reserved.
|
5
5
|
**********************************************************************
|
6
6
|
*
|
@@ -3370,6 +3370,9 @@ private:
|
|
3370
3370
|
inline UChar* getArrayStart(void);
|
3371
3371
|
inline const UChar* getArrayStart(void) const;
|
3372
3372
|
|
3373
|
+
inline UBool hasShortLength() const;
|
3374
|
+
inline int32_t getShortLength() const;
|
3375
|
+
|
3373
3376
|
// A UnicodeString object (not necessarily its current buffer)
|
3374
3377
|
// is writable unless it isBogus() or it has an "open" getBuffer(minCapacity).
|
3375
3378
|
inline UBool isWritable() const;
|
@@ -3378,13 +3381,16 @@ private:
|
|
3378
3381
|
inline UBool isBufferWritable() const;
|
3379
3382
|
|
3380
3383
|
// None of the following does releaseArray().
|
3381
|
-
inline void
|
3382
|
-
inline void
|
3383
|
-
inline void
|
3384
|
+
inline void setZeroLength();
|
3385
|
+
inline void setShortLength(int32_t len);
|
3386
|
+
inline void setLength(int32_t len);
|
3387
|
+
inline void setToEmpty();
|
3388
|
+
inline void setArray(UChar *array, int32_t len, int32_t capacity); // sets length but not flags
|
3384
3389
|
|
3385
|
-
// allocate the array; result may be
|
3390
|
+
// allocate the array; result may be the stack buffer
|
3386
3391
|
// sets refCount to 1 if appropriate
|
3387
|
-
// sets fArray, fCapacity, and
|
3392
|
+
// sets fArray, fCapacity, and flags
|
3393
|
+
// sets length to 0
|
3388
3394
|
// returns boolean for success or failure
|
3389
3395
|
UBool allocate(int32_t capacity);
|
3390
3396
|
|
@@ -3471,18 +3477,24 @@ private:
|
|
3471
3477
|
// Set the stack buffer size so that sizeof(UnicodeString) is,
|
3472
3478
|
// naturally (without padding), a multiple of sizeof(pointer).
|
3473
3479
|
US_STACKBUF_SIZE= sizeof(void *)==4 ? 13 : 15, // Size of stack buffer for short strings
|
3474
|
-
kInvalidUChar=0xffff, // invalid
|
3480
|
+
kInvalidUChar=0xffff, // U+FFFF returned by charAt(invalid index)
|
3475
3481
|
kGrowSize=128, // grow size for this buffer
|
3476
3482
|
kInvalidHashCode=0, // invalid hash code
|
3477
3483
|
kEmptyHashCode=1, // hash code for empty string
|
3478
3484
|
|
3479
|
-
// bit flag values for
|
3485
|
+
// bit flag values for fLengthAndFlags
|
3480
3486
|
kIsBogus=1, // this string is bogus, i.e., not valid or NULL
|
3481
|
-
kUsingStackBuffer=2,// using fUnion.
|
3487
|
+
kUsingStackBuffer=2,// using fUnion.fStackFields instead of fUnion.fFields
|
3482
3488
|
kRefCounted=4, // there is a refCount field before the characters in fArray
|
3483
3489
|
kBufferIsReadonly=8,// do not write to this buffer
|
3484
3490
|
kOpenGetBuffer=16, // getBuffer(minCapacity) was called (is "open"),
|
3485
3491
|
// and releaseBuffer(newLength) must be called
|
3492
|
+
kAllStorageFlags=0x1f,
|
3493
|
+
|
3494
|
+
kLengthShift=5, // remaining 11 bits for non-negative short length, or negative if long
|
3495
|
+
kLength1=1<<kLengthShift,
|
3496
|
+
kMaxShortLength=0x3ff, // max non-negative short length (leaves top bit 0)
|
3497
|
+
kLengthIsLarge=0xffe0, // short length < 0, real length is in fUnion.fFields.fLength
|
3486
3498
|
|
3487
3499
|
// combined values for convenience
|
3488
3500
|
kShortString=kUsingStackBuffer,
|
@@ -3515,36 +3527,42 @@ private:
|
|
3515
3527
|
* - sizeof(class UnicodeString)
|
3516
3528
|
* - offsetof(UnicodeString, fUnion)
|
3517
3529
|
* - sizeof(fUnion)
|
3518
|
-
* - sizeof(
|
3530
|
+
* - sizeof(fStackFields)
|
3519
3531
|
*
|
3520
|
-
*
|
3521
|
-
*
|
3522
|
-
*
|
3523
|
-
*
|
3532
|
+
* We optimize for the longest possible internal buffer for short strings.
|
3533
|
+
* fUnion.fStackFields begins with 2 bytes for storage flags
|
3534
|
+
* and the length of relatively short strings,
|
3535
|
+
* followed by the buffer for short string contents.
|
3536
|
+
* There is no padding inside fStackFields.
|
3524
3537
|
*
|
3525
|
-
*
|
3526
|
-
*
|
3527
|
-
*
|
3528
|
-
*
|
3538
|
+
* Heap-allocated and aliased strings use fUnion.fFields.
|
3539
|
+
* Both fStackFields and fFields must begin with the same fields for flags and short length,
|
3540
|
+
* that is, those must have the same memory offsets inside the object,
|
3541
|
+
* because the flags must be inspected in order to decide which half of fUnion is being used.
|
3542
|
+
* We assume that the compiler does not reorder the fields.
|
3529
3543
|
*
|
3530
|
-
*
|
3531
|
-
*
|
3532
|
-
*
|
3544
|
+
* (Padding at the end of fFields is ok:
|
3545
|
+
* As long as it is no larger than fStackFields, it is not wasted space.)
|
3546
|
+
*
|
3547
|
+
* For some of the history of the UnicodeString class fields layout,
|
3548
|
+
* see ICU ticket #11336 "UnicodeString: recombine stack buffer arrays"
|
3549
|
+
* and ticket #8322 "why is sizeof(UnicodeString)==48?".
|
3533
3550
|
*/
|
3534
3551
|
// (implicit) *vtable;
|
3535
3552
|
union StackBufferOrFields {
|
3536
|
-
//
|
3537
|
-
//
|
3538
|
-
|
3553
|
+
// fStackFields is used iff (fLengthAndFlags&kUsingStackBuffer) else fFields is used.
|
3554
|
+
// Each struct of the union must begin with fLengthAndFlags.
|
3555
|
+
struct {
|
3556
|
+
int16_t fLengthAndFlags; // bit fields: see constants above
|
3557
|
+
UChar fBuffer[US_STACKBUF_SIZE]; // buffer for short strings
|
3558
|
+
} fStackFields;
|
3539
3559
|
struct {
|
3560
|
+
int16_t fLengthAndFlags; // bit fields: see constants above
|
3540
3561
|
UChar *fArray; // the Unicode data
|
3541
3562
|
int32_t fCapacity; // capacity of fArray (in UChars)
|
3542
3563
|
int32_t fLength; // number of characters in fArray if >127; else undefined
|
3543
3564
|
} fFields;
|
3544
3565
|
} fUnion;
|
3545
|
-
UChar fRestOfStackBuffer[US_STACKBUF_SIZE-8];
|
3546
|
-
int8_t fShortLength; // 0..127: length <0: real length is in fUnion.fFields.fLength
|
3547
|
-
uint8_t fFlags; // bit flags: see constants above
|
3548
3566
|
};
|
3549
3567
|
|
3550
3568
|
/**
|
@@ -3596,33 +3614,51 @@ UnicodeString::pinIndices(int32_t& start,
|
|
3596
3614
|
}
|
3597
3615
|
|
3598
3616
|
inline UChar*
|
3599
|
-
UnicodeString::getArrayStart()
|
3600
|
-
|
3617
|
+
UnicodeString::getArrayStart() {
|
3618
|
+
return (fUnion.fFields.fLengthAndFlags&kUsingStackBuffer) ?
|
3619
|
+
fUnion.fStackFields.fBuffer : fUnion.fFields.fArray;
|
3620
|
+
}
|
3601
3621
|
|
3602
3622
|
inline const UChar*
|
3603
|
-
UnicodeString::getArrayStart() const
|
3604
|
-
|
3623
|
+
UnicodeString::getArrayStart() const {
|
3624
|
+
return (fUnion.fFields.fLengthAndFlags&kUsingStackBuffer) ?
|
3625
|
+
fUnion.fStackFields.fBuffer : fUnion.fFields.fArray;
|
3626
|
+
}
|
3605
3627
|
|
3606
3628
|
//========================================
|
3607
3629
|
// Default constructor
|
3608
3630
|
//========================================
|
3609
3631
|
|
3610
3632
|
inline
|
3611
|
-
UnicodeString::UnicodeString()
|
3612
|
-
|
3613
|
-
|
3614
|
-
{}
|
3633
|
+
UnicodeString::UnicodeString() {
|
3634
|
+
fUnion.fStackFields.fLengthAndFlags=kShortString;
|
3635
|
+
}
|
3615
3636
|
|
3616
3637
|
//========================================
|
3617
3638
|
// Read-only implementation methods
|
3618
3639
|
//========================================
|
3640
|
+
inline UBool
|
3641
|
+
UnicodeString::hasShortLength() const {
|
3642
|
+
return fUnion.fFields.fLengthAndFlags>=0;
|
3643
|
+
}
|
3644
|
+
|
3619
3645
|
inline int32_t
|
3620
|
-
UnicodeString::
|
3621
|
-
|
3646
|
+
UnicodeString::getShortLength() const {
|
3647
|
+
// fLengthAndFlags must be non-negative -> short length >= 0
|
3648
|
+
// and arithmetic or logical shift does not matter.
|
3649
|
+
return fUnion.fFields.fLengthAndFlags>>kLengthShift;
|
3650
|
+
}
|
3651
|
+
|
3652
|
+
inline int32_t
|
3653
|
+
UnicodeString::length() const {
|
3654
|
+
return hasShortLength() ? getShortLength() : fUnion.fFields.fLength;
|
3655
|
+
}
|
3622
3656
|
|
3623
3657
|
inline int32_t
|
3624
|
-
UnicodeString::getCapacity() const
|
3625
|
-
|
3658
|
+
UnicodeString::getCapacity() const {
|
3659
|
+
return (fUnion.fFields.fLengthAndFlags&kUsingStackBuffer) ?
|
3660
|
+
US_STACKBUF_SIZE : fUnion.fFields.fCapacity;
|
3661
|
+
}
|
3626
3662
|
|
3627
3663
|
inline int32_t
|
3628
3664
|
UnicodeString::hashCode() const
|
@@ -3630,26 +3666,26 @@ UnicodeString::hashCode() const
|
|
3630
3666
|
|
3631
3667
|
inline UBool
|
3632
3668
|
UnicodeString::isBogus() const
|
3633
|
-
{ return (UBool)(
|
3669
|
+
{ return (UBool)(fUnion.fFields.fLengthAndFlags & kIsBogus); }
|
3634
3670
|
|
3635
3671
|
inline UBool
|
3636
3672
|
UnicodeString::isWritable() const
|
3637
|
-
{ return (UBool)!(
|
3673
|
+
{ return (UBool)!(fUnion.fFields.fLengthAndFlags&(kOpenGetBuffer|kIsBogus)); }
|
3638
3674
|
|
3639
3675
|
inline UBool
|
3640
3676
|
UnicodeString::isBufferWritable() const
|
3641
3677
|
{
|
3642
3678
|
return (UBool)(
|
3643
|
-
!(
|
3644
|
-
(!(
|
3679
|
+
!(fUnion.fFields.fLengthAndFlags&(kOpenGetBuffer|kIsBogus|kBufferIsReadonly)) &&
|
3680
|
+
(!(fUnion.fFields.fLengthAndFlags&kRefCounted) || refCount()==1));
|
3645
3681
|
}
|
3646
3682
|
|
3647
3683
|
inline const UChar *
|
3648
3684
|
UnicodeString::getBuffer() const {
|
3649
|
-
if(
|
3685
|
+
if(fUnion.fFields.fLengthAndFlags&(kIsBogus|kOpenGetBuffer)) {
|
3650
3686
|
return 0;
|
3651
|
-
} else if(
|
3652
|
-
return fUnion.
|
3687
|
+
} else if(fUnion.fFields.fLengthAndFlags&kUsingStackBuffer) {
|
3688
|
+
return fUnion.fStackFields.fBuffer;
|
3653
3689
|
} else {
|
3654
3690
|
return fUnion.fFields.fArray;
|
3655
3691
|
}
|
@@ -4250,26 +4286,38 @@ UnicodeString::operator[] (int32_t offset) const
|
|
4250
4286
|
|
4251
4287
|
inline UBool
|
4252
4288
|
UnicodeString::isEmpty() const {
|
4253
|
-
|
4289
|
+
// Arithmetic or logical right shift does not matter: only testing for 0.
|
4290
|
+
return (fUnion.fFields.fLengthAndFlags>>kLengthShift) == 0;
|
4254
4291
|
}
|
4255
4292
|
|
4256
4293
|
//========================================
|
4257
4294
|
// Write implementation methods
|
4258
4295
|
//========================================
|
4296
|
+
inline void
|
4297
|
+
UnicodeString::setZeroLength() {
|
4298
|
+
fUnion.fFields.fLengthAndFlags &= kAllStorageFlags;
|
4299
|
+
}
|
4300
|
+
|
4301
|
+
inline void
|
4302
|
+
UnicodeString::setShortLength(int32_t len) {
|
4303
|
+
// requires 0 <= len <= kMaxShortLength
|
4304
|
+
fUnion.fFields.fLengthAndFlags =
|
4305
|
+
(int16_t)((fUnion.fFields.fLengthAndFlags & kAllStorageFlags) | (len << kLengthShift));
|
4306
|
+
}
|
4307
|
+
|
4259
4308
|
inline void
|
4260
4309
|
UnicodeString::setLength(int32_t len) {
|
4261
|
-
if(len <=
|
4262
|
-
|
4310
|
+
if(len <= kMaxShortLength) {
|
4311
|
+
setShortLength(len);
|
4263
4312
|
} else {
|
4264
|
-
|
4313
|
+
fUnion.fFields.fLengthAndFlags |= kLengthIsLarge;
|
4265
4314
|
fUnion.fFields.fLength = len;
|
4266
4315
|
}
|
4267
4316
|
}
|
4268
4317
|
|
4269
4318
|
inline void
|
4270
4319
|
UnicodeString::setToEmpty() {
|
4271
|
-
|
4272
|
-
fFlags = kShortString;
|
4320
|
+
fUnion.fFields.fLengthAndFlags = kShortString;
|
4273
4321
|
}
|
4274
4322
|
|
4275
4323
|
inline void
|
@@ -4414,7 +4462,7 @@ UnicodeString::remove()
|
|
4414
4462
|
if(isBogus()) {
|
4415
4463
|
setToEmpty();
|
4416
4464
|
} else {
|
4417
|
-
|
4465
|
+
setZeroLength();
|
4418
4466
|
}
|
4419
4467
|
return *this;
|
4420
4468
|
}
|