Movatterモバイル変換


[0]ホーム

URL:


ICU 78.1  78.1
numberformatter.h
Go to the documentation of this file.
1 // © 2017 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 
4 #ifndef __NUMBERFORMATTER_H__
5 #define __NUMBERFORMATTER_H__
6 
7 #include "unicode/utypes.h"
8 
9 #if U_SHOW_CPLUSPLUS_API
10 
11 #if !UCONFIG_NO_FORMATTING
12 
13 #include "unicode/appendable.h"
14 #include "unicode/bytestream.h"
15 #include "unicode/currunit.h"
16 #include "unicode/dcfmtsym.h"
17 #include "unicode/displayoptions.h"
18 #include "unicode/fieldpos.h"
19 #include "unicode/fpositer.h"
20 #include "unicode/measunit.h"
21 #include "unicode/nounit.h"
22 #include "unicode/parseerr.h"
23 #include "unicode/plurrule.h"
24 #include "unicode/ucurr.h"
25 #include "unicode/unum.h"
26 #include "unicode/unumberformatter.h"
27 #include "unicode/uobject.h"
28 #include "unicode/unumberoptions.h"
29 #include "unicode/formattednumber.h"
30 
89 U_NAMESPACE_BEGIN
90 
91 // Forward declarations:
92 classIFixedDecimal;
93 classFieldPositionIteratorHandler;
94 classFormattedStringBuilder;
95 
96 namespacenumparse::impl {
97 
98 // Forward declarations:
99 classNumberParserImpl;
100 classMultiplierParseHandler;
101 
102 }// namespace numparse::impl
103 
104 namespaceunits {
105 
106 // Forward declarations:
107 classUnitsRouter;
108 
109 }// namespace units
110 
111 namespacenumber {// icu::number
112 
113 // Forward declarations:
114 classUnlocalizedNumberFormatter;
115 classLocalizedNumberFormatter;
116 classSimpleNumberFormatter;
117 classFormattedNumber;
118 classNotation;
119 classScientificNotation;
120 classPrecision;
121 classFractionPrecision;
122 classCurrencyPrecision;
123 classIncrementPrecision;
124 classIntegerWidth;
125 
126 namespaceimpl {
127 
128 // can't be #ifndef U_HIDE_INTERNAL_API; referenced throughout this file in public classes
134 typedef int16_tdigits_t;
135 
136 // can't be #ifndef U_HIDE_INTERNAL_API; needed for struct initialization
143 static constexpr int32_t kInternalDefaultThreshold = 3;
144 
145 // Forward declarations:
146 classPadder;
147 structMacroProps;
148 structMicroProps;
149 classDecimalQuantity;
150 classUFormattedNumberData;
151 classNumberFormatterImpl;
152 structParsedPatternInfo;
153 classScientificModifier;
154 classMultiplierProducer;
155 classRoundingImpl;
156 classScientificHandler;
157 classModifier;
158 classAffixPatternProvider;
159 classNumberPropertyMapper;
160 structDecimalFormatProperties;
161 classMultiplierFormatHandler;
162 classCurrencySymbols;
163 classGeneratorHelpers;
164 classDecNum;
165 classNumberRangeFormatterImpl;
166 structRangeMacroProps;
167 structUFormattedNumberImpl;
168 classMutablePatternModifier;
169 classImmutablePatternModifier;
170 structDecimalFormatWarehouse;
171 structSimpleMicroProps;
172 classAdoptingSignumModifierStore;
173 
180 voidtouchRangeLocales(impl::RangeMacroProps& macros);
181 
182 }// namespace impl
183 
189 typedefNotationCompactNotation;
190 
196 typedefNotationSimpleNotation;
197 
203 classU_I18N_APINotation :publicUMemory {
204 public:
229 staticScientificNotationscientific();
230 
253 staticScientificNotationengineering();
254 
296 staticCompactNotationcompactShort();
297 
320 staticCompactNotationcompactLong();
321 
346 staticSimpleNotationsimple();
347 
348 private:
349 enum NotationType {
350  NTN_SCIENTIFIC, NTN_COMPACT, NTN_SIMPLE, NTN_ERROR
351  } fType;
352 
353 unionNotationUnion {
354 // For NTN_SCIENTIFIC
356 structScientificSettings {
358  int8_tfEngineeringInterval;
360 boolfRequireMinInt;
362 impl::digits_tfMinExponentDigits;
364 UNumberSignDisplayfExponentSignDisplay;
365  } scientific;
366 
367 // For NTN_COMPACT
368 UNumberCompactStyle compactStyle;
369 
370 // For NTN_ERROR
371 UErrorCode errorCode;
372  } fUnion;
373 
374 typedefNotationUnion::ScientificSettingsScientificSettings;
375 
376 Notation(const NotationType &type,const NotationUnion &union_) : fType(type), fUnion(union_) {}
377 
378 Notation(UErrorCode errorCode) : fType(NTN_ERROR) {
379  fUnion.errorCode = errorCode;
380  }
381 
382  Notation() : fType(NTN_SIMPLE), fUnion() {}
383 
384 UBool copyErrorTo(UErrorCode &status) const{
385 if (fType == NTN_ERROR) {
386  status = fUnion.errorCode;
387 returntrue;
388  }
389 returnfalse;
390  }
391 
392 // To allow MacroProps to initialize empty instances:
393 friendstructimpl::MacroProps;
394 friendclassScientificNotation;
395 
396 // To allow implementation to access internal types:
397 friendclassimpl::NumberFormatterImpl;
398 friendclassimpl::ScientificModifier;
399 friendclassimpl::ScientificHandler;
400 
401 // To allow access to the skeleton generation code:
402 friendclassimpl::GeneratorHelpers;
403 };
404 
413 classU_I18N_APIScientificNotation :publicNotation {
414 public:
428 ScientificNotationwithMinExponentDigits(int32_t minExponentDigits)const;
429 
443 ScientificNotationwithExponentSignDisplay(UNumberSignDisplay exponentSignDisplay)const;
444 
445 private:
446 // Inherit constructor
447 using Notation::Notation;
448 
449 // Raw constructor for NumberPropertyMapper
450 ScientificNotation(int8_t fEngineeringInterval,bool fRequireMinInt,impl::digits_t fMinExponentDigits,
451 UNumberSignDisplay fExponentSignDisplay);
452 
453 friendclassNotation;
454 
455 // So that NumberPropertyMapper can create instances
456 friendclassimpl::NumberPropertyMapper;
457 };
458 
464 typedefPrecisionSignificantDigitsPrecision;
465 
474 classU_I18N_APIPrecision :publicUMemory {
475 
476 public:
494 staticPrecisionunlimited();
495 
502 staticFractionPrecisioninteger();
503 
531 staticFractionPrecisionfixedFraction(int32_t minMaxFractionPlaces);
532 
546 staticFractionPrecisionminFraction(int32_t minFractionPlaces);
547 
558 staticFractionPrecisionmaxFraction(int32_t maxFractionPlaces);
559 
573 staticFractionPrecisionminMaxFraction(int32_t minFractionPlaces, int32_t maxFractionPlaces);
574 
588 staticSignificantDigitsPrecisionfixedSignificantDigits(int32_t minMaxSignificantDigits);
589 
602 staticSignificantDigitsPrecisionminSignificantDigits(int32_t minSignificantDigits);
603 
612 staticSignificantDigitsPrecisionmaxSignificantDigits(int32_t maxSignificantDigits);
613 
625 staticSignificantDigitsPrecisionminMaxSignificantDigits(int32_t minSignificantDigits,
626  int32_t maxSignificantDigits);
627 
647 staticIncrementPrecisionincrement(double roundingIncrement);
648 
672 staticIncrementPrecisionincrementExact(uint64_t mantissa, int16_t magnitude);
673 
691 staticCurrencyPrecisioncurrency(UCurrencyUsage currencyUsage);
692 
700 PrecisiontrailingZeroDisplay(UNumberTrailingZeroDisplay trailingZeroDisplay)const;
701 
702 private:
703 enum PrecisionType {
704  RND_BOGUS,
705  RND_NONE,
706  RND_FRACTION,
707  RND_SIGNIFICANT,
708  RND_FRACTION_SIGNIFICANT,
709 
710 // Used for strange increments like 3.14.
711  RND_INCREMENT,
712 
713 // Used for increments with 1 as the only digit. This is different than fraction
714 // rounding because it supports having additional trailing zeros. For example, this
715 // class is used to round with the increment 0.010.
716  RND_INCREMENT_ONE,
717 
718 // Used for increments with 5 as the only digit (nickel rounding).
719  RND_INCREMENT_FIVE,
720 
721  RND_CURRENCY,
722  RND_ERROR
723  } fType;
724 
725 unionPrecisionUnion {
727 structFractionSignificantSettings {
728 // For RND_FRACTION, RND_SIGNIFICANT, and RND_FRACTION_SIGNIFICANT
730 impl::digits_tfMinFrac;
732 impl::digits_tfMaxFrac;
734 impl::digits_tfMinSig;
736 impl::digits_tfMaxSig;
738 UNumberRoundingPriorityfPriority;
743 boolfRetain;
744  } fracSig;
746 structIncrementSettings {
747 // For RND_INCREMENT, RND_INCREMENT_ONE, and RND_INCREMENT_FIVE
748 // Note: This is a union, so we shouldn't own memory, since
749 // the default destructor would leak it.
751  uint64_tfIncrement;
753 impl::digits_tfIncrementMagnitude;
755 impl::digits_tfMinFrac;
756  } increment;
757 UCurrencyUsage currencyUsage;// For RND_CURRENCY
758 UErrorCode errorCode;// For RND_ERROR
759  } fUnion;
760 
761 UNumberTrailingZeroDisplay fTrailingZeroDisplay =UNUM_TRAILING_ZERO_AUTO;
762 
763 typedefPrecisionUnion::FractionSignificantSettingsFractionSignificantSettings;
764 typedefPrecisionUnion::IncrementSettingsIncrementSettings;
765 
766 Precision(const PrecisionType& type,const PrecisionUnion& union_)
767  : fType(type), fUnion(union_) {}
768 
769 Precision(UErrorCode errorCode) : fType(RND_ERROR) {
770  fUnion.errorCode = errorCode;
771  }
772 
773  Precision() : fType(RND_BOGUS) {}
774 
775 bool isBogus() const{
776 return fType == RND_BOGUS;
777  }
778 
779 UBool copyErrorTo(UErrorCode &status) const{
780 if (fType == RND_ERROR) {
781  status = fUnion.errorCode;
782 returntrue;
783  }
784 returnfalse;
785  }
786 
787 // On the parent type so that this method can be called internally on Precision instances.
788  Precision withCurrency(const CurrencyUnit &currency,UErrorCode &status)const;
789 
790 static FractionPrecision constructFraction(int32_t minFrac, int32_t maxFrac);
791 
792 static Precision constructSignificant(int32_t minSig, int32_t maxSig);
793 
794 static Precision constructFractionSignificant(
795 const FractionPrecision &base,
796  int32_t minSig,
797  int32_t maxSig,
798 UNumberRoundingPriority priority,
799 bool retain);
800 
801 static IncrementPrecision constructIncrement(uint64_t increment, impl::digits_t magnitude);
802 
803 static CurrencyPrecision constructCurrency(UCurrencyUsage usage);
804 
805 // To allow MacroProps/MicroProps to initialize bogus instances:
806 friendstructimpl::MacroProps;
807 friendstructimpl::MicroProps;
808 
809 // To allow NumberFormatterImpl to access isBogus() and other internal methods:
810 friendclassimpl::NumberFormatterImpl;
811 
812 // To allow NumberPropertyMapper to create instances from DecimalFormatProperties:
813 friendclassimpl::NumberPropertyMapper;
814 
815 // To allow access to the main implementation class:
816 friendclassimpl::RoundingImpl;
817 
818 // To allow child classes to call private methods:
819 friendclassFractionPrecision;
820 friendclassCurrencyPrecision;
821 friendclassIncrementPrecision;
822 
823 // To allow access to the skeleton generation code:
824 friendclassimpl::GeneratorHelpers;
825 
826 // To allow access to isBogus and the default (bogus) constructor:
827 friendclassunits::UnitsRouter;
828 };
829 
839 classU_I18N_APIFractionPrecision :publicPrecision {
840 public:
855 PrecisionwithSignificantDigits(
856  int32_t minSignificantDigits,
857  int32_t maxSignificantDigits,
858 UNumberRoundingPriority priority)const;
859 
877 PrecisionwithMinDigits(int32_t minSignificantDigits)const;
878 
896 PrecisionwithMaxDigits(int32_t maxSignificantDigits)const;
897 
898 private:
899 // Inherit constructor
900 using Precision::Precision;
901 
902 // To allow parent class to call this class's constructor:
903 friendclassPrecision;
904 };
905 
915 classU_I18N_APICurrencyPrecision :publicPrecision {
916 public:
934 PrecisionwithCurrency(constCurrencyUnit &currency)const;
935 
936 private:
937 // Inherit constructor
938 using Precision::Precision;
939 
940 // To allow parent class to call this class's constructor:
941 friendclassPrecision;
942 };
943 
953 classU_I18N_APIIncrementPrecision :publicPrecision {
954 public:
970 PrecisionwithMinFraction(int32_t minFrac)const;
971 
972 private:
973 // Inherit constructor
974 using Precision::Precision;
975 
976 // To allow parent class to call this class's constructor:
977 friendclassPrecision;
978 };
979 
989 classU_I18N_APIIntegerWidth :publicUMemory {
990 public:
1002 staticIntegerWidthzeroFillTo(int32_t minInt);
1003 
1015 IntegerWidthtruncateAt(int32_t maxInt);
1016 
1017 private:
1018 union{
1019 struct{
1020 impl::digits_t fMinInt;
1021 impl::digits_t fMaxInt;
1022 bool fFormatFailIfMoreThanMaxDigits;
1023  } minMaxInt;
1024 UErrorCode errorCode;
1025  } fUnion;
1026 bool fHasError =false;
1027 
1028  IntegerWidth(impl::digits_t minInt, impl::digits_t maxInt,bool formatFailIfMoreThanMaxDigits);
1029 
1030  IntegerWidth(UErrorCode errorCode) {// NOLINT
1031  fUnion.errorCode = errorCode;
1032  fHasError =true;
1033  }
1034 
1035  IntegerWidth() {// NOLINT
1036  fUnion.minMaxInt.fMinInt = -1;
1037  }
1038 
1040 static IntegerWidth standard() {
1041 return IntegerWidth::zeroFillTo(1);
1042  }
1043 
1044 bool isBogus() const{
1045 return !fHasError && fUnion.minMaxInt.fMinInt == -1;
1046  }
1047 
1048 UBool copyErrorTo(UErrorCode &status) const{
1049 if (fHasError) {
1050  status = fUnion.errorCode;
1051 returntrue;
1052  }
1053 returnfalse;
1054  }
1055 
1056 void apply(impl::DecimalQuantity &quantity,UErrorCode &status)const;
1057 
1058 booloperator==(const IntegerWidth& other)const;
1059 
1060 // To allow MacroProps/MicroProps to initialize empty instances:
1061 friendstructimpl::MacroProps;
1062 friendstructimpl::MicroProps;
1063 
1064 // To allow NumberFormatterImpl to access isBogus():
1065 friendclassimpl::NumberFormatterImpl;
1066 
1067 // To allow the use of this class when formatting:
1068 friendclassimpl::MutablePatternModifier;
1069 friendclassimpl::ImmutablePatternModifier;
1070 
1071 // So that NumberPropertyMapper can create instances
1072 friendclassimpl::NumberPropertyMapper;
1073 
1074 // To allow access to the skeleton generation code:
1075 friendclassimpl::GeneratorHelpers;
1076 };
1077 
1086 classU_I18N_APIScale :publicUMemory {
1087 public:
1094 staticScalenone();
1095 
1106 staticScalepowerOfTen(int32_t power);
1107 
1120 staticScalebyDecimal(StringPiece multiplicand);
1121 
1130 staticScalebyDouble(double multiplicand);
1131 
1138 staticScalebyDoubleAndPowerOfTen(double multiplicand, int32_t power);
1139 
1140 // We need a custom destructor for the DecNum, which means we need to declare
1141 // the copy/move constructor/assignment quartet.
1142 
1144 Scale(constScale& other);
1145 
1147 Scale&operator=(constScale& other);
1148 
1150 Scale(Scale&& src) noexcept;
1151 
1153 Scale&operator=(Scale&& src) noexcept;
1154 
1156 ~Scale();
1157 
1158 #ifndef U_HIDE_INTERNAL_API
1160 Scale(int32_t magnitude, impl::DecNum* arbitraryToAdopt);
1161 #endif/* U_HIDE_INTERNAL_API */
1162 
1163 private:
1164  int32_t fMagnitude;
1165  impl::DecNum* fArbitrary;
1166 UErrorCode fError;
1167 
1168 Scale(UErrorCode error) : fMagnitude(0), fArbitrary(nullptr), fError(error) {}
1169 
1170 Scale() : fMagnitude(0), fArbitrary(nullptr), fError(U_ZERO_ERROR) {}
1171 
1172 bool isValid() const{
1173 return fMagnitude != 0 || fArbitrary !=nullptr;
1174  }
1175 
1176 UBool copyErrorTo(UErrorCode &status) const{
1177 if (U_FAILURE(fError)) {
1178  status = fError;
1179 returntrue;
1180  }
1181 returnfalse;
1182  }
1183 
1184 void applyTo(impl::DecimalQuantity& quantity)const;
1185 
1186 void applyReciprocalTo(impl::DecimalQuantity& quantity)const;
1187 
1188 // To allow MacroProps/MicroProps to initialize empty instances:
1189 friendstructimpl::MacroProps;
1190 friendstructimpl::MicroProps;
1191 
1192 // To allow NumberFormatterImpl to access isBogus() and perform other operations:
1193 friendclassimpl::NumberFormatterImpl;
1194 
1195 // To allow the helper class MultiplierFormatHandler access to private fields:
1196 friendclassimpl::MultiplierFormatHandler;
1197 
1198 // To allow access to the skeleton generation code:
1199 friendclassimpl::GeneratorHelpers;
1200 
1201 // To allow access to parsing code:
1202 friend class ::icu::numparse::impl::NumberParserImpl;
1203 friend class ::icu::numparse::impl::MultiplierParseHandler;
1204 };
1205 
1206 namespaceimpl {
1207 
1208 // Do not enclose entire StringProp with #ifndef U_HIDE_INTERNAL_API, needed for a protected field.
1209 // And do not enclose its class boilerplate within #ifndef U_HIDE_INTERNAL_API.
1214 classU_I18N_APIStringProp :publicUMemory {
1215 
1216 public:
1218 ~StringProp();
1219 
1221 StringProp(constStringProp &other);
1222 
1224 StringProp &operator=(constStringProp &other);
1225 
1226 #ifndef U_HIDE_INTERNAL_API
1227 
1229 StringProp(StringProp &&src) noexcept;
1230 
1232 StringProp &operator=(StringProp &&src) noexcept;
1233 
1235  int16_tlength() const{
1236 return fLength;
1237  }
1238 
1242 voidset(StringPiece value);
1243 
1245 boolisSet() const{
1246 return fLength > 0;
1247  }
1248 
1249 #endif// U_HIDE_INTERNAL_API
1250 
1251 private:
1252 char *fValue;
1253  int16_t fLength;
1254 UErrorCode fError;
1255 
1256 StringProp() : fValue(nullptr), fLength(0), fError(U_ZERO_ERROR) {
1257  }
1258 
1259 UBool copyErrorTo(UErrorCode &status) const{
1260 if (U_FAILURE(fError)) {
1261  status = fError;
1262 returntrue;
1263  }
1264 returnfalse;
1265  }
1266 
1267 // Allow NumberFormatterImpl to access fValue.
1268 friendclassimpl::NumberFormatterImpl;
1269 
1270 // Allow skeleton generation code to access private members.
1271 friendclassimpl::GeneratorHelpers;
1272 
1273 // Allow MacroProps/MicroProps to initialize empty instances and to call
1274 // copyErrorTo().
1275 friendstructimpl::MacroProps;
1276 };
1277 
1278 // Do not enclose entire SymbolsWrapper with #ifndef U_HIDE_INTERNAL_API, needed for a protected field
1280 classU_I18N_APISymbolsWrapper :publicUMemory {
1281 public:
1283 SymbolsWrapper() : fType(SYMPTR_NONE), fPtr{nullptr} {}
1284 
1286 SymbolsWrapper(constSymbolsWrapper &other);
1287 
1289 SymbolsWrapper &operator=(constSymbolsWrapper &other);
1290 
1292 SymbolsWrapper(SymbolsWrapper&& src) noexcept;
1293 
1295 SymbolsWrapper &operator=(SymbolsWrapper&& src) noexcept;
1296 
1298 ~SymbolsWrapper();
1299 
1300 #ifndef U_HIDE_INTERNAL_API
1301 
1306 voidsetTo(constDecimalFormatSymbols &dfs);
1307 
1312 voidsetTo(constNumberingSystem *ns);
1313 
1318 boolisDecimalFormatSymbols()const;
1319 
1324 boolisNumberingSystem()const;
1325 
1330 constDecimalFormatSymbols *getDecimalFormatSymbols()const;
1331 
1336 constNumberingSystem *getNumberingSystem()const;
1337 
1338 #endif// U_HIDE_INTERNAL_API
1339 
1341 UBoolcopyErrorTo(UErrorCode &status) const{
1342 if (fType == SYMPTR_DFS && fPtr.dfs ==nullptr) {
1343  status =U_MEMORY_ALLOCATION_ERROR;
1344 returntrue;
1345  }elseif (fType == SYMPTR_NS && fPtr.ns ==nullptr) {
1346  status =U_MEMORY_ALLOCATION_ERROR;
1347 returntrue;
1348  }
1349 returnfalse;
1350  }
1351 
1352 private:
1353 enum SymbolsPointerType {
1354  SYMPTR_NONE, SYMPTR_DFS, SYMPTR_NS
1355  } fType;
1356 
1357 union{
1358 constDecimalFormatSymbols *dfs;
1359 constNumberingSystem *ns;
1360  } fPtr;
1361 
1362 void doCopyFrom(const SymbolsWrapper &other);
1363 
1364 void doMoveFrom(SymbolsWrapper&& src);
1365 
1366 void doCleanup();
1367 };
1368 
1369 // Do not enclose entire Grouper with #ifndef U_HIDE_INTERNAL_API, needed for a protected field
1371 classU_I18N_APIGrouper :publicUMemory {
1372 public:
1373 #ifndef U_HIDE_INTERNAL_API
1375 staticGrouperforStrategy(UNumberGroupingStrategy grouping);
1376 
1381 staticGrouperforProperties(const DecimalFormatProperties& properties);
1382 
1383 // Future: static Grouper forProperties(DecimalFormatProperties& properties);
1384 
1386 Grouper(int16_t grouping1, int16_t grouping2, int16_t minGrouping,UNumberGroupingStrategy strategy)
1387  : fGrouping1(grouping1),
1388  fGrouping2(grouping2),
1389  fMinGrouping(minGrouping),
1390  fStrategy(strategy) {}
1391 
1393  int16_tgetPrimary()const;
1394 
1396  int16_tgetSecondary()const;
1397 #endif// U_HIDE_INTERNAL_API
1398 
1399 private:
1408  int16_t fGrouping1;
1409  int16_t fGrouping2;
1410 
1418  int16_t fMinGrouping;
1419 
1424 UNumberGroupingStrategy fStrategy;
1425 
1426 Grouper() : fGrouping1(-3) {}
1427 
1428 bool isBogus() const{
1429 return fGrouping1 == -3;
1430  }
1431 
1433 void setLocaleData(const impl::ParsedPatternInfo &patternInfo,constLocale& locale);
1434 
1435 bool groupAtPosition(int32_t position,const impl::DecimalQuantity &value)const;
1436 
1437 // To allow MacroProps/MicroProps to initialize empty instances:
1438 friendstructMacroProps;
1439 friendstructMicroProps;
1440 friendstructSimpleMicroProps;
1441 
1442 // To allow NumberFormatterImpl to access isBogus() and perform other operations:
1443 friendclassNumberFormatterImpl;
1444 friend class ::icu::number::SimpleNumberFormatter;
1445 
1446 // To allow NumberParserImpl to perform setLocaleData():
1447 friend class ::icu::numparse::impl::NumberParserImpl;
1448 
1449 // To allow access to the skeleton generation code:
1450 friendclassimpl::GeneratorHelpers;
1451 };
1452 
1453 // Do not enclose entire Padder with #ifndef U_HIDE_INTERNAL_API, needed for a protected field
1455 classU_I18N_APIPadder :publicUMemory {
1456 public:
1457 #ifndef U_HIDE_INTERNAL_API
1459 staticPaddernone();
1460 
1462 staticPaddercodePoints(UChar32 cp, int32_t targetWidth,UNumberFormatPadPosition position);
1463 
1465 staticPadderforProperties(const DecimalFormatProperties& properties);
1466 #endif// U_HIDE_INTERNAL_API
1467 
1468 private:
1469 UChar32 fWidth;// -3 = error; -2 = bogus; -1 = no padding
1470 union{
1471 struct{
1472  int32_t fCp;
1473 UNumberFormatPadPosition fPosition;
1474  } padding;
1475 UErrorCode errorCode;
1476  } fUnion;
1477 
1478  Padder(UChar32 cp, int32_t width,UNumberFormatPadPosition position);
1479 
1480  Padder(int32_t width);
1481 
1482  Padder(UErrorCode errorCode) : fWidth(-3) {// NOLINT
1483  fUnion.errorCode = errorCode;
1484  }
1485 
1486  Padder() : fWidth(-2) {}// NOLINT
1487 
1488 bool isBogus() const{
1489 return fWidth == -2;
1490  }
1491 
1492 UBool copyErrorTo(UErrorCode &status) const{
1493 if (fWidth == -3) {
1494  status = fUnion.errorCode;
1495 returntrue;
1496  }
1497 returnfalse;
1498  }
1499 
1500 bool isValid() const{
1501 return fWidth > 0;
1502  }
1503 
1504  int32_t padAndApply(const impl::Modifier &mod1,const impl::Modifier &mod2,
1505  FormattedStringBuilder &string, int32_t leftIndex, int32_t rightIndex,
1506 UErrorCode &status)const;
1507 
1508 // To allow MacroProps/MicroProps to initialize empty instances:
1509 friendstructMacroProps;
1510 friendstructMicroProps;
1511 
1512 // To allow NumberFormatterImpl to access isBogus() and perform other operations:
1513 friendclassimpl::NumberFormatterImpl;
1514 
1515 // To allow access to the skeleton generation code:
1516 friendclassimpl::GeneratorHelpers;
1517 };
1518 
1519 // Do not enclose entire MacroProps with #ifndef U_HIDE_INTERNAL_API, needed for a protected field.
1520 // U_I18N_API because intltest uses it.
1522 structU_I18N_API_CLASSMacroProps :publicUMemory {
1524 Notationnotation;
1525 
1527 MeasureUnitunit;// = MeasureUnit(); (the base dimensionless unit)
1528 
1530 MeasureUnitperUnit;// = MeasureUnit(); (the base dimensionless unit)
1531 
1533 Precisionprecision;// = Precision(); (bogus)
1534 
1536 UNumberFormatRoundingMode roundingMode =UNUM_ROUND_HALFEVEN;
1537 
1539 Groupergrouper;// = Grouper(); (bogus)
1540 
1542 Padderpadder;// = Padder(); (bogus)
1543 
1545 IntegerWidthintegerWidth;// = IntegerWidth(); (bogus)
1546 
1548 SymbolsWrappersymbols;
1549 
1550 // UNUM_XYZ_COUNT denotes null (bogus) values.
1551 
1553 UNumberUnitWidth unitWidth =UNUM_UNIT_WIDTH_COUNT;
1554 
1556 UNumberSignDisplay sign =UNUM_SIGN_COUNT;
1557 
1559 bool approximately =false;
1560 
1562 UNumberDecimalSeparatorDisplay decimal =UNUM_DECIMAL_SEPARATOR_COUNT;
1563 
1565 Scalescale;// = Scale(); (benign value)
1566 
1568 StringPropusage;// = StringProp(); (no usage)
1569 
1571 StringPropunitDisplayCase;// = StringProp(); (nominative)
1572 
1574 const AffixPatternProvider* affixProvider =nullptr;// no ownership
1575 
1577 constPluralRules* rules =nullptr;// no ownership
1578 
1580  int32_t threshold = kInternalDefaultThreshold;
1581 
1583 Localelocale;
1584 
1585 // NOTE: Uses default copy and move constructors.
1586 
1591 U_I18N_APIboolcopyErrorTo(UErrorCode &status) const{
1592 return notation.copyErrorTo(status) || precision.copyErrorTo(status) ||
1593  padder.copyErrorTo(status) || integerWidth.copyErrorTo(status) ||
1594  symbols.copyErrorTo(status) || scale.copyErrorTo(status) || usage.copyErrorTo(status) ||
1595  unitDisplayCase.copyErrorTo(status);
1596  }
1597 };
1598 
1599 }// namespace impl
1600 
1601 #if (U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN) && defined(_MSC_VER)
1602 // Ignore MSVC warning 4661. This is generated for NumberFormatterSettings<>::toSkeleton() as this method
1603 // is defined elsewhere (in number_skeletons.cpp). The compiler is warning that the explicit template instantiation
1604 // inside this single translation unit (CPP file) is incomplete, and thus it isn't sure if the template class is
1605 // fully defined. However, since each translation unit explicitly instantiates all the necessary template classes,
1606 // they will all be passed to the linker, and the linker will still find and export all the class members.
1607 #pragma warning(push)
1608 #pragma warning(disable: 4661)
1609 #endif
1610 
1616 template<typename Derived>
1617 classU_I18N_APINumberFormatterSettings {
1618 public:
1647  Derivednotation(constNotation &notation)const &;
1648 
1658  Derivednotation(constNotation &notation) &&;
1659 
1708  Derivedunit(consticu::MeasureUnit &unit)const &;
1709 
1719  Derivedunit(consticu::MeasureUnit &unit) &&;
1720 
1734  DerivedadoptUnit(icu::MeasureUnit *unit)const &;
1735 
1745  DerivedadoptUnit(icu::MeasureUnit *unit) &&;
1746 
1769  DerivedperUnit(consticu::MeasureUnit &perUnit)const &;
1770 
1780  DerivedperUnit(consticu::MeasureUnit &perUnit) &&;
1781 
1795  DerivedadoptPerUnit(icu::MeasureUnit *perUnit)const &;
1796 
1806  DerivedadoptPerUnit(icu::MeasureUnit *perUnit) &&;
1807 
1838  Derivedprecision(constPrecision& precision)const &;
1839 
1849  Derivedprecision(constPrecision& precision) &&;
1850 
1869  DerivedroundingMode(UNumberFormatRoundingMode roundingMode)const &;
1870 
1879  DerivedroundingMode(UNumberFormatRoundingMode roundingMode) &&;
1880 
1908  Derivedgrouping(UNumberGroupingStrategy strategy)const &;
1909 
1919  Derivedgrouping(UNumberGroupingStrategy strategy) &&;
1920 
1945  DerivedintegerWidth(constIntegerWidth &style)const &;
1946 
1956  DerivedintegerWidth(constIntegerWidth &style) &&;
1957 
1998  Derivedsymbols(constDecimalFormatSymbols &symbols)const &;
1999 
2009  Derivedsymbols(constDecimalFormatSymbols &symbols) &&;
2010 
2044  DerivedadoptSymbols(NumberingSystem *symbols)const &;
2045 
2055  DerivedadoptSymbols(NumberingSystem *symbols) &&;
2056 
2082  DerivedunitWidth(UNumberUnitWidth width)const &;
2083 
2093  DerivedunitWidth(UNumberUnitWidth width) &&;
2094 
2120  Derivedsign(UNumberSignDisplay style)const &;
2121 
2131  Derivedsign(UNumberSignDisplay style) &&;
2132 
2158  Deriveddecimal(UNumberDecimalSeparatorDisplay style)const &;
2159 
2169  Deriveddecimal(UNumberDecimalSeparatorDisplay style) &&;
2170 
2195  Derivedscale(constScale &scale)const &;
2196 
2206  Derivedscale(constScale &scale) &&;
2207 
2250  Derivedusage(StringPiece usage)const &;
2251 
2259  Derivedusage(StringPiece usage) &&;
2260 
2269  DeriveddisplayOptions(constDisplayOptions &displayOptions)const &;
2270 
2278  DeriveddisplayOptions(constDisplayOptions &displayOptions) &&;
2279 
2280 #ifndef U_HIDE_INTERNAL_API
2291  DerivedunitDisplayCase(StringPiece unitDisplayCase)const &;
2292 
2302  DerivedunitDisplayCase(StringPiece unitDisplayCase) &&;
2303 #endif// U_HIDE_INTERNAL_API
2304 
2305 #ifndef U_HIDE_INTERNAL_API
2306 
2312  Derivedpadding(constimpl::Padder &padder)const &;
2313 
2315  Derivedpadding(constimpl::Padder &padder) &&;
2316 
2323  Derivedthreshold(int32_t threshold)const &;
2324 
2326  Derivedthreshold(int32_t threshold) &&;
2327 
2333  Derivedmacros(constimpl::MacroProps& macros)const &;
2334 
2336  Derivedmacros(constimpl::MacroProps& macros) &&;
2337 
2339  Derivedmacros(impl::MacroProps&& macros)const &;
2340 
2342  Derivedmacros(impl::MacroProps&& macros) &&;
2343 
2344 #endif/* U_HIDE_INTERNAL_API */
2345 
2363 UnicodeStringtoSkeleton(UErrorCode& status)const;
2364 
2376 LocalPointer<Derived>clone() const &;
2377 
2385 LocalPointer<Derived> clone() &&;
2386 
2393 UBool copyErrorTo(UErrorCode &outErrorCode) const{
2394 if (U_FAILURE(outErrorCode)) {
2395 // Do not overwrite the older error code
2396 returntrue;
2397  }
2398  fMacros.copyErrorTo(outErrorCode);
2399 returnU_FAILURE(outErrorCode);
2400  }
2401 
2402 // NOTE: Uses default copy and move constructors.
2403 
2404 private:
2405 impl::MacroProps fMacros;
2406 
2407 // Don't construct me directly! Use (Un)LocalizedNumberFormatter.
2408 NumberFormatterSettings() =default;
2409 
2410 friendclassLocalizedNumberFormatter;
2411 friendclassUnlocalizedNumberFormatter;
2412 
2413 // Give NumberRangeFormatter access to the MacroProps
2414 friendvoid impl::touchRangeLocales(impl::RangeMacroProps& macros);
2415 friendclassimpl::NumberRangeFormatterImpl;
2416 };
2417 
2418 // Explicit instantiations in source/i18n/number_fluent.cpp.
2419 // (MSVC treats imports/exports of explicit instantiations differently.)
2420 #ifndef _MSC_VER
2421 externtemplateclassNumberFormatterSettings<UnlocalizedNumberFormatter>;
2422 externtemplateclassNumberFormatterSettings<LocalizedNumberFormatter>;
2423 #endif
2424 
2433 classU_I18N_APIUnlocalizedNumberFormatter
2434  :publicNumberFormatterSettings<UnlocalizedNumberFormatter>,publicUMemory {
2435 
2436 public:
2446 LocalizedNumberFormatterlocale(consticu::Locale &locale)const &;
2447 
2457 LocalizedNumberFormatterlocale(consticu::Locale &locale) &&;
2458 
2464 UnlocalizedNumberFormatter() =default;
2465 
2470 UnlocalizedNumberFormatter(constUnlocalizedNumberFormatter &other);
2471 
2477 UnlocalizedNumberFormatter(UnlocalizedNumberFormatter&& src) noexcept;
2478 
2483 UnlocalizedNumberFormatter&operator=(constUnlocalizedNumberFormatter& other);
2484 
2490 UnlocalizedNumberFormatter&operator=(UnlocalizedNumberFormatter&& src) noexcept;
2491 
2492 private:
2493 explicitUnlocalizedNumberFormatter(constNumberFormatterSettings<UnlocalizedNumberFormatter>& other);
2494 
2495 explicitUnlocalizedNumberFormatter(
2496 NumberFormatterSettings<UnlocalizedNumberFormatter>&& src) noexcept;
2497 
2498 explicitUnlocalizedNumberFormatter(constimpl::MacroProps &macros);
2499 
2500 explicitUnlocalizedNumberFormatter(impl::MacroProps &&macros);
2501 
2502 // To give the fluent setters access to this class's constructor:
2503 friendclassNumberFormatterSettings<UnlocalizedNumberFormatter>;
2504 
2505 // To give NumberFormatter::with() access to this class's constructor:
2506 friendclassNumberFormatter;
2507 
2508 // To give LNF::withoutLocale() access to this class's constructor:
2509 friendclassLocalizedNumberFormatter;
2510 };
2511 
2520 classU_I18N_APILocalizedNumberFormatter
2521  :publicNumberFormatterSettings<LocalizedNumberFormatter>,publicUMemory {
2522 public:
2534 FormattedNumberformatInt(int64_t value,UErrorCode &status)const;
2535 
2547 FormattedNumberformatDouble(double value,UErrorCode &status)const;
2548 
2563 FormattedNumberformatDecimal(StringPiece value,UErrorCode& status)const;
2564 
2565 #ifndef U_HIDE_INTERNAL_API
2566 
2567 
2571 constDecimalFormatSymbols*getDecimalFormatSymbols()const;
2572 
2576 FormattedNumberformatDecimalQuantity(const impl::DecimalQuantity& dq,UErrorCode& status)const;
2577 
2581 voidgetAffixImpl(bool isPrefix,bool isNegative,UnicodeString& result,UErrorCode& status)const;
2582 
2587 const impl::NumberFormatterImpl*getCompiled()const;
2588 
2593  int32_tgetCallCount()const;
2594 
2595 #endif/* U_HIDE_INTERNAL_API */
2596 
2610 Format*toFormat(UErrorCode& status)const;
2611 
2618 UnlocalizedNumberFormatterwithoutLocale() const &;
2619 
2627 UnlocalizedNumberFormatter withoutLocale() &&;
2628 
2634 LocalizedNumberFormatter() = default;
2635 
2640 LocalizedNumberFormatter(constLocalizedNumberFormatter &other);
2641 
2647 LocalizedNumberFormatter(LocalizedNumberFormatter&& src) noexcept;
2648 
2653 LocalizedNumberFormatter& operator=(constLocalizedNumberFormatter& other);
2654 
2660 LocalizedNumberFormatter& operator=(LocalizedNumberFormatter&& src) noexcept;
2661 
2662 #ifndef U_HIDE_INTERNAL_API
2663 
2676 voidformatImpl(impl::UFormattedNumberData *results,UErrorCode &status)const;
2677 
2678 #endif/* U_HIDE_INTERNAL_API */
2679 
2684 ~LocalizedNumberFormatter();
2685 
2686 private:
2687 // Note: fCompiled can't be a LocalPointer because impl::NumberFormatterImpl is defined in an internal
2688 // header, and LocalPointer needs the full class definition in order to delete the instance.
2689 const impl::NumberFormatterImpl* fCompiled {nullptr};
2690 char fUnsafeCallCount[8] {};// internally cast to u_atomic_int32_t
2691 
2692 // Owned pointer to a DecimalFormatWarehouse, used when copying a LocalizedNumberFormatter
2693 // from a DecimalFormat.
2694 const impl::DecimalFormatWarehouse* fWarehouse {nullptr};
2695 
2696 explicit LocalizedNumberFormatter(const NumberFormatterSettings<LocalizedNumberFormatter>& other);
2697 
2698 explicit LocalizedNumberFormatter(NumberFormatterSettings<LocalizedNumberFormatter>&& src) noexcept;
2699 
2700  LocalizedNumberFormatter(const impl::MacroProps &macros,const Locale &locale);
2701 
2702  LocalizedNumberFormatter(impl::MacroProps &&macros,const Locale &locale);
2703 
2704 void resetCompiled();
2705 
2706 void lnfMoveHelper(LocalizedNumberFormatter&& src);
2707 
2708 void lnfCopyHelper(const LocalizedNumberFormatter& src,UErrorCode& status);
2709 
2713 bool computeCompiled(UErrorCode& status)const;
2714 
2715 // To give the fluent setters access to this class's constructor:
2716 friendclassNumberFormatterSettings<UnlocalizedNumberFormatter>;
2717 friendclassNumberFormatterSettings<LocalizedNumberFormatter>;
2718 
2719 // To give UnlocalizedNumberFormatter::locale() access to this class's constructor:
2720 friendclassUnlocalizedNumberFormatter;
2721 };
2722 
2723 #if (U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN) && defined(_MSC_VER)
2724 // Warning 4661.
2725 #pragma warning(pop)
2726 #endif
2727 
2733 classU_I18N_APINumberFormatterfinal {
2734 public:
2742 staticUnlocalizedNumberFormatterwith();
2743 
2753 staticLocalizedNumberFormatterwithLocale(constLocale &locale);
2754 
2772 staticUnlocalizedNumberFormatterforSkeleton(constUnicodeString& skeleton,UErrorCode& status);
2773 
2794 staticUnlocalizedNumberFormatterforSkeleton(constUnicodeString& skeleton,
2795 UParseError& perror,UErrorCode& status);
2796 
2800 NumberFormatter() =delete;
2801 };
2802 
2803 }// namespace number
2804 U_NAMESPACE_END
2805 
2806 #endif/* #if !UCONFIG_NO_FORMATTING */
2807 
2808 #endif/* U_SHOW_CPLUSPLUS_API */
2809 
2810 #endif// __NUMBERFORMATTER_H__
appendable.h
C++ API: Appendable class: Sink for Unicode code points and 16-bit code units (char16_ts).
bytestream.h
C++ API: Interface for writing bytes, and implementation classes.
icu::CurrencyUnit
A unit of currency, such as USD (U.S.
Definition:currunit.h:39
icu::DecimalFormatSymbols
This class represents the set of symbols needed by DecimalFormat to format numbers.
Definition:dcfmtsym.h:86
icu::DisplayOptions
Represents all the display options that are supported by CLDR such as grammatical case,...
Definition:displayoptions.h:43
icu::Format
Base class for all formats.
Definition:format.h:98
icu::LocalPointer
"Smart pointer" class, deletes objects via the standard C++ delete operator.
Definition:localpointer.h:189
icu::Locale
A Locale object represents a specific geographical, political, or cultural region.
Definition:locid.h:198
icu::MeasureUnit
A unit such as length, mass, volume, currency, etc.
Definition:measunit.h:405
icu::NumberingSystem
Defines numbering systems.
Definition:numsys.h:60
icu::PluralRules
Defines rules for mapping non-negative numeric values onto a small set of keywords.
Definition:plurrule.h:212
icu::StringPiece
A string-like object that points to a sized piece of memory.
Definition:stringpiece.h:61
icu::UMemory
UMemory is the common ICU base class.
Definition:uobject.h:115
icu::UnicodeString
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
Definition:unistr.h:303
icu::number::CurrencyPrecision
A class that defines a rounding precision parameterized by a currency to be used when formatting numb...
Definition:numberformatter.h:915
icu::number::CurrencyPrecision::withCurrency
Precision withCurrency(const CurrencyUnit &currency) const
Associates a currency with this rounding precision.
icu::number::FormattedNumber
The result of a number formatting operation.
Definition:formattednumber.h:48
icu::number::FractionPrecision
A class that defines a rounding precision based on a number of fraction places and optionally signifi...
Definition:numberformatter.h:839
icu::number::FractionPrecision::withMinDigits
Precision withMinDigits(int32_t minSignificantDigits) const
Ensure that no less than this number of significant digits are retained when rounding according to fr...
icu::number::FractionPrecision::withSignificantDigits
Precision withSignificantDigits(int32_t minSignificantDigits, int32_t maxSignificantDigits, UNumberRoundingPriority priority) const
Override maximum fraction digits with maximum significant digits depending on the magnitude of the nu...
icu::number::FractionPrecision::withMaxDigits
Precision withMaxDigits(int32_t maxSignificantDigits) const
Ensure that no more than this number of significant digits are retained when rounding according to fr...
icu::number::IncrementPrecision
A class that defines a rounding precision parameterized by a rounding increment to be used when forma...
Definition:numberformatter.h:953
icu::number::IncrementPrecision::withMinFraction
Precision withMinFraction(int32_t minFrac) const
Specifies the minimum number of fraction digits to render after the decimal separator,...
icu::number::IntegerWidth
A class that defines the strategy for padding and truncating integers before the decimal separator.
Definition:numberformatter.h:989
icu::number::IntegerWidth::zeroFillTo
static IntegerWidth zeroFillTo(int32_t minInt)
Pad numbers at the beginning with zeros to guarantee a certain number of numerals before the decimal ...
icu::number::IntegerWidth::truncateAt
IntegerWidth truncateAt(int32_t maxInt)
Truncate numbers exceeding a certain number of numerals before the decimal separator.
icu::number::LocalizedNumberFormatter
A NumberFormatter that has a locale associated with it; this means .format() methods are available.
Definition:numberformatter.h:2521
icu::number::LocalizedNumberFormatter::getDecimalFormatSymbols
const DecimalFormatSymbols * getDecimalFormatSymbols() const
icu::number::LocalizedNumberFormatter::getCompiled
const impl::NumberFormatterImpl * getCompiled() const
Internal method for testing.
icu::number::LocalizedNumberFormatter::withoutLocale
UnlocalizedNumberFormatter withoutLocale() const &
Disassociate the locale from this formatter.
icu::number::LocalizedNumberFormatter::formatInt
FormattedNumber formatInt(int64_t value, UErrorCode &status) const
Format the given integer number to a string using the settings specified in the NumberFormatter fluen...
icu::number::LocalizedNumberFormatter::getCallCount
int32_t getCallCount() const
Internal method for testing.
icu::number::LocalizedNumberFormatter::~LocalizedNumberFormatter
~LocalizedNumberFormatter()
Destruct this LocalizedNumberFormatter, cleaning up any memory it might own.
icu::number::LocalizedNumberFormatter::toFormat
Format * toFormat(UErrorCode &status) const
Creates a representation of this LocalizedNumberFormat as an icu::Format, enabling the use of this nu...
icu::number::LocalizedNumberFormatter::formatImpl
void formatImpl(impl::UFormattedNumberData *results, UErrorCode &status) const
This is the core entrypoint to the number formatting pipeline.
icu::number::LocalizedNumberFormatter::formatDecimal
FormattedNumber formatDecimal(StringPiece value, UErrorCode &status) const
Format the given decimal number to a string using the settings specified in the NumberFormatter fluen...
icu::number::LocalizedNumberFormatter::getAffixImpl
void getAffixImpl(bool isPrefix, bool isNegative, UnicodeString &result, UErrorCode &status) const
Internal method for DecimalFormat compatibility.
icu::number::LocalizedNumberFormatter::formatDecimalQuantity
FormattedNumber formatDecimalQuantity(const impl::DecimalQuantity &dq, UErrorCode &status) const
Internal method.
icu::number::LocalizedNumberFormatter::formatDouble
FormattedNumber formatDouble(double value, UErrorCode &status) const
Format the given float or double to a string using the settings specified in the NumberFormatter flue...
icu::number::Notation
A class that defines the notation style to be used when formatting numbers in NumberFormatter.
Definition:numberformatter.h:203
icu::number::Notation::compactShort
static CompactNotation compactShort()
Print the number using short-form compact notation.
icu::number::Notation::engineering
static ScientificNotation engineering()
Print the number using engineering notation, a variant of scientific notation in which the exponent m...
icu::number::Notation::compactLong
static CompactNotation compactLong()
Print the number using long-form compact notation.
icu::number::Notation::simple
static SimpleNotation simple()
Print the number using simple notation without any scaling by powers of ten.
icu::number::Notation::scientific
static ScientificNotation scientific()
Print the number using scientific notation (also known as scientific form, standard index form,...
icu::number::NumberFormatterSettings
An abstract base class for specifying settings related to number formatting.
Definition:numberformatter.h:1617
icu::number::NumberFormatterSettings::unitDisplayCase
Derived unitDisplayCase(StringPiece unitDisplayCase) &&
NOTE: Use displayOptions instead.
icu::number::NumberFormatterSettings::adoptSymbols
Derived adoptSymbols(NumberingSystem *symbols) const &
Specifies that the given numbering system should be used when fetching symbols.
icu::number::NumberFormatterSettings::precision
Derived precision(const Precision &precision) const &
Specifies the rounding precision to use when formatting numbers.
icu::number::NumberFormatterSettings::decimal
Derived decimal(UNumberDecimalSeparatorDisplay style) &&
Overload of decimal() for use on an rvalue reference.
icu::number::NumberFormatterSettings::unitWidth
Derived unitWidth(UNumberUnitWidth width) const &
Sets the width of the unit (measure unit or currency).
icu::number::NumberFormatterSettings::adoptUnit
Derived adoptUnit(icu::MeasureUnit *unit) const &
Like unit(), but takes ownership of a pointer.
icu::number::NumberFormatterSettings::perUnit
Derived perUnit(const icu::MeasureUnit &perUnit) &&
Overload of perUnit() for use on an rvalue reference.
icu::number::NumberFormatterSettings::padding
Derived padding(const impl::Padder &padder) &&
icu::number::NumberFormatterSettings::adoptSymbols
Derived adoptSymbols(NumberingSystem *symbols) &&
Overload of adoptSymbols() for use on an rvalue reference.
icu::number::NumberFormatterSettings::macros
Derived macros(const impl::MacroProps &macros) &&
icu::number::NumberFormatterSettings::roundingMode
Derived roundingMode(UNumberFormatRoundingMode roundingMode) &&
Overload of roundingMode() for use on an rvalue reference.
icu::number::NumberFormatterSettings::integerWidth
Derived integerWidth(const IntegerWidth &style) const &
Specifies the minimum and maximum number of digits to render before the decimal mark.
icu::number::NumberFormatterSettings::macros
Derived macros(const impl::MacroProps &macros) const &
Internal fluent setter to overwrite the entire macros object.
icu::number::NumberFormatterSettings::threshold
Derived threshold(int32_t threshold) const &
Internal fluent setter to support a custom regulation threshold.
icu::number::NumberFormatterSettings::perUnit
Derived perUnit(const icu::MeasureUnit &perUnit) const &
Sets a unit to be used in the denominator.
icu::number::NumberFormatterSettings::integerWidth
Derived integerWidth(const IntegerWidth &style) &&
Overload of integerWidth() for use on an rvalue reference.
icu::number::NumberFormatterSettings::unitDisplayCase
Derived unitDisplayCase(StringPiece unitDisplayCase) const &
NOTE: Use displayOptions instead.
icu::number::NumberFormatterSettings::grouping
Derived grouping(UNumberGroupingStrategy strategy) const &
Specifies the grouping strategy to use when formatting numbers.
icu::number::NumberFormatterSettings::unit
Derived unit(const icu::MeasureUnit &unit) const &
Specifies the unit (unit of measure, currency, or percent) to associate with rendered numbers.
icu::number::NumberFormatterSettings::displayOptions
Derived displayOptions(const DisplayOptions &displayOptions) const &
Specifies the DisplayOptions.
icu::number::NumberFormatterSettings::usage
Derived usage(StringPiece usage) &&
Overload of usage() for use on an rvalue reference.
icu::number::NumberFormatterSettings::displayOptions
Derived displayOptions(const DisplayOptions &displayOptions) &&
Overload of displayOptions() for use on an rvalue reference.
icu::number::NumberFormatterSettings::adoptPerUnit
Derived adoptPerUnit(icu::MeasureUnit *perUnit) const &
Like perUnit(), but takes ownership of a pointer.
icu::number::NumberFormatterSettings::adoptUnit
Derived adoptUnit(icu::MeasureUnit *unit) &&
Overload of adoptUnit() for use on an rvalue reference.
icu::number::NumberFormatterSettings::scale
Derived scale(const Scale &scale) &&
Overload of scale() for use on an rvalue reference.
icu::number::NumberFormatterSettings::precision
Derived precision(const Precision &precision) &&
Overload of precision() for use on an rvalue reference.
icu::number::NumberFormatterSettings::symbols
Derived symbols(const DecimalFormatSymbols &symbols) &&
Overload of symbols() for use on an rvalue reference.
icu::number::NumberFormatterSettings::padding
Derived padding(const impl::Padder &padder) const &
Set the padding strategy.
icu::number::NumberFormatterSettings::notation
Derived notation(const Notation &notation) const &
Specifies the notation style (simple, scientific, or compact) for rendering numbers.
icu::number::NumberFormatterSettings::sign
Derived sign(UNumberSignDisplay style) const &
Sets the plus/minus sign display strategy.
icu::number::NumberFormatterSettings::threshold
Derived threshold(int32_t threshold) &&
icu::number::NumberFormatterSettings::roundingMode
Derived roundingMode(UNumberFormatRoundingMode roundingMode) const &
Specifies how to determine the direction to round a number when it has more digits than fit in the de...
icu::number::NumberFormatterSettings::symbols
Derived symbols(const DecimalFormatSymbols &symbols) const &
Specifies the symbols (decimal separator, grouping separator, percent sign, numerals,...
icu::number::NumberFormatterSettings::macros
Derived macros(impl::MacroProps &&macros) &&
icu::number::NumberFormatterSettings::clone
LocalPointer< Derived > clone() const &
Returns the current (Un)LocalizedNumberFormatter as a LocalPointer wrapping a heap-allocated copy of ...
icu::number::NumberFormatterSettings::sign
Derived sign(UNumberSignDisplay style) &&
Overload of sign() for use on an rvalue reference.
icu::number::NumberFormatterSettings::toSkeleton
UnicodeString toSkeleton(UErrorCode &status) const
Creates a skeleton string representation of this number formatter.
icu::number::NumberFormatterSettings::grouping
Derived grouping(UNumberGroupingStrategy strategy) &&
Overload of grouping() for use on an rvalue reference.
icu::number::NumberFormatterSettings::usage
Derived usage(StringPiece usage) const &
Specifies the usage for which numbers will be formatted ("person-height", "road", "rainfall",...
icu::number::NumberFormatterSettings::adoptPerUnit
Derived adoptPerUnit(icu::MeasureUnit *perUnit) &&
Overload of adoptPerUnit() for use on an rvalue reference.
icu::number::NumberFormatterSettings::unitWidth
Derived unitWidth(UNumberUnitWidth width) &&
Overload of unitWidth() for use on an rvalue reference.
icu::number::NumberFormatterSettings::decimal
Derived decimal(UNumberDecimalSeparatorDisplay style) const &
Sets the decimal separator display strategy.
icu::number::NumberFormatterSettings::unit
Derived unit(const icu::MeasureUnit &unit) &&
Overload of unit() for use on an rvalue reference.
icu::number::NumberFormatterSettings::macros
Derived macros(impl::MacroProps &&macros) const &
icu::number::NumberFormatterSettings::scale
Derived scale(const Scale &scale) const &
Sets a scale (multiplier) to be used to scale the number by an arbitrary amount before formatting.
icu::number::NumberFormatterSettings::notation
Derived notation(const Notation &notation) &&
Overload of notation() for use on an rvalue reference.
icu::number::NumberFormatter
See the main description in numberformatter.h for documentation and examples.
Definition:numberformatter.h:2733
icu::number::NumberFormatter::forSkeleton
static UnlocalizedNumberFormatter forSkeleton(const UnicodeString &skeleton, UParseError &perror, UErrorCode &status)
Call this method at the beginning of a NumberFormatter fluent chain to create an instance based on a ...
icu::number::NumberFormatter::forSkeleton
static UnlocalizedNumberFormatter forSkeleton(const UnicodeString &skeleton, UErrorCode &status)
Call this method at the beginning of a NumberFormatter fluent chain to create an instance based on a ...
icu::number::NumberFormatter::with
static UnlocalizedNumberFormatter with()
Call this method at the beginning of a NumberFormatter fluent chain in which the locale is not curren...
icu::number::NumberFormatter::NumberFormatter
NumberFormatter()=delete
Use factory methods instead of the constructor to create a NumberFormatter.
icu::number::NumberFormatter::withLocale
static LocalizedNumberFormatter withLocale(const Locale &locale)
Call this method at the beginning of a NumberFormatter fluent chain in which the locale is known at t...
icu::number::Precision
A class that defines the rounding precision to be used when formatting numbers in NumberFormatter.
Definition:numberformatter.h:474
icu::number::Precision::maxSignificantDigits
static SignificantDigitsPrecision maxSignificantDigits(int32_t maxSignificantDigits)
Show numbers rounded if necessary to a certain number of significant digits/figures.
icu::number::Precision::fixedFraction
static FractionPrecision fixedFraction(int32_t minMaxFractionPlaces)
Show numbers rounded if necessary to a certain number of fraction places (numerals after the decimal ...
icu::number::Precision::minSignificantDigits
static SignificantDigitsPrecision minSignificantDigits(int32_t minSignificantDigits)
Always show at least a certain number of significant digits/figures, padding with zeros if necessary.
icu::number::Precision::maxFraction
static FractionPrecision maxFraction(int32_t maxFractionPlaces)
Show numbers rounded if necessary to a certain number of fraction places (numerals after the decimal ...
icu::number::Precision::increment
static IncrementPrecision increment(double roundingIncrement)
Show numbers rounded if necessary to the closest multiple of a certain rounding increment.
icu::number::Precision::currency
static CurrencyPrecision currency(UCurrencyUsage currencyUsage)
Show numbers rounded and padded according to the rules for the currency unit.
icu::number::Precision::minFraction
static FractionPrecision minFraction(int32_t minFractionPlaces)
Always show at least a certain number of fraction places after the decimal separator,...
icu::number::Precision::trailingZeroDisplay
Precision trailingZeroDisplay(UNumberTrailingZeroDisplay trailingZeroDisplay) const
Configure how trailing zeros are displayed on numbers.
icu::number::Precision::unlimited
static Precision unlimited()
Show all available digits to full precision.
icu::number::Precision::integer
static FractionPrecision integer()
Show numbers rounded if necessary to the nearest integer.
icu::number::Precision::fixedSignificantDigits
static SignificantDigitsPrecision fixedSignificantDigits(int32_t minMaxSignificantDigits)
Show numbers rounded if necessary to a certain number of significant digits or significant figures.
icu::number::Precision::incrementExact
static IncrementPrecision incrementExact(uint64_t mantissa, int16_t magnitude)
Version of Precision::increment() that takes an integer at a particular power of 10.
icu::number::Precision::minMaxFraction
static FractionPrecision minMaxFraction(int32_t minFractionPlaces, int32_t maxFractionPlaces)
Show numbers rounded if necessary to a certain number of fraction places (numerals after the decimal ...
icu::number::Precision::minMaxSignificantDigits
static SignificantDigitsPrecision minMaxSignificantDigits(int32_t minSignificantDigits, int32_t maxSignificantDigits)
Show numbers rounded if necessary to a certain number of significant digits/figures; in addition,...
icu::number::Scale
A class that defines a quantity by which a number should be multiplied when formatting.
Definition:numberformatter.h:1086
icu::number::Scale::none
static Scale none()
Do not change the value of numbers when formatting or parsing.
icu::number::Scale::operator=
Scale & operator=(const Scale &other)
icu::number::Scale::powerOfTen
static Scale powerOfTen(int32_t power)
Multiply numbers by a power of ten before formatting.
icu::number::Scale::Scale
Scale(const Scale &other)
icu::number::Scale::byDoubleAndPowerOfTen
static Scale byDoubleAndPowerOfTen(double multiplicand, int32_t power)
Multiply a number by both a power of ten and by an arbitrary double value.
icu::number::Scale::byDecimal
static Scale byDecimal(StringPiece multiplicand)
Multiply numbers by an arbitrary value before formatting.
icu::number::Scale::Scale
Scale(int32_t magnitude, impl::DecNum *arbitraryToAdopt)
icu::number::Scale::Scale
Scale(Scale &&src) noexcept
icu::number::Scale::~Scale
~Scale()
icu::number::Scale::byDouble
static Scale byDouble(double multiplicand)
Multiply numbers by an arbitrary value before formatting.
icu::number::Scale::operator=
Scale & operator=(Scale &&src) noexcept
icu::number::ScientificNotation
A class that defines the scientific notation style to be used when formatting numbers in NumberFormat...
Definition:numberformatter.h:413
icu::number::ScientificNotation::withExponentSignDisplay
ScientificNotation withExponentSignDisplay(UNumberSignDisplay exponentSignDisplay) const
Sets whether to show the sign on positive and negative exponents in scientific notation.
icu::number::ScientificNotation::withMinExponentDigits
ScientificNotation withMinExponentDigits(int32_t minExponentDigits) const
Sets the minimum number of digits to show in the exponent of scientific notation, padding with zeros ...
icu::number::UnlocalizedNumberFormatter
A NumberFormatter that does not yet have a locale.
Definition:numberformatter.h:2434
icu::number::UnlocalizedNumberFormatter::UnlocalizedNumberFormatter
UnlocalizedNumberFormatter()=default
Default constructor: puts the formatter into a valid but undefined state.
icu::number::UnlocalizedNumberFormatter::operator=
UnlocalizedNumberFormatter & operator=(const UnlocalizedNumberFormatter &other)
Copy assignment operator.
icu::number::UnlocalizedNumberFormatter::UnlocalizedNumberFormatter
UnlocalizedNumberFormatter(const UnlocalizedNumberFormatter &other)
Returns a copy of this UnlocalizedNumberFormatter.
icu::number::UnlocalizedNumberFormatter::locale
LocalizedNumberFormatter locale(const icu::Locale &locale) &&
Overload of locale() for use on an rvalue reference.
icu::number::UnlocalizedNumberFormatter::UnlocalizedNumberFormatter
UnlocalizedNumberFormatter(UnlocalizedNumberFormatter &&src) noexcept
Move constructor: The source UnlocalizedNumberFormatter will be left in a valid but undefined state.
icu::number::UnlocalizedNumberFormatter::operator=
UnlocalizedNumberFormatter & operator=(UnlocalizedNumberFormatter &&src) noexcept
Move assignment operator: The source UnlocalizedNumberFormatter will be left in a valid but undefined...
icu::number::UnlocalizedNumberFormatter::locale
LocalizedNumberFormatter locale(const icu::Locale &locale) const &
Associate the given locale with the number formatter.
icu::number::impl::Grouper
Definition:numberformatter.h:1371
icu::number::impl::Grouper::forStrategy
static Grouper forStrategy(UNumberGroupingStrategy grouping)
icu::number::impl::Grouper::Grouper
Grouper(int16_t grouping1, int16_t grouping2, int16_t minGrouping, UNumberGroupingStrategy strategy)
Definition:numberformatter.h:1386
icu::number::impl::Grouper::getSecondary
int16_t getSecondary() const
icu::number::impl::Grouper::forProperties
static Grouper forProperties(const DecimalFormatProperties &properties)
Resolve the values in Properties to a Grouper object.
icu::number::impl::Grouper::getPrimary
int16_t getPrimary() const
icu::number::impl::Padder
Definition:numberformatter.h:1455
icu::number::impl::Padder::forProperties
static Padder forProperties(const DecimalFormatProperties &properties)
icu::number::impl::Padder::codePoints
static Padder codePoints(UChar32 cp, int32_t targetWidth, UNumberFormatPadPosition position)
icu::number::impl::Padder::none
static Padder none()
icu::number::impl::StringProp
Manages NumberFormatterSettings::usage()'s char* instance on the heap.
Definition:numberformatter.h:1214
icu::number::impl::StringProp::StringProp
StringProp(StringProp &&src) noexcept
icu::number::impl::StringProp::StringProp
StringProp(const StringProp &other)
icu::number::impl::StringProp::length
int16_t length() const
Definition:numberformatter.h:1235
icu::number::impl::StringProp::isSet
bool isSet() const
Definition:numberformatter.h:1245
icu::number::impl::StringProp::~StringProp
~StringProp()
icu::number::impl::StringProp::operator=
StringProp & operator=(StringProp &&src) noexcept
icu::number::impl::StringProp::operator=
StringProp & operator=(const StringProp &other)
icu::number::impl::StringProp::set
void set(StringPiece value)
icu::number::impl::SymbolsWrapper
Definition:numberformatter.h:1280
icu::number::impl::SymbolsWrapper::SymbolsWrapper
SymbolsWrapper()
Definition:numberformatter.h:1283
icu::number::impl::SymbolsWrapper::operator=
SymbolsWrapper & operator=(const SymbolsWrapper &other)
icu::number::impl::SymbolsWrapper::getNumberingSystem
const NumberingSystem * getNumberingSystem() const
Get the NumberingSystem pointer.
icu::number::impl::SymbolsWrapper::isNumberingSystem
bool isNumberingSystem() const
Whether the object is currently holding a NumberingSystem.
icu::number::impl::SymbolsWrapper::getDecimalFormatSymbols
const DecimalFormatSymbols * getDecimalFormatSymbols() const
Get the DecimalFormatSymbols pointer.
icu::number::impl::SymbolsWrapper::~SymbolsWrapper
~SymbolsWrapper()
icu::number::impl::SymbolsWrapper::SymbolsWrapper
SymbolsWrapper(const SymbolsWrapper &other)
icu::number::impl::SymbolsWrapper::SymbolsWrapper
SymbolsWrapper(SymbolsWrapper &&src) noexcept
icu::number::impl::SymbolsWrapper::setTo
void setTo(const DecimalFormatSymbols &dfs)
The provided object is copied, but we do not adopt it.
icu::number::impl::SymbolsWrapper::operator=
SymbolsWrapper & operator=(SymbolsWrapper &&src) noexcept
icu::number::impl::SymbolsWrapper::setTo
void setTo(const NumberingSystem *ns)
Adopt the provided object.
icu::number::impl::SymbolsWrapper::copyErrorTo
UBool copyErrorTo(UErrorCode &status) const
Definition:numberformatter.h:1341
icu::number::impl::SymbolsWrapper::isDecimalFormatSymbols
bool isDecimalFormatSymbols() const
Whether the object is currently holding a DecimalFormatSymbols.
currunit.h
C++ API: Currency Unit Information.
dcfmtsym.h
C++ API: Symbols for formatting numbers.
displayoptions.h
C++ API: Display options class.
fieldpos.h
C++ API: FieldPosition identifies the fields in a formatted output.
formattednumber.h
C API: Formatted number result from various number formatting functions.
fpositer.h
C++ API: FieldPosition Iterator.
measunit.h
C++ API: A unit for measuring a quantity.
icu::operator==
U_COMMON_API UBool operator==(const StringPiece &x, const StringPiece &y)
Global operator == for StringPiece.
nounit.h
C++ API: units for percent and permille.
icu::number::impl::digits_t
int16_t digits_t
Datatype for minimum/maximum fraction digits.
Definition:numberformatter.h:134
icu::number::impl::touchRangeLocales
void touchRangeLocales(impl::RangeMacroProps &macros)
Used for NumberRangeFormatter and implemented in numrange_fluent.cpp.
parseerr.h
C API: Parse Error Information.
plurrule.h
C++ API: PluralRules object.
UParseError
A UParseError struct is used to returned detailed information about parsing errors.
Definition:parseerr.h:58
icu::number::Notation::NotationUnion::ScientificSettings
Definition:numberformatter.h:356
icu::number::Notation::NotationUnion::ScientificSettings::fRequireMinInt
bool fRequireMinInt
Definition:numberformatter.h:360
icu::number::Notation::NotationUnion::ScientificSettings::fMinExponentDigits
impl::digits_t fMinExponentDigits
Definition:numberformatter.h:362
icu::number::Notation::NotationUnion::ScientificSettings::fExponentSignDisplay
UNumberSignDisplay fExponentSignDisplay
Definition:numberformatter.h:364
icu::number::Notation::NotationUnion::ScientificSettings::fEngineeringInterval
int8_t fEngineeringInterval
Definition:numberformatter.h:358
icu::number::Precision::PrecisionUnion::FractionSignificantSettings
Definition:numberformatter.h:727
icu::number::Precision::PrecisionUnion::FractionSignificantSettings::fMinFrac
impl::digits_t fMinFrac
Definition:numberformatter.h:730
icu::number::Precision::PrecisionUnion::FractionSignificantSettings::fRetain
bool fRetain
Whether to retain trailing zeros based on the looser strategy.
Definition:numberformatter.h:743
icu::number::Precision::PrecisionUnion::FractionSignificantSettings::fMaxSig
impl::digits_t fMaxSig
Definition:numberformatter.h:736
icu::number::Precision::PrecisionUnion::FractionSignificantSettings::fPriority
UNumberRoundingPriority fPriority
Definition:numberformatter.h:738
icu::number::Precision::PrecisionUnion::FractionSignificantSettings::fMaxFrac
impl::digits_t fMaxFrac
Definition:numberformatter.h:732
icu::number::Precision::PrecisionUnion::FractionSignificantSettings::fMinSig
impl::digits_t fMinSig
Definition:numberformatter.h:734
icu::number::Precision::PrecisionUnion::IncrementSettings
Definition:numberformatter.h:746
icu::number::Precision::PrecisionUnion::IncrementSettings::fIncrementMagnitude
impl::digits_t fIncrementMagnitude
Definition:numberformatter.h:753
icu::number::Precision::PrecisionUnion::IncrementSettings::fIncrement
uint64_t fIncrement
Definition:numberformatter.h:751
icu::number::Precision::PrecisionUnion::IncrementSettings::fMinFrac
impl::digits_t fMinFrac
Definition:numberformatter.h:755
icu::number::impl::MacroProps
Definition:numberformatter.h:1522
icu::number::impl::MacroProps::perUnit
MeasureUnit perUnit
Definition:numberformatter.h:1530
icu::number::impl::MacroProps::scale
Scale scale
Definition:numberformatter.h:1565
icu::number::impl::MacroProps::copyErrorTo
U_I18N_API bool copyErrorTo(UErrorCode &status) const
Check all members for errors.
Definition:numberformatter.h:1591
icu::number::impl::MacroProps::usage
StringProp usage
Definition:numberformatter.h:1568
icu::number::impl::MacroProps::unitDisplayCase
StringProp unitDisplayCase
Definition:numberformatter.h:1571
icu::number::impl::MacroProps::locale
Locale locale
Definition:numberformatter.h:1583
icu::number::impl::MacroProps::precision
Precision precision
Definition:numberformatter.h:1533
icu::number::impl::MacroProps::integerWidth
IntegerWidth integerWidth
Definition:numberformatter.h:1545
icu::number::impl::MacroProps::padder
Padder padder
Definition:numberformatter.h:1542
icu::number::impl::MacroProps::grouper
Grouper grouper
Definition:numberformatter.h:1539
icu::number::impl::MacroProps::unit
MeasureUnit unit
Definition:numberformatter.h:1527
icu::number::impl::MacroProps::notation
Notation notation
Definition:numberformatter.h:1524
icu::number::impl::MacroProps::symbols
SymbolsWrapper symbols
Definition:numberformatter.h:1548
icu::number::impl::RangeMacroProps
Definition:numberrangeformatter.h:77
ucurr.h
C API: Encapsulates information about a currency.
UCurrencyUsage
UCurrencyUsage
Currency Usage used for Decimal Format.
Definition:ucurr.h:41
UChar32
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
Definition:umachine.h:449
UBool
int8_t UBool
The ICU boolean type, a signed-byte integer.
Definition:umachine.h:269
unum.h
C API: Compatibility APIs for number formatting.
UNumberCompactStyle
UNumberCompactStyle
Constants for specifying short or long format.
Definition:unum.h:289
UNumberFormatPadPosition
UNumberFormatPadPosition
The possible number format pad positions.
Definition:unum.h:278
unumberformatter.h
C API: Localized number formatting; not recommended for C++.
UNumberRoundingPriority
UNumberRoundingPriority
An enum declaring how to resolve conflicts between maximum fraction digits and maximum significant di...
Definition:unumberformatter.h:118
UNumberSignDisplay
UNumberSignDisplay
An enum declaring how to denote positive and negative numbers.
Definition:unumberformatter.h:264
UNUM_SIGN_COUNT
@ UNUM_SIGN_COUNT
One more than the highest UNumberSignDisplay value.
Definition:unumberformatter.h:355
UNumberDecimalSeparatorDisplay
UNumberDecimalSeparatorDisplay
An enum declaring how to render the decimal separator.
Definition:unumberformatter.h:369
UNUM_DECIMAL_SEPARATOR_COUNT
@ UNUM_DECIMAL_SEPARATOR_COUNT
One more than the highest UNumberDecimalSeparatorDisplay value.
Definition:unumberformatter.h:392
UNumberTrailingZeroDisplay
UNumberTrailingZeroDisplay
An enum declaring how to render trailing zeros.
Definition:unumberformatter.h:403
UNUM_TRAILING_ZERO_AUTO
@ UNUM_TRAILING_ZERO_AUTO
Display trailing zeros according to the settings for minimum fraction and significant digits.
Definition:unumberformatter.h:409
UNumberUnitWidth
UNumberUnitWidth
An enum declaring how to render units, including currencies.
Definition:unumberformatter.h:152
UNUM_UNIT_WIDTH_COUNT
@ UNUM_UNIT_WIDTH_COUNT
One more than the highest UNumberUnitWidth value.
Definition:unumberformatter.h:242
unumberoptions.h
C API: Header-only input options for various number formatting APIs.
UNumberFormatRoundingMode
UNumberFormatRoundingMode
The possible number format rounding modes.
Definition:unumberoptions.h:28
UNUM_ROUND_HALFEVEN
@ UNUM_ROUND_HALFEVEN
Half-even rounding.
Definition:unumberoptions.h:37
UNumberGroupingStrategy
UNumberGroupingStrategy
An enum declaring the strategy for when and how to display grouping separators (i....
Definition:unumberoptions.h:96
uobject.h
C++ API: Common ICU base class UObject.
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition:utypes.h:509
U_MEMORY_ALLOCATION_ERROR
@ U_MEMORY_ALLOCATION_ERROR
Memory allocation error.
Definition:utypes.h:552
U_ZERO_ERROR
@ U_ZERO_ERROR
No error, no warning.
Definition:utypes.h:544
U_FAILURE
#define U_FAILURE(x)
Does the error code indicate a failure?
Definition:utypes.h:827
U_I18N_API_CLASS
#define U_I18N_API_CLASS
Set to export library symbols from inside the i18n library, and to import them from outside,...
Definition:utypes.h:457
U_I18N_API
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside.
Definition:utypes.h:316

Generated by doxygen 1.9.1
[8]ページ先頭

©2009-2025 Movatter.jp