pango 3.2.7-x64-mingw32 → 3.2.8-x64-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +10 -7
- data/lib/2.2/pango.so +0 -0
- data/lib/2.3/pango.so +0 -0
- data/lib/2.4/pango.so +0 -0
- data/lib/2.5/pango.so +0 -0
- data/pango.gemspec +2 -0
- data/vendor/local/bin/derb.exe +0 -0
- data/vendor/local/bin/escapesrc.exe +0 -0
- data/vendor/local/bin/fribidi.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-subset.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/libfribidi-0.dll +0 -0
- data/vendor/local/bin/libgraphene-1.0-0.dll +0 -0
- data/vendor/local/bin/libharfbuzz-0.dll +0 -0
- data/vendor/local/bin/libharfbuzz-subset-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/{libexec/installed-tests/graphene-1.0/quad.exe → bin/pango-list.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/include/fribidi/fribidi-config.h +2 -2
- data/vendor/local/include/graphene-1.0/graphene-macros.h +1 -1
- data/vendor/local/include/graphene-1.0/graphene-matrix.h +1 -1
- data/vendor/local/include/graphene-1.0/graphene-vec2.h +1 -1
- data/vendor/local/include/graphene-1.0/graphene-vec3.h +1 -1
- data/vendor/local/include/graphene-1.0/graphene-vec4.h +1 -1
- data/vendor/local/include/graphene-1.0/graphene-version.h +2 -2
- data/vendor/local/include/harfbuzz/hb-ot-layout.h +13 -0
- data/vendor/local/include/harfbuzz/hb-set.h +4 -0
- data/vendor/local/include/harfbuzz/hb-subset-plan.hh +1 -1
- data/vendor/local/include/harfbuzz/hb-subset-private.hh +1 -0
- data/vendor/local/include/harfbuzz/hb-subset.h +3 -0
- data/vendor/local/include/harfbuzz/hb-version.h +2 -2
- data/vendor/local/include/pango-1.0/pango/pango-features.h +2 -2
- data/vendor/local/include/unicode/brkiter.h +1 -1
- data/vendor/local/include/unicode/bytestriebuilder.h +1 -1
- data/vendor/local/include/unicode/caniter.h +2 -2
- data/vendor/local/include/unicode/compactdecimalformat.h +17 -250
- data/vendor/local/include/unicode/currunit.h +3 -2
- data/vendor/local/include/unicode/dcfmtsym.h +8 -1
- data/vendor/local/include/unicode/decimfmt.h +301 -439
- data/vendor/local/include/unicode/docmain.h +1 -1
- data/vendor/local/include/unicode/edits.h +129 -21
- data/vendor/local/include/unicode/fmtable.h +14 -21
- data/vendor/local/include/unicode/fpositer.h +0 -8
- data/vendor/local/include/unicode/measunit.h +0 -8
- data/vendor/local/include/unicode/nounit.h +6 -6
- data/vendor/local/include/unicode/numberformatter.h +1005 -553
- data/vendor/local/include/unicode/numfmt.h +10 -10
- data/vendor/local/include/unicode/platform.h +0 -14
- data/vendor/local/include/unicode/plurrule.h +0 -21
- data/vendor/local/include/unicode/rbbi.h +9 -15
- data/vendor/local/include/unicode/rbnf.h +2 -2
- data/vendor/local/include/unicode/scientificnumberformatter.h +0 -5
- data/vendor/local/include/unicode/smpdtfmt.h +33 -6
- data/vendor/local/include/unicode/timezone.h +2 -0
- data/vendor/local/include/unicode/uchar.h +42 -3
- data/vendor/local/include/unicode/unistr.h +3 -3
- data/vendor/local/include/unicode/unum.h +26 -5
- data/vendor/local/include/unicode/unumberformatter.h +717 -0
- data/vendor/local/include/unicode/urename.h +13 -0
- data/vendor/local/include/unicode/uscript.h +16 -1
- data/vendor/local/include/unicode/uspoof.h +24 -1
- data/vendor/local/include/unicode/utypes.h +4 -1
- data/vendor/local/include/unicode/uvernum.h +5 -5
- data/vendor/local/lib/cmake/harfbuzz/harfbuzz-config.cmake +1 -1
- data/vendor/local/lib/graphene-1.0/include/graphene-config.h +3 -1
- data/vendor/local/lib/icu/{61.1 → 62.1}/Makefile.inc +6 -6
- data/vendor/local/lib/icu/{61.1 → 62.1}/pkgdata.inc +3 -3
- data/vendor/local/lib/icu/Makefile.inc +6 -6
- data/vendor/local/lib/icu/pkgdata.inc +3 -3
- data/vendor/local/lib/icudt.dll +0 -0
- data/vendor/local/lib/{icudt61.dll → icudt62.dll} +0 -0
- data/vendor/local/lib/icuin.dll +0 -0
- data/vendor/local/lib/icuin62.dll +0 -0
- data/vendor/local/lib/icuio.dll +0 -0
- data/vendor/local/lib/{icuio61.dll → icuio62.dll} +0 -0
- data/vendor/local/lib/icutest.dll +0 -0
- data/vendor/local/lib/{icutest61.dll → icutest62.dll} +0 -0
- data/vendor/local/lib/icutu.dll +0 -0
- data/vendor/local/lib/{icutu61.dll → icutu62.dll} +0 -0
- data/vendor/local/lib/icuuc.dll +0 -0
- data/vendor/local/lib/{icuuc61.dll → icuuc62.dll} +0 -0
- data/vendor/local/lib/libfribidi.dll.a +0 -0
- data/vendor/local/lib/libgraphene-1.0.dll.a +0 -0
- data/vendor/local/lib/libharfbuzz-icu.a +0 -0
- data/vendor/local/lib/libharfbuzz-icu.la +2 -2
- data/vendor/local/lib/libharfbuzz-subset.dll.a +0 -0
- data/vendor/local/lib/libharfbuzz-subset.la +2 -2
- data/vendor/local/lib/libharfbuzz.dll.a +0 -0
- data/vendor/local/lib/libharfbuzz.la +2 -2
- 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/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/pkgconfig/fribidi.pc +1 -1
- data/vendor/local/lib/pkgconfig/graphene-1.0.pc +7 -11
- data/vendor/local/lib/pkgconfig/graphene-gobject-1.0.pc +6 -12
- data/vendor/local/lib/pkgconfig/harfbuzz-icu.pc +1 -1
- data/vendor/local/lib/pkgconfig/harfbuzz-subset.pc +1 -1
- data/vendor/local/lib/pkgconfig/harfbuzz.pc +1 -1
- data/vendor/local/lib/pkgconfig/icu-i18n.pc +6 -6
- data/vendor/local/lib/pkgconfig/icu-io.pc +6 -6
- data/vendor/local/lib/pkgconfig/icu-uc.pc +6 -6
- data/vendor/local/lib/pkgconfig/pango.pc +3 -2
- 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 +2 -2
- data/vendor/local/share/gir-1.0/Graphene-1.0.gir +1 -1
- data/vendor/local/share/gtk-doc/html/harfbuzz/api-index-full.html +80 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-blob.html +34 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-face.html +13 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-ot-layout.html +20 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz-hb-set.html +83 -28
- data/vendor/local/share/gtk-doc/html/harfbuzz/harfbuzz.devhelp2 +5 -1
- data/vendor/local/share/gtk-doc/html/harfbuzz/object-tree.html +1 -0
- data/vendor/local/share/gtk-doc/html/harfbuzz/pt02.html +1 -1
- data/vendor/local/share/gtk-doc/html/pango/PangoEngineLang.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/PangoEngineShape.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/PangoFcDecoder.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/PangoFcFont.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/PangoFcFontMap.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/PangoMarkupFormat.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/PangoRenderer.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/annotation-glossary.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/api-index-full.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/index.html +3 -3
- data/vendor/local/share/gtk-doc/html/pango/lowlevel.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/pango-Bidirectional-Text.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/pango-Cairo-Rendering.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/pango-CoreText-Fonts.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/pango-Coverage-Maps.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/pango-Engines.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/pango-Fonts.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/pango-FreeType-Fonts-and-Rendering.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/pango-Glyph-Storage.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/pango-Layout-Objects.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/pango-Miscellaneous-Utilities.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/pango-Modules.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/pango-OpenType-Font-Handling.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/pango-Scripts-and-Languages.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/pango-Tab-Stops.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/pango-Text-Attributes.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/pango-Text-Processing.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/pango-Version-Checking.html +4 -4
- data/vendor/local/share/gtk-doc/html/pango/pango-Vertical-Text.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/pango-Win32-Fonts-and-Rendering.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/pango-Xft-Fonts-and-Rendering.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/pango-hierarchy.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/pango.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/rendering.html +2 -2
- data/vendor/local/share/gtk-doc/html/pango/style.css +4 -0
- data/vendor/local/share/icu/{61.1 → 62.1}/LICENSE +0 -0
- data/vendor/local/share/icu/{61.1 → 62.1}/config/mh-mingw64 +0 -0
- data/vendor/local/share/icu/{61.1 → 62.1}/install-sh +0 -0
- data/vendor/local/share/icu/{61.1 → 62.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 +20 -54
- data/vendor/local/lib/icuin61.dll +0 -0
- data/vendor/local/libexec/installed-tests/graphene-1.0/box.exe +0 -0
- data/vendor/local/libexec/installed-tests/graphene-1.0/euler.exe +0 -0
- data/vendor/local/libexec/installed-tests/graphene-1.0/frustum.exe +0 -0
- data/vendor/local/libexec/installed-tests/graphene-1.0/matrix.exe +0 -0
- data/vendor/local/libexec/installed-tests/graphene-1.0/plane.exe +0 -0
- data/vendor/local/libexec/installed-tests/graphene-1.0/point.exe +0 -0
- data/vendor/local/libexec/installed-tests/graphene-1.0/point3d.exe +0 -0
- data/vendor/local/libexec/installed-tests/graphene-1.0/quaternion.exe +0 -0
- data/vendor/local/libexec/installed-tests/graphene-1.0/ray.exe +0 -0
- data/vendor/local/libexec/installed-tests/graphene-1.0/rect.exe +0 -0
- data/vendor/local/libexec/installed-tests/graphene-1.0/simd.exe +0 -0
- data/vendor/local/libexec/installed-tests/graphene-1.0/size.exe +0 -0
- data/vendor/local/libexec/installed-tests/graphene-1.0/sphere.exe +0 -0
- data/vendor/local/libexec/installed-tests/graphene-1.0/triangle.exe +0 -0
- data/vendor/local/libexec/installed-tests/graphene-1.0/vec2.exe +0 -0
- data/vendor/local/libexec/installed-tests/graphene-1.0/vec3.exe +0 -0
- data/vendor/local/libexec/installed-tests/graphene-1.0/vec4.exe +0 -0
- data/vendor/local/share/installed-tests/graphene-1.0/box.test +0 -3
- data/vendor/local/share/installed-tests/graphene-1.0/euler.test +0 -3
- data/vendor/local/share/installed-tests/graphene-1.0/frustum.test +0 -3
- data/vendor/local/share/installed-tests/graphene-1.0/matrix.test +0 -3
- data/vendor/local/share/installed-tests/graphene-1.0/plane.test +0 -3
- data/vendor/local/share/installed-tests/graphene-1.0/point.test +0 -3
- data/vendor/local/share/installed-tests/graphene-1.0/point3d.test +0 -3
- data/vendor/local/share/installed-tests/graphene-1.0/quad.test +0 -3
- data/vendor/local/share/installed-tests/graphene-1.0/quaternion.test +0 -3
- data/vendor/local/share/installed-tests/graphene-1.0/ray.test +0 -3
- data/vendor/local/share/installed-tests/graphene-1.0/rect.test +0 -3
- data/vendor/local/share/installed-tests/graphene-1.0/simd.test +0 -3
- data/vendor/local/share/installed-tests/graphene-1.0/size.test +0 -3
- data/vendor/local/share/installed-tests/graphene-1.0/sphere.test +0 -3
- data/vendor/local/share/installed-tests/graphene-1.0/triangle.test +0 -3
- data/vendor/local/share/installed-tests/graphene-1.0/vec2.test +0 -3
- data/vendor/local/share/installed-tests/graphene-1.0/vec3.test +0 -3
- data/vendor/local/share/installed-tests/graphene-1.0/vec4.test +0 -3
@@ -44,8 +44,9 @@ class U_I18N_API CurrencyUnit: public MeasureUnit {
|
|
44
44
|
|
45
45
|
/**
|
46
46
|
* Construct an object with the given ISO currency code.
|
47
|
-
* @param isoCode the 3-letter ISO 4217 currency code; must
|
48
|
-
*
|
47
|
+
* @param isoCode the 3-letter ISO 4217 currency code; must have
|
48
|
+
* length 3 and need not be NUL-terminated. If NULL, the currency
|
49
|
+
* is initialized to the unknown currency XXX.
|
49
50
|
* @param ec input-output error code. If the isoCode is invalid,
|
50
51
|
* then this will be set to a failing value.
|
51
52
|
* @stable ICU 3.0
|
@@ -406,9 +406,12 @@ public:
|
|
406
406
|
* returning a const reference to one of the symbol strings.
|
407
407
|
* The returned reference becomes invalid when the symbol is changed
|
408
408
|
* or when the DecimalFormatSymbols are destroyed.
|
409
|
-
* ### TODO markus 2002oct11: Consider proposing getConstSymbol() to be really public.
|
410
409
|
* Note: moved #ifndef U_HIDE_INTERNAL_API after this, since this is needed for inline in DecimalFormat
|
411
410
|
*
|
411
|
+
* This is not currently stable API, but if you think it should be stable,
|
412
|
+
* post a comment on the following ticket and the ICU team will take a look:
|
413
|
+
* http://bugs.icu-project.org/trac/ticket/13580
|
414
|
+
*
|
412
415
|
* @param symbol Constant to indicate a number format symbol.
|
413
416
|
* @return the format symbol by the param 'symbol'
|
414
417
|
* @internal
|
@@ -422,6 +425,10 @@ public:
|
|
422
425
|
* to accessing the symbol from getConstSymbol with the corresponding
|
423
426
|
* key, such as kZeroDigitSymbol or kOneDigitSymbol.
|
424
427
|
*
|
428
|
+
* This is not currently stable API, but if you think it should be stable,
|
429
|
+
* post a comment on the following ticket and the ICU team will take a look:
|
430
|
+
* http://bugs.icu-project.org/trac/ticket/13580
|
431
|
+
*
|
425
432
|
* @param digit The digit, an integer between 0 and 9 inclusive.
|
426
433
|
* If outside the range 0 to 9, the zero digit is returned.
|
427
434
|
* @return the format symbol for the given digit.
|
@@ -43,28 +43,25 @@
|
|
43
43
|
#include "unicode/curramt.h"
|
44
44
|
#include "unicode/enumset.h"
|
45
45
|
|
46
|
-
#ifndef U_HIDE_INTERNAL_API
|
47
|
-
/**
|
48
|
-
* \def UNUM_DECIMALFORMAT_INTERNAL_SIZE
|
49
|
-
* @internal
|
50
|
-
*/
|
51
|
-
#if UCONFIG_FORMAT_FASTPATHS_49
|
52
|
-
#define UNUM_DECIMALFORMAT_INTERNAL_SIZE 16
|
53
|
-
#endif
|
54
|
-
#endif /* U_HIDE_INTERNAL_API */
|
55
|
-
|
56
46
|
U_NAMESPACE_BEGIN
|
57
47
|
|
58
|
-
class DigitList;
|
59
48
|
class CurrencyPluralInfo;
|
60
|
-
class
|
61
|
-
|
62
|
-
|
63
|
-
class
|
64
|
-
class
|
65
|
-
|
66
|
-
class
|
67
|
-
|
49
|
+
class CompactDecimalFormat;
|
50
|
+
|
51
|
+
namespace number {
|
52
|
+
class LocalizedNumberFormatter;
|
53
|
+
class FormattedNumber;
|
54
|
+
namespace impl {
|
55
|
+
class DecimalQuantity;
|
56
|
+
struct DecimalFormatFields;
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
60
|
+
namespace numparse {
|
61
|
+
namespace impl {
|
62
|
+
class NumberParserImpl;
|
63
|
+
}
|
64
|
+
}
|
68
65
|
|
69
66
|
// explicit template instantiation. see digitlst.h
|
70
67
|
// (When building DLLs for Windows this is required.)
|
@@ -672,17 +669,14 @@ template class U_I18N_API EnumSet<UNumberFormatAttribute,
|
|
672
669
|
* subclasses, such code will not necessarily work and will not be
|
673
670
|
* guaranteed to work stably from release to release.
|
674
671
|
*/
|
675
|
-
class U_I18N_API DecimalFormat: public NumberFormat {
|
676
|
-
public:
|
672
|
+
class U_I18N_API DecimalFormat : public NumberFormat {
|
673
|
+
public:
|
677
674
|
/**
|
678
675
|
* Pad position.
|
679
676
|
* @stable ICU 2.4
|
680
677
|
*/
|
681
678
|
enum EPadPosition {
|
682
|
-
kPadBeforePrefix,
|
683
|
-
kPadAfterPrefix,
|
684
|
-
kPadBeforeSuffix,
|
685
|
-
kPadAfterSuffix
|
679
|
+
kPadBeforePrefix, kPadAfterPrefix, kPadBeforeSuffix, kPadAfterSuffix
|
686
680
|
};
|
687
681
|
|
688
682
|
/**
|
@@ -720,8 +714,7 @@ public:
|
|
720
714
|
* pattern is invalid this will be set to a failure code.
|
721
715
|
* @stable ICU 2.0
|
722
716
|
*/
|
723
|
-
DecimalFormat(const UnicodeString& pattern,
|
724
|
-
UErrorCode& status);
|
717
|
+
DecimalFormat(const UnicodeString& pattern, UErrorCode& status);
|
725
718
|
|
726
719
|
/**
|
727
720
|
* Create a DecimalFormat from the given pattern and symbols.
|
@@ -744,11 +737,10 @@ public:
|
|
744
737
|
* pattern is invalid this will be set to a failure code.
|
745
738
|
* @stable ICU 2.0
|
746
739
|
*/
|
747
|
-
DecimalFormat(
|
748
|
-
DecimalFormatSymbols* symbolsToAdopt,
|
749
|
-
UErrorCode& status);
|
740
|
+
DecimalFormat(const UnicodeString& pattern, DecimalFormatSymbols* symbolsToAdopt, UErrorCode& status);
|
750
741
|
|
751
742
|
#ifndef U_HIDE_INTERNAL_API
|
743
|
+
|
752
744
|
/**
|
753
745
|
* This API is for ICU use only.
|
754
746
|
* Create a DecimalFormat from the given pattern, symbols, and style.
|
@@ -761,20 +753,29 @@ public:
|
|
761
753
|
* pattern is invalid this will be set to a failure code.
|
762
754
|
* @internal
|
763
755
|
*/
|
764
|
-
DecimalFormat(
|
765
|
-
|
766
|
-
UNumberFormatStyle style,
|
767
|
-
UErrorCode& status);
|
756
|
+
DecimalFormat(const UnicodeString& pattern, DecimalFormatSymbols* symbolsToAdopt,
|
757
|
+
UNumberFormatStyle style, UErrorCode& status);
|
768
758
|
|
769
759
|
#if UCONFIG_HAVE_PARSEALLINPUT
|
760
|
+
|
770
761
|
/**
|
771
762
|
* @internal
|
772
763
|
*/
|
773
764
|
void setParseAllInput(UNumberFormatAttributeValue value);
|
765
|
+
|
774
766
|
#endif
|
775
767
|
|
776
768
|
#endif /* U_HIDE_INTERNAL_API */
|
777
769
|
|
770
|
+
private:
|
771
|
+
|
772
|
+
/**
|
773
|
+
* Internal constructor for DecimalFormat; sets up internal fields. All public constructors should
|
774
|
+
* call this constructor.
|
775
|
+
*/
|
776
|
+
DecimalFormat(const DecimalFormatSymbols* symbolsToAdopt, UErrorCode& status);
|
777
|
+
|
778
|
+
public:
|
778
779
|
|
779
780
|
/**
|
780
781
|
* Set an integer attribute on this DecimalFormat.
|
@@ -786,9 +787,7 @@ public:
|
|
786
787
|
* @return *this - for chaining (example: format.setAttribute(...).setAttribute(...) )
|
787
788
|
* @stable ICU 51
|
788
789
|
*/
|
789
|
-
virtual DecimalFormat& setAttribute(
|
790
|
-
int32_t newvalue,
|
791
|
-
UErrorCode &status);
|
790
|
+
virtual DecimalFormat& setAttribute(UNumberFormatAttribute attr, int32_t newValue, UErrorCode& status);
|
792
791
|
|
793
792
|
/**
|
794
793
|
* Get an integer
|
@@ -799,8 +798,7 @@ public:
|
|
799
798
|
* @return the attribute value. Undefined if there is an error.
|
800
799
|
* @stable ICU 51
|
801
800
|
*/
|
802
|
-
virtual int32_t getAttribute(
|
803
|
-
UErrorCode &status) const;
|
801
|
+
virtual int32_t getAttribute(UNumberFormatAttribute attr, UErrorCode& status) const;
|
804
802
|
|
805
803
|
|
806
804
|
/**
|
@@ -809,7 +807,7 @@ public:
|
|
809
807
|
* @see getGroupingUsed
|
810
808
|
* @stable ICU 53
|
811
809
|
*/
|
812
|
-
|
810
|
+
void setGroupingUsed(UBool newValue) U_OVERRIDE;
|
813
811
|
|
814
812
|
/**
|
815
813
|
* Sets whether or not numbers should be parsed as integers only.
|
@@ -818,18 +816,16 @@ public:
|
|
818
816
|
* @see isParseIntegerOnly
|
819
817
|
* @stable ICU 53
|
820
818
|
*/
|
821
|
-
|
819
|
+
void setParseIntegerOnly(UBool value) U_OVERRIDE;
|
822
820
|
|
823
821
|
/**
|
824
|
-
*
|
825
|
-
*
|
826
|
-
* @param
|
827
|
-
*
|
828
|
-
*
|
829
|
-
* updated with any new status from the function.
|
830
|
-
* @stable ICU 53
|
822
|
+
* Sets whether lenient parsing should be enabled (it is off by default).
|
823
|
+
*
|
824
|
+
* @param enable \c TRUE if lenient parsing should be used,
|
825
|
+
* \c FALSE otherwise.
|
826
|
+
* @stable ICU 4.8
|
831
827
|
*/
|
832
|
-
|
828
|
+
void setLenient(UBool enable) U_OVERRIDE;
|
833
829
|
|
834
830
|
/**
|
835
831
|
* Create a DecimalFormat from the given pattern and symbols.
|
@@ -853,10 +849,9 @@ public:
|
|
853
849
|
* pattern is invalid this will be set to a failure code.
|
854
850
|
* @stable ICU 2.0
|
855
851
|
*/
|
856
|
-
DecimalFormat(
|
857
|
-
|
858
|
-
|
859
|
-
UErrorCode& status);
|
852
|
+
DecimalFormat(const UnicodeString& pattern, DecimalFormatSymbols* symbolsToAdopt,
|
853
|
+
UParseError& parseError, UErrorCode& status);
|
854
|
+
|
860
855
|
/**
|
861
856
|
* Create a DecimalFormat from the given pattern and symbols.
|
862
857
|
* Use this constructor when you need to completely customize the
|
@@ -877,9 +872,7 @@ public:
|
|
877
872
|
* pattern is invalid this will be set to a failure code.
|
878
873
|
* @stable ICU 2.0
|
879
874
|
*/
|
880
|
-
DecimalFormat(
|
881
|
-
const DecimalFormatSymbols& symbols,
|
882
|
-
UErrorCode& status);
|
875
|
+
DecimalFormat(const UnicodeString& pattern, const DecimalFormatSymbols& symbols, UErrorCode& status);
|
883
876
|
|
884
877
|
/**
|
885
878
|
* Copy constructor.
|
@@ -901,7 +894,7 @@ public:
|
|
901
894
|
* Destructor.
|
902
895
|
* @stable ICU 2.0
|
903
896
|
*/
|
904
|
-
|
897
|
+
~DecimalFormat() U_OVERRIDE;
|
905
898
|
|
906
899
|
/**
|
907
900
|
* Clone this Format object polymorphically. The caller owns the
|
@@ -910,7 +903,7 @@ public:
|
|
910
903
|
* @return a polymorphic copy of this DecimalFormat.
|
911
904
|
* @stable ICU 2.0
|
912
905
|
*/
|
913
|
-
|
906
|
+
Format* clone(void) const U_OVERRIDE;
|
914
907
|
|
915
908
|
/**
|
916
909
|
* Return true if the given Format objects are semantically equal.
|
@@ -920,7 +913,7 @@ public:
|
|
920
913
|
* @return true if the given Format objects are semantically equal.
|
921
914
|
* @stable ICU 2.0
|
922
915
|
*/
|
923
|
-
|
916
|
+
UBool operator==(const Format& other) const U_OVERRIDE;
|
924
917
|
|
925
918
|
|
926
919
|
using NumberFormat::format;
|
@@ -936,11 +929,9 @@ public:
|
|
936
929
|
* @return Reference to 'appendTo' parameter.
|
937
930
|
* @stable ICU 2.0
|
938
931
|
*/
|
939
|
-
|
940
|
-
UnicodeString& appendTo,
|
941
|
-
FieldPosition& pos) const;
|
942
|
-
|
932
|
+
UnicodeString& format(double number, UnicodeString& appendTo, FieldPosition& pos) const U_OVERRIDE;
|
943
933
|
|
934
|
+
#ifndef U_HIDE_INTERNAL_API
|
944
935
|
/**
|
945
936
|
* Format a double or long number using base-10 representation.
|
946
937
|
*
|
@@ -953,10 +944,9 @@ public:
|
|
953
944
|
* @return Reference to 'appendTo' parameter.
|
954
945
|
* @internal
|
955
946
|
*/
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
UErrorCode &status) const;
|
947
|
+
UnicodeString& format(double number, UnicodeString& appendTo, FieldPosition& pos,
|
948
|
+
UErrorCode& status) const U_OVERRIDE;
|
949
|
+
#endif /* U_HIDE_INTERNAL_API */
|
960
950
|
|
961
951
|
/**
|
962
952
|
* Format a double or long number using base-10 representation.
|
@@ -971,10 +961,8 @@ public:
|
|
971
961
|
* @return Reference to 'appendTo' parameter.
|
972
962
|
* @stable ICU 4.4
|
973
963
|
*/
|
974
|
-
|
975
|
-
|
976
|
-
FieldPositionIterator* posIter,
|
977
|
-
UErrorCode& status) const;
|
964
|
+
UnicodeString& format(double number, UnicodeString& appendTo, FieldPositionIterator* posIter,
|
965
|
+
UErrorCode& status) const U_OVERRIDE;
|
978
966
|
|
979
967
|
/**
|
980
968
|
* Format a long number using base-10 representation.
|
@@ -987,10 +975,9 @@ public:
|
|
987
975
|
* @return Reference to 'appendTo' parameter.
|
988
976
|
* @stable ICU 2.0
|
989
977
|
*/
|
990
|
-
|
991
|
-
UnicodeString& appendTo,
|
992
|
-
FieldPosition& pos) const;
|
978
|
+
UnicodeString& format(int32_t number, UnicodeString& appendTo, FieldPosition& pos) const U_OVERRIDE;
|
993
979
|
|
980
|
+
#ifndef U_HIDE_INTERNAL_API
|
994
981
|
/**
|
995
982
|
* Format a long number using base-10 representation.
|
996
983
|
*
|
@@ -1002,10 +989,9 @@ public:
|
|
1002
989
|
* @return Reference to 'appendTo' parameter.
|
1003
990
|
* @internal
|
1004
991
|
*/
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
UErrorCode &status) const;
|
992
|
+
UnicodeString& format(int32_t number, UnicodeString& appendTo, FieldPosition& pos,
|
993
|
+
UErrorCode& status) const U_OVERRIDE;
|
994
|
+
#endif /* U_HIDE_INTERNAL_API */
|
1009
995
|
|
1010
996
|
/**
|
1011
997
|
* Format a long number using base-10 representation.
|
@@ -1020,10 +1006,8 @@ public:
|
|
1020
1006
|
* @return Reference to 'appendTo' parameter.
|
1021
1007
|
* @stable ICU 4.4
|
1022
1008
|
*/
|
1023
|
-
|
1024
|
-
|
1025
|
-
FieldPositionIterator* posIter,
|
1026
|
-
UErrorCode& status) const;
|
1009
|
+
UnicodeString& format(int32_t number, UnicodeString& appendTo, FieldPositionIterator* posIter,
|
1010
|
+
UErrorCode& status) const U_OVERRIDE;
|
1027
1011
|
|
1028
1012
|
/**
|
1029
1013
|
* Format an int64 number using base-10 representation.
|
@@ -1036,10 +1020,9 @@ public:
|
|
1036
1020
|
* @return Reference to 'appendTo' parameter.
|
1037
1021
|
* @stable ICU 2.8
|
1038
1022
|
*/
|
1039
|
-
|
1040
|
-
UnicodeString& appendTo,
|
1041
|
-
FieldPosition& pos) const;
|
1023
|
+
UnicodeString& format(int64_t number, UnicodeString& appendTo, FieldPosition& pos) const U_OVERRIDE;
|
1042
1024
|
|
1025
|
+
#ifndef U_HIDE_INTERNAL_API
|
1043
1026
|
/**
|
1044
1027
|
* Format an int64 number using base-10 representation.
|
1045
1028
|
*
|
@@ -1051,10 +1034,9 @@ public:
|
|
1051
1034
|
* @return Reference to 'appendTo' parameter.
|
1052
1035
|
* @internal
|
1053
1036
|
*/
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
UErrorCode &status) const;
|
1037
|
+
UnicodeString& format(int64_t number, UnicodeString& appendTo, FieldPosition& pos,
|
1038
|
+
UErrorCode& status) const U_OVERRIDE;
|
1039
|
+
#endif /* U_HIDE_INTERNAL_API */
|
1058
1040
|
|
1059
1041
|
/**
|
1060
1042
|
* Format an int64 number using base-10 representation.
|
@@ -1069,10 +1051,8 @@ public:
|
|
1069
1051
|
* @return Reference to 'appendTo' parameter.
|
1070
1052
|
* @stable ICU 4.4
|
1071
1053
|
*/
|
1072
|
-
|
1073
|
-
|
1074
|
-
FieldPositionIterator* posIter,
|
1075
|
-
UErrorCode& status) const;
|
1054
|
+
UnicodeString& format(int64_t number, UnicodeString& appendTo, FieldPositionIterator* posIter,
|
1055
|
+
UErrorCode& status) const U_OVERRIDE;
|
1076
1056
|
|
1077
1057
|
/**
|
1078
1058
|
* Format a decimal number.
|
@@ -1090,19 +1070,18 @@ public:
|
|
1090
1070
|
* @return Reference to 'appendTo' parameter.
|
1091
1071
|
* @stable ICU 4.4
|
1092
1072
|
*/
|
1093
|
-
|
1094
|
-
|
1095
|
-
FieldPositionIterator* posIter,
|
1096
|
-
UErrorCode& status) const;
|
1073
|
+
UnicodeString& format(StringPiece number, UnicodeString& appendTo, FieldPositionIterator* posIter,
|
1074
|
+
UErrorCode& status) const U_OVERRIDE;
|
1097
1075
|
|
1076
|
+
#ifndef U_HIDE_INTERNAL_API
|
1098
1077
|
|
1099
1078
|
/**
|
1100
1079
|
* Format a decimal number.
|
1101
|
-
* The number is a
|
1080
|
+
* The number is a DecimalQuantity wrapper onto a floating point decimal number.
|
1102
1081
|
* The default implementation in NumberFormat converts the decimal number
|
1103
1082
|
* to a double and formats that.
|
1104
1083
|
*
|
1105
|
-
* @param number The number, a
|
1084
|
+
* @param number The number, a DecimalQuantity format Decimal Floating Point.
|
1106
1085
|
* @param appendTo Output parameter to receive result.
|
1107
1086
|
* Result is appended to existing contents.
|
1108
1087
|
* @param posIter On return, can be used to iterate over positions
|
@@ -1111,14 +1090,16 @@ public:
|
|
1111
1090
|
* @return Reference to 'appendTo' parameter.
|
1112
1091
|
* @internal
|
1113
1092
|
*/
|
1114
|
-
|
1115
|
-
|
1116
|
-
FieldPositionIterator* posIter,
|
1117
|
-
UErrorCode& status) const;
|
1093
|
+
UnicodeString& format(const number::impl::DecimalQuantity& number, UnicodeString& appendTo,
|
1094
|
+
FieldPositionIterator* posIter, UErrorCode& status) const U_OVERRIDE;
|
1118
1095
|
|
1119
1096
|
/**
|
1120
1097
|
* Format a decimal number.
|
1121
|
-
*
|
1098
|
+
* The number is a DecimalQuantity wrapper onto a floating point decimal number.
|
1099
|
+
* The default implementation in NumberFormat converts the decimal number
|
1100
|
+
* to a double and formats that.
|
1101
|
+
*
|
1102
|
+
* @param number The number, a DecimalQuantity format Decimal Floating Point.
|
1122
1103
|
* @param appendTo Output parameter to receive result.
|
1123
1104
|
* Result is appended to existing contents.
|
1124
1105
|
* @param pos On input: an alignment field, if desired.
|
@@ -1127,73 +1108,34 @@ public:
|
|
1127
1108
|
* @return Reference to 'appendTo' parameter.
|
1128
1109
|
* @internal
|
1129
1110
|
*/
|
1130
|
-
|
1131
|
-
|
1132
|
-
UnicodeString& appendTo,
|
1133
|
-
FieldPosition& pos,
|
1134
|
-
UErrorCode& status) const;
|
1111
|
+
UnicodeString& format(const number::impl::DecimalQuantity& number, UnicodeString& appendTo,
|
1112
|
+
FieldPosition& pos, UErrorCode& status) const U_OVERRIDE;
|
1135
1113
|
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
* @param appendTo Output parameter to receive result.
|
1140
|
-
* Result is appended to existing contents.
|
1141
|
-
* @param posIter On return, can be used to iterate over positions
|
1142
|
-
* of fields generated by this format call.
|
1143
|
-
* @param status Output param filled with success/failure status.
|
1144
|
-
* @return Reference to 'appendTo' parameter.
|
1145
|
-
* @internal
|
1146
|
-
*/
|
1147
|
-
virtual UnicodeString& format(
|
1148
|
-
const VisibleDigitsWithExponent &number,
|
1149
|
-
UnicodeString& appendTo,
|
1150
|
-
FieldPositionIterator* posIter,
|
1151
|
-
UErrorCode& status) const;
|
1114
|
+
#endif // U_HIDE_INTERNAL_API
|
1115
|
+
|
1116
|
+
using NumberFormat::parse;
|
1152
1117
|
|
1153
1118
|
/**
|
1154
|
-
*
|
1155
|
-
*
|
1156
|
-
*
|
1157
|
-
*
|
1119
|
+
* Parse the given string using this object's choices. The method
|
1120
|
+
* does string comparisons to try to find an optimal match.
|
1121
|
+
* If no object can be parsed, index is unchanged, and NULL is
|
1122
|
+
* returned. The result is returned as the most parsimonious
|
1123
|
+
* type of Formattable that will accomodate all of the
|
1124
|
+
* necessary precision. For example, if the result is exactly 12,
|
1125
|
+
* it will be returned as a long. However, if it is 1.5, it will
|
1126
|
+
* be returned as a double.
|
1158
1127
|
*
|
1159
|
-
* @param
|
1160
|
-
* @param
|
1161
|
-
*
|
1162
|
-
* @param
|
1163
|
-
*
|
1164
|
-
*
|
1165
|
-
* @
|
1166
|
-
* @
|
1128
|
+
* @param text The text to be parsed.
|
1129
|
+
* @param result Formattable to be set to the parse result.
|
1130
|
+
* If parse fails, return contents are undefined.
|
1131
|
+
* @param parsePosition The position to start parsing at on input.
|
1132
|
+
* On output, moved to after the last successfully
|
1133
|
+
* parse character. On parse failure, does not change.
|
1134
|
+
* @see Formattable
|
1135
|
+
* @stable ICU 2.0
|
1167
1136
|
*/
|
1168
|
-
|
1169
|
-
|
1170
|
-
FieldPosition& pos,
|
1171
|
-
UErrorCode& status) const;
|
1172
|
-
|
1173
|
-
using NumberFormat::parse;
|
1174
|
-
|
1175
|
-
/**
|
1176
|
-
* Parse the given string using this object's choices. The method
|
1177
|
-
* does string comparisons to try to find an optimal match.
|
1178
|
-
* If no object can be parsed, index is unchanged, and NULL is
|
1179
|
-
* returned. The result is returned as the most parsimonious
|
1180
|
-
* type of Formattable that will accomodate all of the
|
1181
|
-
* necessary precision. For example, if the result is exactly 12,
|
1182
|
-
* it will be returned as a long. However, if it is 1.5, it will
|
1183
|
-
* be returned as a double.
|
1184
|
-
*
|
1185
|
-
* @param text The text to be parsed.
|
1186
|
-
* @param result Formattable to be set to the parse result.
|
1187
|
-
* If parse fails, return contents are undefined.
|
1188
|
-
* @param parsePosition The position to start parsing at on input.
|
1189
|
-
* On output, moved to after the last successfully
|
1190
|
-
* parse character. On parse failure, does not change.
|
1191
|
-
* @see Formattable
|
1192
|
-
* @stable ICU 2.0
|
1193
|
-
*/
|
1194
|
-
virtual void parse(const UnicodeString& text,
|
1195
|
-
Formattable& result,
|
1196
|
-
ParsePosition& parsePosition) const;
|
1137
|
+
void parse(const UnicodeString& text, Formattable& result,
|
1138
|
+
ParsePosition& parsePosition) const U_OVERRIDE;
|
1197
1139
|
|
1198
1140
|
/**
|
1199
1141
|
* Parses text from the given string as a currency amount. Unlike
|
@@ -1214,8 +1156,7 @@ public:
|
|
1214
1156
|
* the parsed currency; if parse fails, this is NULL.
|
1215
1157
|
* @stable ICU 49
|
1216
1158
|
*/
|
1217
|
-
|
1218
|
-
ParsePosition& pos) const;
|
1159
|
+
CurrencyAmount* parseCurrency(const UnicodeString& text, ParsePosition& pos) const U_OVERRIDE;
|
1219
1160
|
|
1220
1161
|
/**
|
1221
1162
|
* Returns the decimal format symbols, which is generally not changed
|
@@ -1344,12 +1285,29 @@ public:
|
|
1344
1285
|
*/
|
1345
1286
|
virtual void setNegativeSuffix(const UnicodeString& newValue);
|
1346
1287
|
|
1288
|
+
#ifndef U_HIDE_INTERNAL_API
|
1289
|
+
/**
|
1290
|
+
* Whether to show the plus sign on positive (non-negative) numbers; for example, "+12"
|
1291
|
+
* @internal Technical Preview
|
1292
|
+
*/
|
1293
|
+
UBool isSignAlwaysShown() const;
|
1294
|
+
#endif /* U_HIDE_INTERNAL_API */
|
1295
|
+
|
1296
|
+
/**
|
1297
|
+
* Set whether to show the plus sign on positive (non-negative) numbers; for example, "+12"
|
1298
|
+
* @param value The new setting for whether to show plus sign on positive numbers
|
1299
|
+
* @internal Technical Preview
|
1300
|
+
*/
|
1301
|
+
virtual void setSignAlwaysShown(UBool value);
|
1302
|
+
|
1347
1303
|
/**
|
1348
1304
|
* Get the multiplier for use in percent, permill, etc.
|
1349
1305
|
* For a percentage, set the suffixes to have "%" and the multiplier to be 100.
|
1350
1306
|
* (For Arabic, use arabic percent symbol).
|
1351
1307
|
* For a permill, set the suffixes to have "\\u2031" and the multiplier to be 1000.
|
1352
1308
|
*
|
1309
|
+
* The number may also be multiplied by a power of ten; see getMultiplierScale().
|
1310
|
+
*
|
1353
1311
|
* @return the multiplier for use in percent, permill, etc.
|
1354
1312
|
* Examples: with 100, 1.23 -> "123", and "123" -> 1.23
|
1355
1313
|
* @stable ICU 2.0
|
@@ -1362,12 +1320,52 @@ public:
|
|
1362
1320
|
* (For Arabic, use arabic percent symbol).
|
1363
1321
|
* For a permill, set the suffixes to have "\\u2031" and the multiplier to be 1000.
|
1364
1322
|
*
|
1323
|
+
* This method only supports integer multipliers. To multiply by a non-integer, pair this
|
1324
|
+
* method with setMultiplierScale().
|
1325
|
+
*
|
1365
1326
|
* @param newValue the new value of the multiplier for use in percent, permill, etc.
|
1366
1327
|
* Examples: with 100, 1.23 -> "123", and "123" -> 1.23
|
1367
1328
|
* @stable ICU 2.0
|
1368
1329
|
*/
|
1369
1330
|
virtual void setMultiplier(int32_t newValue);
|
1370
1331
|
|
1332
|
+
#ifndef U_HIDE_DRAFT_API
|
1333
|
+
/**
|
1334
|
+
* Gets the power of ten by which number should be multiplied before formatting, which
|
1335
|
+
* can be combined with setMultiplier() to multiply by any arbitrary decimal value.
|
1336
|
+
*
|
1337
|
+
* A multiplier scale of 2 corresponds to multiplication by 100, and a multiplier scale
|
1338
|
+
* of -2 corresponds to multiplication by 0.01.
|
1339
|
+
*
|
1340
|
+
* This method is analogous to UNUM_SCALE in getAttribute.
|
1341
|
+
*
|
1342
|
+
* @return the current value of the power-of-ten multiplier.
|
1343
|
+
* @draft ICU 62
|
1344
|
+
*/
|
1345
|
+
int32_t getMultiplierScale(void) const;
|
1346
|
+
#endif /* U_HIDE_DRAFT_API */
|
1347
|
+
|
1348
|
+
/**
|
1349
|
+
* Sets a power of ten by which number should be multiplied before formatting, which
|
1350
|
+
* can be combined with setMultiplier() to multiply by any arbitrary decimal value.
|
1351
|
+
*
|
1352
|
+
* A multiplier scale of 2 corresponds to multiplication by 100, and a multiplier scale
|
1353
|
+
* of -2 corresponds to multiplication by 0.01.
|
1354
|
+
*
|
1355
|
+
* For example, to multiply numbers by 0.5 before formatting, you can do:
|
1356
|
+
*
|
1357
|
+
* <pre>
|
1358
|
+
* df.setMultiplier(5);
|
1359
|
+
* df.setMultiplierScale(-1);
|
1360
|
+
* </pre>
|
1361
|
+
*
|
1362
|
+
* This method is analogous to UNUM_SCALE in setAttribute.
|
1363
|
+
*
|
1364
|
+
* @param newValue the new value of the power-of-ten multiplier.
|
1365
|
+
* @draft ICU 62
|
1366
|
+
*/
|
1367
|
+
virtual void setMultiplierScale(int32_t newValue);
|
1368
|
+
|
1371
1369
|
/**
|
1372
1370
|
* Get the rounding increment.
|
1373
1371
|
* @return A positive rounding increment, or 0.0 if a custom rounding
|
@@ -1400,7 +1398,7 @@ public:
|
|
1400
1398
|
* @see #setRoundingMode
|
1401
1399
|
* @stable ICU 2.0
|
1402
1400
|
*/
|
1403
|
-
virtual ERoundingMode getRoundingMode(void) const;
|
1401
|
+
virtual ERoundingMode getRoundingMode(void) const U_OVERRIDE;
|
1404
1402
|
|
1405
1403
|
/**
|
1406
1404
|
* Set the rounding mode.
|
@@ -1410,7 +1408,7 @@ public:
|
|
1410
1408
|
* @see #getRoundingMode
|
1411
1409
|
* @stable ICU 2.0
|
1412
1410
|
*/
|
1413
|
-
virtual void setRoundingMode(ERoundingMode roundingMode);
|
1411
|
+
virtual void setRoundingMode(ERoundingMode roundingMode) U_OVERRIDE;
|
1414
1412
|
|
1415
1413
|
/**
|
1416
1414
|
* Get the width to which the output of format() is padded.
|
@@ -1469,7 +1467,7 @@ public:
|
|
1469
1467
|
* @see #setPadPosition
|
1470
1468
|
* @stable ICU 2.0
|
1471
1469
|
*/
|
1472
|
-
virtual void setPadCharacter(const UnicodeString
|
1470
|
+
virtual void setPadCharacter(const UnicodeString& padChar);
|
1473
1471
|
|
1474
1472
|
/**
|
1475
1473
|
* Get the position at which padding will take place. This is the location
|
@@ -1676,7 +1674,7 @@ public:
|
|
1676
1674
|
|
1677
1675
|
#endif /* U_HIDE_INTERNAL_API */
|
1678
1676
|
|
1679
|
-
|
1677
|
+
/* Cannot use #ifndef U_HIDE_INTERNAL_API for the following draft method since it is virtual. */
|
1680
1678
|
/**
|
1681
1679
|
* Sets the minimum grouping digits. Setting to a value less than or
|
1682
1680
|
* equal to 1 turns off minimum grouping digits.
|
@@ -1717,7 +1715,7 @@ public:
|
|
1717
1715
|
UBool isDecimalPatternMatchRequired(void) const;
|
1718
1716
|
|
1719
1717
|
/**
|
1720
|
-
* Allows you to set the behavior of the pattern decimal mark.
|
1718
|
+
* Allows you to set the parse behavior of the pattern decimal mark.
|
1721
1719
|
*
|
1722
1720
|
* if TRUE, the input must have a decimal mark if one was specified in the pattern. When
|
1723
1721
|
* FALSE the decimal mark may be omitted from the input.
|
@@ -1727,6 +1725,60 @@ public:
|
|
1727
1725
|
*/
|
1728
1726
|
virtual void setDecimalPatternMatchRequired(UBool newValue);
|
1729
1727
|
|
1728
|
+
/**
|
1729
|
+
* {@icu} Returns whether to ignore exponents when parsing.
|
1730
|
+
*
|
1731
|
+
* @see #setParseNoExponent
|
1732
|
+
* @internal This API is a technical preview. It may change in an upcoming release.
|
1733
|
+
*/
|
1734
|
+
virtual UBool isParseNoExponent() const;
|
1735
|
+
|
1736
|
+
/**
|
1737
|
+
* {@icu} Specifies whether to stop parsing when an exponent separator is encountered. For
|
1738
|
+
* example, parses "123E4" to 123 (with parse position 3) instead of 1230000 (with parse position
|
1739
|
+
* 5).
|
1740
|
+
*
|
1741
|
+
* @param value true to prevent exponents from being parsed; false to allow them to be parsed.
|
1742
|
+
* @internal This API is a technical preview. It may change in an upcoming release.
|
1743
|
+
*/
|
1744
|
+
virtual void setParseNoExponent(UBool value);
|
1745
|
+
|
1746
|
+
/**
|
1747
|
+
* {@icu} Returns whether parsing is sensitive to case (lowercase/uppercase).
|
1748
|
+
*
|
1749
|
+
* @see #setParseCaseSensitive
|
1750
|
+
* @internal This API is a technical preview. It may change in an upcoming release.
|
1751
|
+
*/
|
1752
|
+
virtual UBool isParseCaseSensitive() const;
|
1753
|
+
|
1754
|
+
/**
|
1755
|
+
* {@icu} Whether to pay attention to case when parsing; default is to ignore case (perform
|
1756
|
+
* case-folding). For example, "A" == "a" in case-insensitive but not case-sensitive mode.
|
1757
|
+
*
|
1758
|
+
* Currency symbols are never case-folded. For example, "us$1.00" will not parse in case-insensitive
|
1759
|
+
* mode, even though "US$1.00" parses.
|
1760
|
+
*
|
1761
|
+
* @internal This API is a technical preview. It may change in an upcoming release.
|
1762
|
+
*/
|
1763
|
+
virtual void setParseCaseSensitive(UBool value);
|
1764
|
+
|
1765
|
+
/**
|
1766
|
+
* {@icu} Returns whether truncation of high-order integer digits should result in an error.
|
1767
|
+
* By default, setMaximumIntegerDigits truncates high-order digits silently.
|
1768
|
+
*
|
1769
|
+
* @see setFormatFailIfMoreThanMaxDigits
|
1770
|
+
* @internal This API is a technical preview. It may change in an upcoming release.
|
1771
|
+
*/
|
1772
|
+
virtual UBool isFormatFailIfMoreThanMaxDigits() const;
|
1773
|
+
|
1774
|
+
/**
|
1775
|
+
* {@icu} Sets whether truncation of high-order integer digits should result in an error.
|
1776
|
+
* By default, setMaximumIntegerDigits truncates high-order digits silently.
|
1777
|
+
*
|
1778
|
+
* @internal This API is a technical preview. It may change in an upcoming release.
|
1779
|
+
*/
|
1780
|
+
virtual void setFormatFailIfMoreThanMaxDigits(UBool value);
|
1781
|
+
|
1730
1782
|
|
1731
1783
|
/**
|
1732
1784
|
* Synthesizes a pattern string that represents the current state
|
@@ -1781,9 +1833,8 @@ public:
|
|
1781
1833
|
* set to a failure result.
|
1782
1834
|
* @stable ICU 2.0
|
1783
1835
|
*/
|
1784
|
-
virtual void applyPattern(const UnicodeString& pattern,
|
1785
|
-
|
1786
|
-
UErrorCode& status);
|
1836
|
+
virtual void applyPattern(const UnicodeString& pattern, UParseError& parseError, UErrorCode& status);
|
1837
|
+
|
1787
1838
|
/**
|
1788
1839
|
* Sets the pattern.
|
1789
1840
|
* @param pattern The pattern to be applied.
|
@@ -1792,8 +1843,7 @@ public:
|
|
1792
1843
|
* set to a failure result.
|
1793
1844
|
* @stable ICU 2.0
|
1794
1845
|
*/
|
1795
|
-
virtual void applyPattern(const UnicodeString& pattern,
|
1796
|
-
UErrorCode& status);
|
1846
|
+
virtual void applyPattern(const UnicodeString& pattern, UErrorCode& status);
|
1797
1847
|
|
1798
1848
|
/**
|
1799
1849
|
* Apply the given pattern to this Format object. The pattern
|
@@ -1825,8 +1875,7 @@ public:
|
|
1825
1875
|
* set to a failure result.
|
1826
1876
|
* @stable ICU 2.0
|
1827
1877
|
*/
|
1828
|
-
virtual void applyLocalizedPattern(const UnicodeString& pattern,
|
1829
|
-
UParseError& parseError,
|
1878
|
+
virtual void applyLocalizedPattern(const UnicodeString& pattern, UParseError& parseError,
|
1830
1879
|
UErrorCode& status);
|
1831
1880
|
|
1832
1881
|
/**
|
@@ -1838,8 +1887,7 @@ public:
|
|
1838
1887
|
* set to a failure result.
|
1839
1888
|
* @stable ICU 2.0
|
1840
1889
|
*/
|
1841
|
-
virtual void applyLocalizedPattern(const UnicodeString& pattern,
|
1842
|
-
UErrorCode& status);
|
1890
|
+
virtual void applyLocalizedPattern(const UnicodeString& pattern, UErrorCode& status);
|
1843
1891
|
|
1844
1892
|
|
1845
1893
|
/**
|
@@ -1851,7 +1899,7 @@ public:
|
|
1851
1899
|
* @see NumberFormat#setMaximumIntegerDigits
|
1852
1900
|
* @stable ICU 2.0
|
1853
1901
|
*/
|
1854
|
-
|
1902
|
+
void setMaximumIntegerDigits(int32_t newValue) U_OVERRIDE;
|
1855
1903
|
|
1856
1904
|
/**
|
1857
1905
|
* Sets the minimum number of digits allowed in the integer portion of a
|
@@ -1862,7 +1910,7 @@ public:
|
|
1862
1910
|
* @see NumberFormat#setMinimumIntegerDigits
|
1863
1911
|
* @stable ICU 2.0
|
1864
1912
|
*/
|
1865
|
-
|
1913
|
+
void setMinimumIntegerDigits(int32_t newValue) U_OVERRIDE;
|
1866
1914
|
|
1867
1915
|
/**
|
1868
1916
|
* Sets the maximum number of digits allowed in the fraction portion of a
|
@@ -1873,7 +1921,7 @@ public:
|
|
1873
1921
|
* @see NumberFormat#setMaximumFractionDigits
|
1874
1922
|
* @stable ICU 2.0
|
1875
1923
|
*/
|
1876
|
-
|
1924
|
+
void setMaximumFractionDigits(int32_t newValue) U_OVERRIDE;
|
1877
1925
|
|
1878
1926
|
/**
|
1879
1927
|
* Sets the minimum number of digits allowed in the fraction portion of a
|
@@ -1884,7 +1932,7 @@ public:
|
|
1884
1932
|
* @see NumberFormat#setMinimumFractionDigits
|
1885
1933
|
* @stable ICU 2.0
|
1886
1934
|
*/
|
1887
|
-
|
1935
|
+
void setMinimumFractionDigits(int32_t newValue) U_OVERRIDE;
|
1888
1936
|
|
1889
1937
|
/**
|
1890
1938
|
* Returns the minimum number of significant digits that will be
|
@@ -1947,7 +1995,6 @@ public:
|
|
1947
1995
|
*/
|
1948
1996
|
void setSignificantDigitsUsed(UBool useSignificantDigits);
|
1949
1997
|
|
1950
|
-
public:
|
1951
1998
|
/**
|
1952
1999
|
* Sets the currency used to display currency
|
1953
2000
|
* amounts. This takes effect immediately, if this format is a
|
@@ -1960,7 +2007,7 @@ public:
|
|
1960
2007
|
* @param ec input-output error code
|
1961
2008
|
* @stable ICU 3.0
|
1962
2009
|
*/
|
1963
|
-
|
2010
|
+
void setCurrency(const char16_t* theCurrency, UErrorCode& ec) U_OVERRIDE;
|
1964
2011
|
|
1965
2012
|
/**
|
1966
2013
|
* Sets the currency used to display currency amounts. See
|
@@ -1984,78 +2031,53 @@ public:
|
|
1984
2031
|
*/
|
1985
2032
|
UCurrencyUsage getCurrencyUsage() const;
|
1986
2033
|
|
1987
|
-
|
1988
|
-
#ifndef U_HIDE_DEPRECATED_API
|
1989
|
-
/**
|
1990
|
-
* The resource tags we use to retrieve decimal format data from
|
1991
|
-
* locale resource bundles.
|
1992
|
-
* @deprecated ICU 3.4. This string has no public purpose. Please don't use it.
|
1993
|
-
*/
|
1994
|
-
static const char fgNumberPatterns[];
|
1995
|
-
#endif // U_HIDE_DEPRECATED_API
|
1996
|
-
|
1997
2034
|
#ifndef U_HIDE_INTERNAL_API
|
1998
|
-
/**
|
1999
|
-
* Get a FixedDecimal corresponding to a double as it would be
|
2000
|
-
* formatted by this DecimalFormat.
|
2001
|
-
* Internal, not intended for public use.
|
2002
|
-
* @internal
|
2003
|
-
*/
|
2004
|
-
FixedDecimal getFixedDecimal(double number, UErrorCode &status) const;
|
2005
|
-
|
2006
|
-
/**
|
2007
|
-
* Get a FixedDecimal corresponding to a formattable as it would be
|
2008
|
-
* formatted by this DecimalFormat.
|
2009
|
-
* Internal, not intended for public use.
|
2010
|
-
* @internal
|
2011
|
-
*/
|
2012
|
-
FixedDecimal getFixedDecimal(const Formattable &number, UErrorCode &status) const;
|
2013
2035
|
|
2014
2036
|
/**
|
2015
|
-
*
|
2016
|
-
* formatted by this DecimalFormat. Note: the DigitList may be modified.
|
2037
|
+
* Format a number and save it into the given DecimalQuantity.
|
2017
2038
|
* Internal, not intended for public use.
|
2018
2039
|
* @internal
|
2019
2040
|
*/
|
2020
|
-
|
2041
|
+
void formatToDecimalQuantity(double number, number::impl::DecimalQuantity& output,
|
2042
|
+
UErrorCode& status) const;
|
2021
2043
|
|
2022
2044
|
/**
|
2023
|
-
* Get a
|
2024
|
-
*
|
2045
|
+
* Get a DecimalQuantity corresponding to a formattable as it would be
|
2046
|
+
* formatted by this DecimalFormat.
|
2025
2047
|
* Internal, not intended for public use.
|
2026
2048
|
* @internal
|
2027
2049
|
*/
|
2028
|
-
|
2029
|
-
|
2030
|
-
VisibleDigitsWithExponent &digits,
|
2031
|
-
UErrorCode &status) const;
|
2050
|
+
void formatToDecimalQuantity(const Formattable& number, number::impl::DecimalQuantity& output,
|
2051
|
+
UErrorCode& status) const;
|
2032
2052
|
|
2033
|
-
|
2034
|
-
* Get a VisibleDigitsWithExponent corresponding to a formattable
|
2035
|
-
* as it would be formatted by this DecimalFormat.
|
2036
|
-
* Internal, not intended for public use.
|
2037
|
-
* @internal
|
2038
|
-
*/
|
2039
|
-
VisibleDigitsWithExponent &initVisibleDigitsWithExponent(
|
2040
|
-
const Formattable &number,
|
2041
|
-
VisibleDigitsWithExponent &digits,
|
2042
|
-
UErrorCode &status) const;
|
2053
|
+
#endif
|
2043
2054
|
|
2055
|
+
#ifndef U_HIDE_DRAFT_API
|
2044
2056
|
/**
|
2045
|
-
*
|
2046
|
-
*
|
2047
|
-
*
|
2048
|
-
*
|
2049
|
-
*
|
2057
|
+
* Converts this DecimalFormat to a NumberFormatter. Starting in ICU 60,
|
2058
|
+
* NumberFormatter is the recommended way to format numbers.
|
2059
|
+
*
|
2060
|
+
* NOTE: The returned LocalizedNumberFormatter is owned by this DecimalFormat.
|
2061
|
+
* If a non-const method is called on the DecimalFormat, or if the DecimalFormat
|
2062
|
+
* is deleted, the object becomes invalid. If you plan to keep the return value
|
2063
|
+
* beyond the lifetime of the DecimalFormat, copy it to a local variable:
|
2064
|
+
*
|
2065
|
+
* <pre>
|
2066
|
+
* LocalizedNumberFormatter f = df->toNumberFormatter();
|
2067
|
+
* </pre>
|
2068
|
+
*
|
2069
|
+
* It is, however, safe to use the return value for chaining:
|
2070
|
+
*
|
2071
|
+
* <pre>
|
2072
|
+
* FormattedNumber result = df->toNumberFormatter().formatDouble(123, status);
|
2073
|
+
* </pre>
|
2074
|
+
*
|
2075
|
+
* @param output The variable into which to store the LocalizedNumberFormatter.
|
2076
|
+
* @return The output variable, for chaining.
|
2077
|
+
* @draft ICU 62
|
2050
2078
|
*/
|
2051
|
-
|
2052
|
-
|
2053
|
-
VisibleDigitsWithExponent &digits,
|
2054
|
-
UErrorCode &status) const;
|
2055
|
-
|
2056
|
-
#endif /* U_HIDE_INTERNAL_API */
|
2057
|
-
|
2058
|
-
public:
|
2079
|
+
const number::LocalizedNumberFormatter& toNumberFormatter() const;
|
2080
|
+
#endif /* U_HIDE_DRAFT_API */
|
2059
2081
|
|
2060
2082
|
/**
|
2061
2083
|
* Return the class ID for this class. This is useful only for
|
@@ -2081,217 +2103,57 @@ public:
|
|
2081
2103
|
* other classes have different class IDs.
|
2082
2104
|
* @stable ICU 2.0
|
2083
2105
|
*/
|
2084
|
-
|
2085
|
-
|
2086
|
-
private:
|
2087
|
-
|
2088
|
-
DecimalFormat(); // default constructor not implemented
|
2089
|
-
|
2090
|
-
/**
|
2091
|
-
* Initialize all fields of a new DecimalFormatter to a safe default value.
|
2092
|
-
* Common code for use by constructors.
|
2093
|
-
*/
|
2094
|
-
void init();
|
2095
|
-
|
2096
|
-
/**
|
2097
|
-
* Do real work of constructing a new DecimalFormat.
|
2098
|
-
*/
|
2099
|
-
void construct(UErrorCode& status,
|
2100
|
-
UParseError& parseErr,
|
2101
|
-
const UnicodeString* pattern = 0,
|
2102
|
-
DecimalFormatSymbols* symbolsToAdopt = 0
|
2103
|
-
);
|
2104
|
-
|
2105
|
-
void handleCurrencySignInPattern(UErrorCode& status);
|
2106
|
-
|
2107
|
-
void parse(const UnicodeString& text,
|
2108
|
-
Formattable& result,
|
2109
|
-
ParsePosition& pos,
|
2110
|
-
char16_t* currency) const;
|
2111
|
-
|
2112
|
-
enum {
|
2113
|
-
fgStatusInfinite,
|
2114
|
-
fgStatusLength // Leave last in list.
|
2115
|
-
} StatusFlags;
|
2116
|
-
|
2117
|
-
UBool subparse(const UnicodeString& text,
|
2118
|
-
const UnicodeString* negPrefix,
|
2119
|
-
const UnicodeString* negSuffix,
|
2120
|
-
const UnicodeString* posPrefix,
|
2121
|
-
const UnicodeString* posSuffix,
|
2122
|
-
UBool complexCurrencyParsing,
|
2123
|
-
int8_t type,
|
2124
|
-
ParsePosition& parsePosition,
|
2125
|
-
DigitList& digits, UBool* status,
|
2126
|
-
char16_t* currency) const;
|
2127
|
-
|
2128
|
-
// Mixed style parsing for currency.
|
2129
|
-
// It parses against the current currency pattern
|
2130
|
-
// using complex affix comparison
|
2131
|
-
// parses against the currency plural patterns using complex affix comparison,
|
2132
|
-
// and parses against the current pattern using simple affix comparison.
|
2133
|
-
UBool parseForCurrency(const UnicodeString& text,
|
2134
|
-
ParsePosition& parsePosition,
|
2135
|
-
DigitList& digits,
|
2136
|
-
UBool* status,
|
2137
|
-
char16_t* currency) const;
|
2138
|
-
|
2139
|
-
int32_t skipPadding(const UnicodeString& text, int32_t position) const;
|
2140
|
-
|
2141
|
-
int32_t compareAffix(const UnicodeString& input,
|
2142
|
-
int32_t pos,
|
2143
|
-
UBool isNegative,
|
2144
|
-
UBool isPrefix,
|
2145
|
-
const UnicodeString* affixPat,
|
2146
|
-
UBool complexCurrencyParsing,
|
2147
|
-
int8_t type,
|
2148
|
-
char16_t* currency) const;
|
2149
|
-
|
2150
|
-
static UnicodeString& trimMarksFromAffix(const UnicodeString& affix, UnicodeString& trimmedAffix);
|
2151
|
-
|
2152
|
-
UBool equalWithSignCompatibility(UChar32 lhs, UChar32 rhs) const;
|
2153
|
-
|
2154
|
-
int32_t compareSimpleAffix(const UnicodeString& affix,
|
2155
|
-
const UnicodeString& input,
|
2156
|
-
int32_t pos,
|
2157
|
-
UBool lenient) const;
|
2158
|
-
|
2159
|
-
static int32_t skipPatternWhiteSpace(const UnicodeString& text, int32_t pos);
|
2160
|
-
|
2161
|
-
static int32_t skipUWhiteSpace(const UnicodeString& text, int32_t pos);
|
2162
|
-
|
2163
|
-
static int32_t skipUWhiteSpaceAndMarks(const UnicodeString& text, int32_t pos);
|
2164
|
-
|
2165
|
-
static int32_t skipBidiMarks(const UnicodeString& text, int32_t pos);
|
2166
|
-
|
2167
|
-
int32_t compareComplexAffix(const UnicodeString& affixPat,
|
2168
|
-
const UnicodeString& input,
|
2169
|
-
int32_t pos,
|
2170
|
-
int8_t type,
|
2171
|
-
char16_t* currency) const;
|
2172
|
-
|
2173
|
-
static int32_t match(const UnicodeString& text, int32_t pos, UChar32 ch);
|
2106
|
+
UClassID getDynamicClassID(void) const U_OVERRIDE;
|
2174
2107
|
|
2175
|
-
|
2108
|
+
private:
|
2176
2109
|
|
2177
|
-
|
2178
|
-
|
2110
|
+
/** Rebuilds the formatter object from the property bag. */
|
2111
|
+
void touch(UErrorCode& status);
|
2179
2112
|
|
2180
|
-
|
2181
|
-
|
2182
|
-
const UnicodeSet *sset, UChar32 schar);
|
2183
|
-
|
2184
|
-
static UBool matchGrouping(UChar32 groupingChar,
|
2185
|
-
UBool sawGrouping, UChar32 sawGroupingChar,
|
2186
|
-
const UnicodeSet *sset,
|
2187
|
-
UChar32 decimalChar, const UnicodeSet *decimalSet,
|
2188
|
-
UChar32 schar);
|
2189
|
-
|
2190
|
-
// set up currency affix patterns for mix parsing.
|
2191
|
-
// The patterns saved here are the affix patterns of default currency
|
2192
|
-
// pattern and the unique affix patterns of the plural currency patterns.
|
2193
|
-
// Those patterns are used by parseForCurrency().
|
2194
|
-
void setupCurrencyAffixPatterns(UErrorCode& status);
|
2195
|
-
|
2196
|
-
// get the currency rounding with respect to currency usage
|
2197
|
-
double getCurrencyRounding(const char16_t* currency,
|
2198
|
-
UErrorCode* ec) const;
|
2199
|
-
|
2200
|
-
// get the currency fraction with respect to currency usage
|
2201
|
-
int getCurrencyFractionDigits(const char16_t* currency,
|
2202
|
-
UErrorCode* ec) const;
|
2203
|
-
|
2204
|
-
// hashtable operations
|
2205
|
-
Hashtable* initHashForAffixPattern(UErrorCode& status);
|
2206
|
-
|
2207
|
-
void deleteHashForAffixPattern();
|
2208
|
-
|
2209
|
-
void copyHashForAffixPattern(const Hashtable* source,
|
2210
|
-
Hashtable* target, UErrorCode& status);
|
2211
|
-
|
2212
|
-
DecimalFormatImpl *fImpl;
|
2113
|
+
/** Rebuilds the formatter object, hiding the error code. */
|
2114
|
+
void touchNoError();
|
2213
2115
|
|
2214
2116
|
/**
|
2215
|
-
*
|
2117
|
+
* Updates the property bag with settings from the given pattern.
|
2118
|
+
*
|
2119
|
+
* @param pattern The pattern string to parse.
|
2120
|
+
* @param ignoreRounding Whether to leave out rounding information (minFrac, maxFrac, and rounding
|
2121
|
+
* increment) when parsing the pattern. This may be desirable if a custom rounding mode, such
|
2122
|
+
* as CurrencyUsage, is to be used instead. One of {@link
|
2123
|
+
* PatternStringParser#IGNORE_ROUNDING_ALWAYS}, {@link PatternStringParser#IGNORE_ROUNDING_IF_CURRENCY},
|
2124
|
+
* or {@link PatternStringParser#IGNORE_ROUNDING_NEVER}.
|
2125
|
+
* @see PatternAndPropertyUtils#parseToExistingProperties
|
2216
2126
|
*/
|
2127
|
+
void setPropertiesFromPattern(const UnicodeString& pattern, int32_t ignoreRounding,
|
2128
|
+
UErrorCode& status);
|
2217
2129
|
|
2130
|
+
const numparse::impl::NumberParserImpl* getParser(UErrorCode& status) const;
|
2218
2131
|
|
2219
|
-
|
2220
|
-
UNUM_MAX_NONBOOLEAN_ATTRIBUTE+1,
|
2221
|
-
UNUM_LIMIT_BOOLEAN_ATTRIBUTE>
|
2222
|
-
fBoolFlags;
|
2132
|
+
const numparse::impl::NumberParserImpl* getCurrencyParser(UErrorCode& status) const;
|
2223
2133
|
|
2134
|
+
static void fieldPositionHelper(const number::FormattedNumber& formatted, FieldPosition& fieldPosition,
|
2135
|
+
int32_t offset, UErrorCode& status);
|
2224
2136
|
|
2225
|
-
|
2226
|
-
|
2227
|
-
int fStyle;
|
2137
|
+
static void fieldPositionIteratorHelper(const number::FormattedNumber& formatted,
|
2138
|
+
FieldPositionIterator* fpi, int32_t offset, UErrorCode& status);
|
2228
2139
|
|
2140
|
+
void setupFastFormat();
|
2229
2141
|
|
2230
|
-
|
2231
|
-
// It is a set of AffixPatternsForCurrency,
|
2232
|
-
// each element of the set saves the negative prefix pattern,
|
2233
|
-
// negative suffix pattern, positive prefix pattern,
|
2234
|
-
// and positive suffix pattern of a pattern.
|
2235
|
-
// It is used for currency mixed style parsing.
|
2236
|
-
// It is actually is a set.
|
2237
|
-
// The set contains the default currency pattern from the locale,
|
2238
|
-
// and the currency plural patterns.
|
2239
|
-
// Since it is a set, it does not contain duplicated items.
|
2240
|
-
// For example, if 2 currency plural patterns are the same, only one pattern
|
2241
|
-
// is included in the set. When parsing, we do not check whether the plural
|
2242
|
-
// count match or not.
|
2243
|
-
Hashtable* fAffixPatternsForCurrency;
|
2142
|
+
bool fastFormatDouble(double input, UnicodeString& output) const;
|
2244
2143
|
|
2245
|
-
|
2246
|
-
CurrencyPluralInfo* fCurrencyPluralInfo;
|
2144
|
+
bool fastFormatInt64(int64_t input, UnicodeString& output) const;
|
2247
2145
|
|
2248
|
-
|
2249
|
-
UNumberFormatAttributeValue fParseAllInput;
|
2250
|
-
#endif
|
2146
|
+
void doFastFormatInt32(int32_t input, bool isNegative, UnicodeString& output) const;
|
2251
2147
|
|
2252
|
-
|
2253
|
-
|
2148
|
+
//=====================================================================================//
|
2149
|
+
// INSTANCE FIELDS //
|
2150
|
+
//=====================================================================================//
|
2254
2151
|
|
2255
|
-
|
2152
|
+
// Only one instance field: keep all fields inside of an implementation class defined in number_mapper.h
|
2153
|
+
number::impl::DecimalFormatFields* fields;
|
2256
2154
|
|
2257
|
-
|
2258
|
-
|
2259
|
-
* Rounds a value according to the rules of this object.
|
2260
|
-
* @internal
|
2261
|
-
*/
|
2262
|
-
DigitList& _round(const DigitList& number, DigitList& adjustedNum, UBool& isNegative, UErrorCode& status) const;
|
2263
|
-
#endif /* U_HIDE_INTERNAL_API */
|
2264
|
-
|
2265
|
-
/**
|
2266
|
-
* Returns the currency in effect for this formatter. Subclasses
|
2267
|
-
* should override this method as needed. Unlike getCurrency(),
|
2268
|
-
* this method should never return "".
|
2269
|
-
* @result output parameter for null-terminated result, which must
|
2270
|
-
* have a capacity of at least 4
|
2271
|
-
* @internal
|
2272
|
-
*/
|
2273
|
-
virtual void getEffectiveCurrency(char16_t* result, UErrorCode& ec) const;
|
2274
|
-
|
2275
|
-
/** number of integer digits
|
2276
|
-
* @stable ICU 2.4
|
2277
|
-
*/
|
2278
|
-
static const int32_t kDoubleIntegerDigits;
|
2279
|
-
/** number of fraction digits
|
2280
|
-
* @stable ICU 2.4
|
2281
|
-
*/
|
2282
|
-
static const int32_t kDoubleFractionDigits;
|
2283
|
-
|
2284
|
-
/**
|
2285
|
-
* When someone turns on scientific mode, we assume that more than this
|
2286
|
-
* number of digits is due to flipping from some other mode that didn't
|
2287
|
-
* restrict the maximum, and so we force 1 integer digit. We don't bother
|
2288
|
-
* to track and see if someone is using exponential notation with more than
|
2289
|
-
* this number, it wouldn't make sense anyway, and this is just to make sure
|
2290
|
-
* that someone turning on scientific mode with default settings doesn't
|
2291
|
-
* end up with lots of zeroes.
|
2292
|
-
* @stable ICU 2.8
|
2293
|
-
*/
|
2294
|
-
static const int32_t kMaxScientificIntegerDigits;
|
2155
|
+
// Allow child class CompactDecimalFormat to access fProperties:
|
2156
|
+
friend class CompactDecimalFormat;
|
2295
2157
|
|
2296
2158
|
};
|
2297
2159
|
|