]> granicus.if.org Git - icu/commitdiff
ICU-13177 Cleanup before merge to trunk.
authorShane Carr <shane@unicode.org>
Wed, 27 Sep 2017 05:31:57 +0000 (05:31 +0000)
committerShane Carr <shane@unicode.org>
Wed, 27 Sep 2017 05:31:57 +0000 (05:31 +0000)
X-SVN-Rev: 40471

42 files changed:
icu4c/source/common/unicode/localpointer.h
icu4c/source/i18n/number_affixutils.cpp
icu4c/source/i18n/number_affixutils.h
icu4c/source/i18n/number_compact.cpp
icu4c/source/i18n/number_compact.h
icu4c/source/i18n/number_decimalquantity.cpp
icu4c/source/i18n/number_decimalquantity.h
icu4c/source/i18n/number_decimfmtprops.cpp
icu4c/source/i18n/number_decimfmtprops.h
icu4c/source/i18n/number_fluent.cpp
icu4c/source/i18n/number_formatimpl.cpp
icu4c/source/i18n/number_formatimpl.h
icu4c/source/i18n/number_grouping.cpp
icu4c/source/i18n/number_integerwidth.cpp
icu4c/source/i18n/number_longnames.cpp
icu4c/source/i18n/number_longnames.h
icu4c/source/i18n/number_modifiers.cpp
icu4c/source/i18n/number_modifiers.h
icu4c/source/i18n/number_notation.cpp
icu4c/source/i18n/number_padding.cpp
icu4c/source/i18n/number_patternmodifier.cpp
icu4c/source/i18n/number_patternmodifier.h
icu4c/source/i18n/number_patternstring.cpp
icu4c/source/i18n/number_patternstring.h
icu4c/source/i18n/number_rounding.cpp
icu4c/source/i18n/number_roundingutils.h
icu4c/source/i18n/number_scientific.cpp
icu4c/source/i18n/number_scientific.h
icu4c/source/i18n/number_stringbuilder.cpp
icu4c/source/i18n/number_stringbuilder.h
icu4c/source/i18n/number_types.h
icu4c/source/i18n/number_utils.h
icu4c/source/i18n/unicode/fpositer.h
icu4c/source/i18n/unicode/numberformatter.h
icu4c/source/test/intltest/numbertest.h
icu4c/source/test/intltest/numbertest_affixutils.cpp
icu4c/source/test/intltest/numbertest_api.cpp
icu4c/source/test/intltest/numbertest_decimalquantity.cpp
icu4c/source/test/intltest/numbertest_modifiers.cpp
icu4c/source/test/intltest/numbertest_patternmodifier.cpp
icu4c/source/test/intltest/numbertest_patternstring.cpp
icu4c/source/test/intltest/numbertest_stringbuilder.cpp

index 741f9333bd890890def510c5e7cafb3858655cbb..e17ee3d886ef34df04f891ceb8e0b7cfb88c05a9 100644 (file)
@@ -311,41 +311,6 @@ public:
     }
 };
 
-/**
- * A version of LocalPointer that allows for implicit copying.
- *
- * Inside the copy constructor, the pointer is new'd, and the resulting LocalPointer
- * adopts the new object. The original LocalPointer is unchanged and continues to own
- * its copy of the object.
- *
- * @see LocalPointer
- * @internal
- * @deprecated ICU 60 This API is a technical preview. It may change in an upcoming release.
- */
-template<typename T>
-class CopyableLocalPointer : public LocalPointer<T> {
-  public:
-    // Inherit constructors
-    using LocalPointer<T>::LocalPointer;
-
-    // Inherited constructors don't include default arguments. Define a default constructor.
-    CopyableLocalPointer() : LocalPointer<T>(NULL) {};
-
-    /**
-     * Creates a new local pointer. This constructor calls T's copy constructor
-     * and takes ownership of the new object.
-     *
-     * If memory allocation fails, the resulting pointer will be null.
-     */
-    CopyableLocalPointer(const CopyableLocalPointer<T>& other) {
-        if (other.ptr == NULL) {
-            LocalPointerBase<T>::ptr = NULL;
-        } else {
-            LocalPointerBase<T>::ptr = new T(*other.ptr);
-        }
-    }
-};
-
 /**
  * "Smart pointer" class, deletes objects via the C++ array delete[] operator.
  * For most methods see the LocalPointerBase base class.
index a412dcc8b7f7171b0c51baf4d50911dea419a9e0..48f7c4a7e7b6ae68ae3c5cc94f61240815357949 100644 (file)
@@ -1,6 +1,8 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
+#if !UCONFIG_NO_FORMATTING
+
 #include "number_affixutils.h"
 #include "unicode/utf16.h"
 
@@ -393,3 +395,5 @@ bool AffixUtils::hasNext(const AffixTag &tag, const CharSequence &string) {
         return tag.offset < string.length();
     }
 }
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index 5ff331420aeff7d3b96b03561a15ca1db9157f6c..9f169fe3a1fe4928125d7f1bcbac3248517c5c4e 100644 (file)
@@ -1,8 +1,9 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
-#ifndef NUMBERFORMAT_AFFIXPATTERNUTILS_H
-#define NUMBERFORMAT_AFFIXPATTERNUTILS_H
+#if !UCONFIG_NO_FORMATTING
+#ifndef __NUMBER_AFFIXUTILS_H__
+#define __NUMBER_AFFIXUTILS_H__
 
 #include <cstdint>
 #include "number_types.h"
@@ -213,4 +214,6 @@ class AffixUtils {
 U_NAMESPACE_END
 
 
-#endif //NUMBERFORMAT_AFFIXPATTERNUTILS_H
+#endif //__NUMBER_AFFIXUTILS_H__
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index be3abca7013b275159fcb1d7ca9f2a096cf0e212..de01070725a57028b1d0d81d5c012998f2a49088 100644 (file)
@@ -1,13 +1,15 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
+#if !UCONFIG_NO_FORMATTING
+
 #include "resource.h"
 #include "number_compact.h"
 #include "unicode/ustring.h"
 #include "unicode/ures.h"
-#include <cstring>
-#include <charstr.h>
-#include <uresimp.h>
+#include "cstring.h"
+#include "charstr.h"
+#include "uresimp.h"
 
 using namespace icu::number::impl;
 
@@ -313,3 +315,5 @@ void CompactHandler::processQuantity(DecimalQuantity &quantity, MicroProps &micr
     // We already performed rounding. Do not perform it again.
     micros.rounding = Rounder::constructPassThrough();
 }
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index a0de81ffa6c376a6059e21452857be6a7a67a569..0810a38e4deaf9b6c458021519bbe09e5a09e9eb 100644 (file)
@@ -1,10 +1,11 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
-#ifndef NUMBERFORMAT_NUMFMTTER_COMPACT_H
-#define NUMBERFORMAT_NUMFMTTER_COMPACT_H
+#if !UCONFIG_NO_FORMATTING
+#ifndef __NUMBER_COMPACT_H__
+#define __NUMBER_COMPACT_H__
 
-#include <standardplural.h>
+#include "standardplural.h"
 #include "number_types.h"
 #include "unicode/unum.h"
 #include "uvector.h"
@@ -83,4 +84,6 @@ class CompactHandler : public MicroPropsGenerator, public UMemory {
 } // namespace number
 U_NAMESPACE_END
 
-#endif //NUMBERFORMAT_NUMFMTTER_COMPACT_H
+#endif //__NUMBER_COMPACT_H__
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index b9ede4117c558bb903a8645017d8effc041f520d..adc5186ba161556371a7a20db979027d38215780 100644 (file)
@@ -1,10 +1,12 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
-#include <uassert.h>
+#if !UCONFIG_NO_FORMATTING
+
+#include "uassert.h"
 #include <cmath>
-#include <cmemory.h>
-#include <decNumber.h>
+#include "cmemory.h"
+#include "decNumber.h"
 #include <limits>
 #include "number_decimalquantity.h"
 #include "decContext.h"
@@ -997,3 +999,5 @@ UnicodeString DecimalQuantity::toNumberString() const {
     delete[] digits;
     return ret;
 }
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index e2a6e92022b5bf53c6cdaef76d2f62f9f800010d..dbba35bf8e7df0127f69a63277438cab75c5d14e 100644 (file)
@@ -1,14 +1,15 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
-#ifndef NUMBERFORMAT_DECIMALQUANTITY_H
-#define NUMBERFORMAT_DECIMALQUANTITY_H
+#if !UCONFIG_NO_FORMATTING
+#ifndef __NUMBER_DECIMALQUANTITY_H__
+#define __NUMBER_DECIMALQUANTITY_H__
 
 #include <cstdint>
-#include <unicode/umachine.h>
-#include <decNumber.h>
-#include <standardplural.h>
-#include <plurrule_impl.h>
+#include "unicode/umachine.h"
+#include "decNumber.h"
+#include "standardplural.h"
+#include "plurrule_impl.h"
 #include "number_types.h"
 
 U_NAMESPACE_BEGIN namespace number {
@@ -430,4 +431,6 @@ class DecimalQuantity : public IFixedDecimal, public UMemory {
 U_NAMESPACE_END
 
 
-#endif //NUMBERFORMAT_DECIMALQUANTITY_H
+#endif //__NUMBER_DECIMALQUANTITY_H__
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index f4009024c6f0778d59705de560e747870dd1838a..c5c037c090079bbff463f16deac1215aac490856 100644 (file)
@@ -1,6 +1,8 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
+#if !UCONFIG_NO_FORMATTING
+
 #include "number_decimfmtprops.h"
 
 using namespace icu::number::impl;
@@ -12,7 +14,7 @@ DecimalFormatProperties::DecimalFormatProperties() {
 void DecimalFormatProperties::clear() {
     compactStyle.nullify();
     currency.nullify();
-    currencyPluralInfo.adoptInstead(nullptr);
+    currencyPluralInfo.fPtr.adoptInstead(nullptr);
     currencyUsage.nullify();
     decimalPatternMatchRequired = false;
     decimalSeparatorAlwaysShown = false;
@@ -54,7 +56,7 @@ bool DecimalFormatProperties::operator==(const DecimalFormatProperties &other) c
     bool eq = true;
     eq = eq && compactStyle == other.compactStyle;
     eq = eq && currency == other.currency;
-    eq = eq && currencyPluralInfo.getAlias() == other.currencyPluralInfo.getAlias();
+    eq = eq && currencyPluralInfo.fPtr.getAlias() == other.currencyPluralInfo.fPtr.getAlias();
     eq = eq && currencyUsage == other.currencyUsage;
     eq = eq && decimalPatternMatchRequired == other.decimalPatternMatchRequired;
     eq = eq && decimalSeparatorAlwaysShown == other.decimalSeparatorAlwaysShown;
@@ -92,3 +94,5 @@ bool DecimalFormatProperties::operator==(const DecimalFormatProperties &other) c
     eq = eq && signAlwaysShown == other.signAlwaysShown;
     return eq;
 }
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index 8d8127875dc3d803ecc068f23d78ea8cb2baf939..e5f405aa0a18653d43fae7b097e88c2a64d2cb8b 100644 (file)
@@ -1,13 +1,14 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
-#ifndef NUMBERFORMAT_PROPERTIES_H
-#define NUMBERFORMAT_PROPERTIES_H
+#if !UCONFIG_NO_FORMATTING
+#ifndef __NUMBER_DECIMFMTPROPS_H__
+#define __NUMBER_DECIMFMTPROPS_H__
 
 #include "unicode/unistr.h"
 #include <cstdint>
-#include <unicode/plurrule.h>
-#include <unicode/currpinf.h>
+#include "unicode/plurrule.h"
+#include "unicode/currpinf.h"
 #include "unicode/unum.h"
 #include "number_types.h"
 
@@ -15,12 +16,24 @@ U_NAMESPACE_BEGIN
 namespace number {
 namespace impl {
 
+// TODO: Figure out a nicer way to deal with CurrencyPluralInfo.
+struct CurrencyPluralInfoWrapper {
+    LocalPointer<CurrencyPluralInfo> fPtr;
+
+    CurrencyPluralInfoWrapper() {}
+    CurrencyPluralInfoWrapper(const CurrencyPluralInfoWrapper& other) {
+        if (!other.fPtr.isNull()) {
+            fPtr.adoptInstead(new CurrencyPluralInfo(*other.fPtr));
+        }
+    }
+};
+
 struct DecimalFormatProperties {
 
   public:
     NullableValue<UNumberCompactStyle> compactStyle;
     NullableValue<CurrencyUnit> currency;
-    CopyableLocalPointer <CurrencyPluralInfo> currencyPluralInfo;
+    CurrencyPluralInfoWrapper currencyPluralInfo;
     NullableValue<UCurrencyUsage> currencyUsage;
     bool decimalPatternMatchRequired;
     bool decimalSeparatorAlwaysShown;
@@ -74,4 +87,6 @@ struct DecimalFormatProperties {
 U_NAMESPACE_END
 
 
-#endif //NUMBERFORMAT_PROPERTIES_H
+#endif //__NUMBER_DECIMFMTPROPS_H__
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index a486555ff1401afa029e35ec697c0f17b302801a..3c89153d5508d494575841ee30ae22546d86d880 100644 (file)
@@ -1,7 +1,9 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
-#include <uassert.h>
+#if !UCONFIG_NO_FORMATTING
+
+#include "uassert.h"
 #include "unicode/numberformatter.h"
 #include "number_decimalquantity.h"
 #include "number_formatimpl.h"
@@ -315,3 +317,5 @@ FormattedNumber::populateFieldPositionIterator(FieldPositionIterator &iterator,
 FormattedNumber::~FormattedNumber() {
     delete fResults;
 }
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index 6d337a19ab1e9439590be4729bb22c10ff05fe2e..9c1d927d029a591b18403a31becff1c6eb52a789 100644 (file)
@@ -1,10 +1,12 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
-#include <cstring.h>
-#include <unicode/ures.h>
-#include <uresimp.h>
-#include <charstr.h>
+#if !UCONFIG_NO_FORMATTING
+
+#include "cstring.h"
+#include "unicode/ures.h"
+#include "uresimp.h"
+#include "charstr.h"
 #include "number_formatimpl.h"
 #include "unicode/numfmt.h"
 #include "number_patternstring.h"
@@ -453,3 +455,5 @@ int32_t NumberFormatterImpl::writeFractionDigits(const MicroProps &micros, Decim
     }
     return length;
 }
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index 59413847be001a253b75f11369f220251b319ba3..0970d4ce4869c0fe89d6b3b8abd1e4454a9f9ef1 100644 (file)
@@ -1,8 +1,9 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
-#ifndef NUMBERFORMAT_NUMBERFORMATTERIMPL_H
-#define NUMBERFORMAT_NUMBERFORMATTERIMPL_H
+#if !UCONFIG_NO_FORMATTING
+#ifndef __NUMBER_FORMATIMPL_H__
+#define __NUMBER_FORMATIMPL_H__
 
 #include "number_types.h"
 #include "number_stringbuilder.h"
@@ -117,4 +118,6 @@ class NumberFormatterImpl {
 U_NAMESPACE_END
 
 
-#endif //NUMBERFORMAT_NUMBERFORMATTERIMPL_H
+#endif //__NUMBER_FORMATIMPL_H__
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index cdab741a08440b63cc451470babd80e0c3ea869c..be24ec9fc7f0abbe2d3ed0ff21d9d908bcc90f67 100644 (file)
@@ -1,6 +1,8 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
+#if !UCONFIG_NO_FORMATTING
+
 #include "unicode/numberformatter.h"
 #include "number_patternstring.h"
 
@@ -45,3 +47,5 @@ bool Grouper::groupAtPosition(int32_t position, const impl::DecimalQuantity &val
     return position >= 0 && (position % fGrouping2) == 0
            && value.getUpperDisplayMagnitude() - fGrouping1 + 1 >= (fMin2 ? 2 : 1);
 }
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index d5a22ac6807eed961fadffca07923cb2742e4d07..c5673e3a8f0a8f1b490f533ad51e2a62f0f5ea23 100644 (file)
@@ -1,6 +1,8 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
+#if !UCONFIG_NO_FORMATTING
+
 #include "unicode/numberformatter.h"
 #include "number_types.h"
 #include "number_decimalquantity.h"
@@ -39,3 +41,5 @@ void IntegerWidth::apply(impl::DecimalQuantity &quantity, UErrorCode &status) co
         quantity.setIntegerLength(fUnion.minMaxInt.fMinInt, fUnion.minMaxInt.fMaxInt);
     }
 }
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index 458c6fdbcf53c0f08a9fd33f36b82f38032dbf5d..7097df1109a1a18cd995c7cbcbad7927fc163cf0 100644 (file)
@@ -1,13 +1,15 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
-#include <unicode/ures.h>
-#include <ureslocs.h>
-#include <charstr.h>
-#include <uresimp.h>
+#if !UCONFIG_NO_FORMATTING
+
+#include "unicode/ures.h"
+#include "ureslocs.h"
+#include "charstr.h"
+#include "uresimp.h"
 #include "number_longnames.h"
 #include <algorithm>
-#include <cstring.h>
+#include "cstring.h"
 
 using namespace icu::number::impl;
 
@@ -155,3 +157,5 @@ void LongNameHandler::processQuantity(DecimalQuantity &quantity, MicroProps &mic
     micros.rounding.apply(copy, status);
     micros.modOuter = &fModifiers[copy.getStandardPlural(rules)];
 }
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index bda07448a17aa5b1ae1ac64fa1d57f4cbcda865c..67695d003939db2fbcdf29c136c31caab5a5894b 100644 (file)
@@ -1,8 +1,9 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
-#ifndef NUMBERFORMAT_LONGNAMEHANDLER_H
-#define NUMBERFORMAT_LONGNAMEHANDLER_H
+#if !UCONFIG_NO_FORMATTING
+#ifndef __NUMBER_LONGNAMES_H__
+#define __NUMBER_LONGNAMES_H__
 
 #include "unicode/uversion.h"
 #include "number_utils.h"
@@ -40,4 +41,6 @@ class LongNameHandler : public MicroPropsGenerator, public UObject {
 }  // namespace number
 U_NAMESPACE_END
 
-#endif //NUMBERFORMAT_LONGNAMEHANDLER_H
+#endif //__NUMBER_LONGNAMES_H__
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index 98cc894da6618252f7327b5df471c7ec7c6408f1..26b87fcdf42f6e10edbd17c8f139a68dfe3397ff 100644 (file)
@@ -1,9 +1,11 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
-#include <umutex.h>
-#include <ucln_cmn.h>
-#include <ucln_in.h>
+#if !UCONFIG_NO_FORMATTING
+
+#include "umutex.h"
+#include "ucln_cmn.h"
+#include "ucln_in.h"
 #include "number_modifiers.h"
 
 using namespace icu::number::impl;
@@ -292,3 +294,5 @@ CurrencySpacingEnabledModifier::getInsertString(const DecimalFormatSymbols &symb
                                                 UErrorCode &status) {
     return symbols.getPatternForCurrencySpacing(UNUM_CURRENCY_INSERT, affix == SUFFIX, status);
 }
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index 41637735fe6285f77a936ad4c80852fd57089083..2701f1cf2d72ff6b37bcab450266c4633919df69 100644 (file)
@@ -1,14 +1,15 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
-#ifndef NUMBERFORMAT_MODIFIERS_H
-#define NUMBERFORMAT_MODIFIERS_H
+#if !UCONFIG_NO_FORMATTING
+#ifndef __NUMBER_MODIFIERS_H__
+#define __NUMBER_MODIFIERS_H__
 
 #include <algorithm>
 #include <cstdint>
-#include <unicode/uniset.h>
-#include <unicode/simpleformatter.h>
-#include <standardplural.h>
+#include "unicode/uniset.h"
+#include "unicode/simpleformatter.h"
+#include "standardplural.h"
 #include "number_stringbuilder.h"
 #include "number_types.h"
 
@@ -246,4 +247,6 @@ class ParameterizedModifier : public UMemory {
 U_NAMESPACE_END
 
 
-#endif //NUMBERFORMAT_MODIFIERS_H
+#endif //__NUMBER_MODIFIERS_H__
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index e459742ee9aa524527dff048e590b31f27ce4458..6b1d600bfeb0c844fe06a29f698b5ed936c1608c 100644 (file)
@@ -1,6 +1,8 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
+#if !UCONFIG_NO_FORMATTING
+
 #include "unicode/numberformatter.h"
 #include "number_types.h"
 
@@ -66,3 +68,5 @@ ScientificNotation::withExponentSignDisplay(UNumberSignDisplay exponentSignDispl
     NotationUnion union_ = {settings};
     return {NTN_SCIENTIFIC, union_};
 }
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index 40957950e3755d73563c1d0a8f4541b146698eec..641fc5d00f2ff9717e5db88ff94f4a1843399b79 100644 (file)
@@ -1,6 +1,8 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
+#if !UCONFIG_NO_FORMATTING
+
 #include "unicode/numberformatter.h"
 #include "number_types.h"
 #include "number_stringbuilder.h"
@@ -74,3 +76,5 @@ int32_t Padder::padAndApply(const impl::Modifier &mod1, const impl::Modifier &mo
 
     return length;
 }
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index 80121d84a7545e0c779cba7c442e9ef85f461e84..e4c5fa1ca9f07c0d0f1eddb2a664f29039531d73 100644 (file)
@@ -1,7 +1,9 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
-#include <cstring.h>
+#if !UCONFIG_NO_FORMATTING
+
+#include "cstring.h"
 #include "number_patternmodifier.h"
 #include "unicode/dcfmtsym.h"
 #include "unicode/ucurr.h"
@@ -340,3 +342,5 @@ UnicodeString MutablePatternModifier::toUnicodeString() const {
     U_ASSERT(false);
     return UnicodeString();
 }
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index 475b427e12ec20015e1a9e2b4e683b0730340fbd..0dd26b94c26ff75c3dc6334385a924b1ed8f6c36 100644 (file)
@@ -1,10 +1,11 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
-#ifndef NUMBERFORMAT_MUTABLEPATTERNMODIFIER_H
-#define NUMBERFORMAT_MUTABLEPATTERNMODIFIER_H
+#if !UCONFIG_NO_FORMATTING
+#ifndef __NUMBER_PATTERNMODIFIER_H__
+#define __NUMBER_PATTERNMODIFIER_H__
 
-#include <standardplural.h>
+#include "standardplural.h"
 #include "unicode/numberformatter.h"
 #include "number_patternstring.h"
 #include "number_types.h"
@@ -231,4 +232,6 @@ class MutablePatternModifier
 }  // namespace number
 U_NAMESPACE_END
 
-#endif //NUMBERFORMAT_MUTABLEPATTERNMODIFIER_H
+#endif //__NUMBER_PATTERNMODIFIER_H__
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index 4de385cc94b3d3bf36223c9122d0b43b65081d2d..e338199afecfad33b82cf6c0fbe43476caaf9d0b 100644 (file)
@@ -1,7 +1,9 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
-#include <uassert.h>
+#if !UCONFIG_NO_FORMATTING
+
+#include "uassert.h"
 #include "number_patternstring.h"
 #include "unicode/utf16.h"
 #include "number_utils.h"
@@ -829,3 +831,5 @@ int PatternStringUtils::escapePaddingString(UnicodeString input, UnicodeString&
     }
     return output.length() - startLength;
 }
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index 921f68b7d95c5a51f84d7912449f47105662b559..29fd2d6edd70ce18645518e617be30d9d047eca8 100644 (file)
@@ -1,13 +1,14 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
-#ifndef NUMBERFORMAT_PATTERNPARSER_H
-#define NUMBERFORMAT_PATTERNPARSER_H
+#if !UCONFIG_NO_FORMATTING
+#ifndef __NUMBER_PATTERNSTRING_H__
+#define __NUMBER_PATTERNSTRING_H__
 
 
 #include <cstdint>
-#include <unicode/unum.h>
-#include <unicode/unistr.h>
+#include "unicode/unum.h"
+#include "unicode/unistr.h"
 #include "number_types.h"
 #include "number_decimalquantity.h"
 #include "number_decimfmtprops.h"
@@ -254,4 +255,6 @@ class PatternStringUtils {
 U_NAMESPACE_END
 
 
-#endif //NUMBERFORMAT_PATTERNPARSER_H
+#endif //__NUMBER_PATTERNSTRING_H__
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index e51158acb1982595081f6dde7a3f51275013f908..9aa0378aa8c732cf0248fa236cb20ac0f52496b2 100644 (file)
@@ -1,7 +1,9 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
-#include <uassert.h>
+#if !UCONFIG_NO_FORMATTING
+
+#include "uassert.h"
 #include "unicode/numberformatter.h"
 #include "number_types.h"
 #include "number_decimalquantity.h"
@@ -338,3 +340,5 @@ void Rounder::apply(impl::DecimalQuantity &value, int32_t minInt, UErrorCode /*s
     U_ASSERT(value.isZero());
     value.setFractionLength(fUnion.fracSig.fMinSig - minInt, INT32_MAX);
 }
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index 6f68b1ac4851cc4b99f92b7ccbf62cef37807b1a..f26dbee835d7e8186261f34038eb7fd2bcc05ca9 100644 (file)
@@ -1,8 +1,9 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
-#ifndef NUMBERFORMAT_ROUNDINGUTILS_H
-#define NUMBERFORMAT_ROUNDINGUTILS_H
+#if !UCONFIG_NO_FORMATTING
+#ifndef __NUMBER_ROUNDINGUTILS_H__
+#define __NUMBER_ROUNDINGUTILS_H__
 
 #include "number_types.h"
 
@@ -133,4 +134,6 @@ inline bool roundsAtMidpoint(int roundingMode) {
 } // namespace number
 U_NAMESPACE_END
 
-#endif //NUMBERFORMAT_ROUNDINGUTILS_H
+#endif //__NUMBER_ROUNDINGUTILS_H__
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index 8482347417a116e156d08788d7d09baeeaae60af..db63f854b75b57317671740a37ff91f4fa0024e6 100644 (file)
@@ -1,6 +1,8 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
+#if !UCONFIG_NO_FORMATTING
+
 #include <cstdlib>
 #include "number_scientific.h"
 #include "number_utils.h"
@@ -127,3 +129,5 @@ int32_t ScientificHandler::getMultiplier(int32_t magnitude) const {
     }
     return digitsShown - magnitude - 1;
 }
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index 77737fe3d2a20dda9e4d751c77dbc3e0d7087e76..6b43a484a834d98f8826c92290aad4efc9b4046b 100644 (file)
@@ -1,8 +1,9 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
-#ifndef NUMBERFORMAT_NUMFMTTER_SCIENTIFIC_H
-#define NUMBERFORMAT_NUMFMTTER_SCIENTIFIC_H
+#if !UCONFIG_NO_FORMATTING
+#ifndef __NUMBER_SCIENTIFIC_H__
+#define __NUMBER_SCIENTIFIC_H__
 
 #include "number_types.h"
 
@@ -54,4 +55,6 @@ class ScientificHandler : public UMemory, public MicroPropsGenerator, public Mul
 } // namespace number
 U_NAMESPACE_END
 
-#endif //NUMBERFORMAT_NUMFMTTER_SCIENTIFIC_H
+#endif //__NUMBER_SCIENTIFIC_H__
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index 32be6a590026de346d9d13165a153f1d0bc85592..a7ba7e953599de46a7917af6abadd0aa6d5a667b 100644 (file)
@@ -1,9 +1,11 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
+#if !UCONFIG_NO_FORMATTING
+
 #include "number_stringbuilder.h"
-#include <unicode/utf16.h>
-#include <uvectr32.h>
+#include "unicode/utf16.h"
+#include "uvectr32.h"
 
 using namespace icu::number::impl;
 
@@ -450,3 +452,5 @@ void NumberStringBuilder::populateFieldPositionIterator(FieldPositionIterator &f
     // Give uvec to the FieldPositionIterator, which adopts it.
     fpi.setData(uvec.orphan(), status);
 }
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index aab11ce78cd032190d4f7d244b539896f2e25bb4..ea5da12ab3ca08c4416f9cf011430a4ede42be18 100644 (file)
@@ -1,15 +1,16 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
-#ifndef NUMBERFORMAT_NUMBERSTRINGBUILDER_H
-#define NUMBERFORMAT_NUMBERSTRINGBUILDER_H
+#if !UCONFIG_NO_FORMATTING
+#ifndef __NUMBER_STRINGBUILDER_H__
+#define __NUMBER_STRINGBUILDER_H__
 
 
 #include <cstdint>
-#include <unicode/numfmt.h>
-#include <unicode/ustring.h>
-#include <cstring>
-#include <uassert.h>
+#include "unicode/numfmt.h"
+#include "unicode/ustring.h"
+#include "cstring.h"
+#include "uassert.h"
 #include "number_types.h"
 
 U_NAMESPACE_BEGIN namespace number {
@@ -127,4 +128,6 @@ class NumberStringBuilder : public UMemory {
 U_NAMESPACE_END
 
 
-#endif //NUMBERFORMAT_NUMBERSTRINGBUILDER_H
+#endif //__NUMBER_STRINGBUILDER_H__
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index a9d3cab8ab2f09cd588f85dcfc9e2ef5a0faa906..eaedb00ad0e11e70b471fdffe8c213ef5d5109f4 100644 (file)
@@ -1,16 +1,17 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
-#ifndef NUMBERFORMAT_INTERNALS_H
-#define NUMBERFORMAT_INTERNALS_H
+#if !UCONFIG_NO_FORMATTING
+#ifndef __NUMBER_TYPES_H__
+#define __NUMBER_TYPES_H__
 
 #include <cstdint>
-#include <unicode/decimfmt.h>
-#include <unicode/unum.h>
-#include <unicode/numsys.h>
+#include "unicode/decimfmt.h"
+#include "unicode/unum.h"
+#include "unicode/numsys.h"
 #include "unicode/numberformatter.h"
-#include <unicode/utf16.h>
-#include <uassert.h>
+#include "unicode/utf16.h"
+#include "uassert.h"
 
 U_NAMESPACE_BEGIN
 namespace number {
@@ -279,4 +280,6 @@ class NullableValue {
 } // namespace number
 U_NAMESPACE_END
 
-#endif //NUMBERFORMAT_INTERNALS_H
+#endif //__NUMBER_TYPES_H__
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index 608363628f2e92803f59e4cc296a3afab6031f59..90a8b8ec83210fc5b03b955d796d432c9adceb59 100644 (file)
@@ -1,8 +1,9 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
-#ifndef NUMBERFORMAT_NUMFMTTER_UTILS_H
-#define NUMBERFORMAT_NUMFMTTER_UTILS_H
+#if !UCONFIG_NO_FORMATTING
+#ifndef __NUMBER_UTILS_H__
+#define __NUMBER_UTILS_H__
 
 #include "unicode/numberformatter.h"
 #include "number_types.h"
@@ -122,4 +123,6 @@ inline const UnicodeString getDigitFromSymbols(int8_t digit, const DecimalFormat
 } // namespace number
 U_NAMESPACE_END
 
-#endif //NUMBERFORMAT_NUMFMTTER_UTILS_H
+#endif //__NUMBER_UTILS_H__
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index 20b7093a2909f1ea088f52fe09c635833de129e5..38ccd8feb30676bd596436e04a81d4d8288c46e3 100644 (file)
@@ -47,6 +47,13 @@ U_NAMESPACE_BEGIN
 
 class UVector32;
 
+// Forward declaration for number formatting:
+namespace number {
+namespace impl {
+class NumberStringBuilder;
+}
+}
+
 /**
  * FieldPositionIterator returns the field ids and their start/limit positions generated
  * by a call to Format::format.  See Format, NumberFormat, DecimalFormat.
@@ -98,6 +105,7 @@ public:
      */
     UBool next(FieldPosition& fp);
 
+private:
     /**
      * Sets the data used by the iterator, and resets the position.
      * Returns U_ILLEGAL_ARGUMENT_ERROR in status if the data is not valid 
@@ -105,8 +113,8 @@ public:
      */
     void setData(UVector32 *adopt, UErrorCode& status);
 
-private:
     friend class FieldPositionIteratorHandler;
+    friend class number::impl::NumberStringBuilder;
 
     UVector32 *data;
     int32_t pos;
index b86bc89fc5b1df3f9f530a3321092db58b8b8ca7..24dabbee31bd8c535457d3d5c5f95e83087f3d54 100644 (file)
@@ -1,17 +1,23 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
-#ifndef NUMBERFORMAT_HEADERS_H
-#define NUMBERFORMAT_HEADERS_H
-
-#include <unicode/decimfmt.h>
-#include <unicode/measunit.h>
-#include <unicode/measfmt.h>
-#include <unicode/ucurr.h>
-#include <unicode/appendable.h>
-#include <unicode/nounit.h>
+#if !UCONFIG_NO_FORMATTING
+#ifndef __NUMBERFORMATTER_H__
+#define __NUMBERFORMATTER_H__
+
 #include <atomic>
 
+#include "unicode/appendable.h"
+#include "unicode/dcfmtsym.h"
+#include "unicode/currunit.h"
+#include "unicode/fieldpos.h"
+#include "unicode/fpositer.h"
+#include "unicode/measunit.h"
+#include "unicode/nounit.h"
+#include "unicode/plurrule.h"
+#include "unicode/ucurr.h"
+#include "unicode/unum.h"
+
 /**
  * An enum declaring how to render units, including currencies. Example outputs when formatting 123 USD and 123
  * meters in <em>en-CA</em>:
@@ -1821,4 +1827,6 @@ class NumberFormatter final {
 }  // namespace number
 U_NAMESPACE_END
 
-#endif //NUMBERFORMAT_HEADERS_H
+#endif // __NUMBERFORMATTER_H__
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index 39f07ec2b3acc20e387069339c07b0a4833a6ace..ec07d9784fdd9579bbd33b7aac1d4a84aac4d8f6 100644 (file)
@@ -1,6 +1,7 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
+#if !UCONFIG_NO_FORMATTING
 #pragma once
 
 #include "number_stringbuilder.h"
@@ -195,3 +196,5 @@ class NumberTest : public IntlTest {
         }
     }
 };
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index aefa3513010f70509ccfc4682e4a19d1a4ab54cd..c0337a67af54c23a33aad3bac31c7d9354053fff 100644 (file)
@@ -1,6 +1,8 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
+#if !UCONFIG_NO_FORMATTING
+
 #include "putilimp.h"
 #include "unicode/dcfmtsym.h"
 #include "numbertest.h"
@@ -240,3 +242,5 @@ UnicodeString AffixUtilsTest::unescapeWithDefaults(const SymbolProvider &default
     assertEquals("Return value of unescape", nsb.length(), length);
     return nsb.toUnicodeString();
 }
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index 905867afab49d7d0195c30fd09f52ccfba2a4a8b..7ada621824e4a76f458539d369f318ff86ab61cf 100644 (file)
@@ -1,9 +1,9 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
-#define TEMP_TEST_HELPERS_NO_PRINT_PASS 1
+#if !UCONFIG_NO_FORMATTING
 
-#include <charstr.h>
+#include "charstr.h"
 #include <cstdarg>
 #include "unicode/unum.h"
 #include "unicode/numberformatter.h"
@@ -1484,3 +1484,5 @@ void NumberFormatterApiTest::assertFormatSingle(const UnicodeString &message,
     assertSuccess(message + u": Safe Path", status);
     assertEquals(message + u": Safe Path", expected, actual2);
 }
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index 61290b067b1d6be517ae58e838e2d2a0da2d824b..d863c58748964a35b37527a0f2e50ecc69c24f19 100644 (file)
@@ -1,6 +1,8 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
+#if !UCONFIG_NO_FORMATTING
+
 #include "number_decimalquantity.h"
 #include "math.h"
 #include <cmath>
@@ -253,3 +255,5 @@ void DecimalQuantityTest::testUseApproximateDoubleWhenAble() {
         }
     }
 }
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index 8df305654540e6078de2416b2030f3e6a8b11be9..3605fc60df88d60e707c234b0336be5399320e4a 100644 (file)
@@ -1,7 +1,9 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
-#include <putilimp.h>
+#if !UCONFIG_NO_FORMATTING
+
+#include "putilimp.h"
 #include "intltest.h"
 #include "number_stringbuilder.h"
 #include "number_modifiers.h"
@@ -172,3 +174,5 @@ void ModifiersTest::assertModifierEquals(const Modifier &mod, NumberStringBuilde
     debugString.append(u"]>");
     assertEquals("Debug string", debugString, sb.toDebugString());
 }
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index 4e34597ffe1622925a0294eb27126669d69ca474..32eaba901f3d9972aff5136eaf04fc02fd1b5052 100644 (file)
@@ -1,6 +1,8 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
+#if !UCONFIG_NO_FORMATTING
+
 #include "numbertest.h"
 #include "number_patternmodifier.h"
 
@@ -118,3 +120,5 @@ UnicodeString PatternModifierTest::getSuffix(const MutablePatternModifier &mod,
     int32_t prefixLength = mod.getPrefixLength(status);
     return UnicodeString(nsb.toUnicodeString(), prefixLength, nsb.length() - prefixLength);
 }
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index 7efd938094f6844a9002c19b5b414f1f08e36c96..12cb3bd68ae5337a023de56ccecc6efb768410c3 100644 (file)
@@ -1,6 +1,8 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
+#if !UCONFIG_NO_FORMATTING
+
 #include "numbertest.h"
 #include "number_patternstring.h"
 
@@ -86,3 +88,5 @@ void PatternStringTest::testBug13117() {
     assertSuccess("Spot 1", status);
     assertTrue("Should not consume negative subpattern", expected == actual);
 }
+
+#endif /* #if !UCONFIG_NO_FORMATTING */
index d6a87152af692bf77b28731022a103bccb94a9b6..d389dab66e097db9d206458e79535ec3c1504e73 100644 (file)
@@ -1,6 +1,8 @@
 // © 2017 and later: Unicode, Inc. and others.
 // License & terms of use: http://www.unicode.org/copyright.html
 
+#if !UCONFIG_NO_FORMATTING
+
 #include "putilimp.h"
 #include "numbertest.h"
 
@@ -229,3 +231,5 @@ void NumberStringBuilderTest::assertEqualsImpl(const UnicodeString &a, const Num
                 UnicodeString(" in string ") + a, a.charAt(i), b.charAt(i));
     }
 }
+
+#endif /* #if !UCONFIG_NO_FORMATTING */