diff options
author | mcheshkov <mcheshkov@yandex-team.ru> | 2022-02-10 16:46:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:15 +0300 |
commit | e9d19cec64684c9c1e6b0c98297e5b895cf904fe (patch) | |
tree | 2768b1223e96a8a0610a93d18425d9647c1123c8 /contrib/libs/icu/include/unicode/unum.h | |
parent | 60040c91ffe701a84689b2c6310ff845e65cff42 (diff) | |
download | ydb-e9d19cec64684c9c1e6b0c98297e5b895cf904fe.tar.gz |
Restoring authorship annotation for <mcheshkov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/icu/include/unicode/unum.h')
-rw-r--r-- | contrib/libs/icu/include/unicode/unum.h | 234 |
1 files changed, 117 insertions, 117 deletions
diff --git a/contrib/libs/icu/include/unicode/unum.h b/contrib/libs/icu/include/unicode/unum.h index 9036f9575d..ab4766fd4f 100644 --- a/contrib/libs/icu/include/unicode/unum.h +++ b/contrib/libs/icu/include/unicode/unum.h @@ -1,4 +1,4 @@ -// © 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -25,17 +25,17 @@ #include "unicode/parseerr.h" #include "unicode/uformattable.h" #include "unicode/udisplaycontext.h" -#include "unicode/ufieldpositer.h" +#include "unicode/ufieldpositer.h" /** * \file - * \brief C API: Compatibility APIs for number formatting. + * \brief C API: Compatibility APIs for number formatting. * * <h2> Number Format C API </h2> - * - * <p><strong>IMPORTANT:</strong> New users with are strongly encouraged to - * see if unumberformatter.h fits their use case. Although not deprecated, - * this header is provided for backwards compatibility only. + * + * <p><strong>IMPORTANT:</strong> New users with are strongly encouraged to + * see if unumberformatter.h fits their use case. Although not deprecated, + * this header is provided for backwards compatibility only. * * Number Format C API Provides functions for * formatting and parsing a number. Also provides methods for @@ -119,7 +119,7 @@ * <P> * You can also control the display of numbers with such function as * unum_getAttributes() and unum_setAttributes(), which let you set the - * minimum fraction digits, grouping, etc. + * minimum fraction digits, grouping, etc. * @see UNumberFormatAttributes for more details * <P> * You can also use forms of the parse and format methods with @@ -130,7 +130,7 @@ * </ul> * <p> * It is also possible to change or set the symbols used for a particular - * locale like the currency symbol, the grouping separator , monetary separator + * locale like the currency symbol, the grouping separator , monetary separator * etc by making use of functions unum_setSymbols() and unum_getSymbols(). */ @@ -254,7 +254,7 @@ typedef enum UNumberFormatStyle { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ UNUM_FORMAT_STYLE_COUNT=17, -#endif /* U_HIDE_DEPRECATED_API */ +#endif /* U_HIDE_DEPRECATED_API */ /** * Default format @@ -268,13 +268,13 @@ typedef enum UNumberFormatStyle { UNUM_IGNORE = UNUM_PATTERN_DECIMAL } UNumberFormatStyle; -/** The possible number format rounding modes. - * - * <p> - * For more detail on rounding modes, see: - * http://userguide.icu-project.org/formatparse/numbers/rounding-modes - * - * @stable ICU 2.0 +/** The possible number format rounding modes. + * + * <p> + * For more detail on rounding modes, see: + * http://userguide.icu-project.org/formatparse/numbers/rounding-modes + * + * @stable ICU 2.0 */ typedef enum UNumberFormatRoundingMode { UNUM_ROUND_CEILING, @@ -336,15 +336,15 @@ enum UCurrencySpacing { /** @stable ICU 4.8 */ UNUM_CURRENCY_INSERT, - /* Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API, - * it is needed for layout of DecimalFormatSymbols object. */ -#ifndef U_FORCE_HIDE_DEPRECATED_API + /* Do not conditionalize the following with #ifndef U_HIDE_DEPRECATED_API, + * it is needed for layout of DecimalFormatSymbols object. */ +#ifndef U_FORCE_HIDE_DEPRECATED_API /** * One more than the highest normal UCurrencySpacing value. * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ UNUM_CURRENCY_SPACING_COUNT -#endif // U_FORCE_HIDE_DEPRECATED_API +#endif // U_FORCE_HIDE_DEPRECATED_API }; typedef enum UCurrencySpacing UCurrencySpacing; /**< @stable ICU 4.8 */ @@ -377,18 +377,18 @@ typedef enum UNumberFormatFields { UNUM_PERMILL_FIELD, /** @stable ICU 49 */ UNUM_SIGN_FIELD, - /** @stable ICU 64 */ - UNUM_MEASURE_UNIT_FIELD, - /** @stable ICU 64 */ - UNUM_COMPACT_FIELD, - + /** @stable ICU 64 */ + UNUM_MEASURE_UNIT_FIELD, + /** @stable ICU 64 */ + UNUM_COMPACT_FIELD, + #ifndef U_HIDE_DEPRECATED_API /** * One more than the highest normal UNumberFormatFields value. * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ - UNUM_FIELD_COUNT = UNUM_SIGN_FIELD + 3 -#endif /* U_HIDE_DEPRECATED_API */ + UNUM_FIELD_COUNT = UNUM_SIGN_FIELD + 3 +#endif /* U_HIDE_DEPRECATED_API */ } UNumberFormatFields; @@ -407,10 +407,10 @@ typedef enum UNumberFormatFields { * number format is opened using the given pattern, which must conform * to the syntax described in DecimalFormat or RuleBasedNumberFormat, * respectively. - * - * <p><strong>NOTE::</strong> New users with are strongly encouraged to - * use unumf_openForSkeletonAndLocale instead of unum_open. - * + * + * <p><strong>NOTE::</strong> New users with are strongly encouraged to + * use unumf_openForSkeletonAndLocale instead of unum_open. + * * @param pattern A pattern specifying the format to use. * This parameter is ignored unless the style is * UNUM_PATTERN_DECIMAL or UNUM_PATTERN_RULEBASED. @@ -575,57 +575,57 @@ unum_formatDouble( const UNumberFormat* fmt, UErrorCode* status); /** -* Format a double using a UNumberFormat according to the UNumberFormat's locale, -* and initialize a UFieldPositionIterator that enumerates the subcomponents of -* the resulting string. -* -* @param format -* The formatter to use. -* @param number -* The number to format. -* @param result -* A pointer to a buffer to receive the NULL-terminated formatted -* number. If the formatted number fits into dest but cannot be -* NULL-terminated (length == resultLength) then the error code is set -* to U_STRING_NOT_TERMINATED_WARNING. If the formatted number doesn't -* fit into result then the error code is set to -* U_BUFFER_OVERFLOW_ERROR. -* @param resultLength -* The maximum size of result. -* @param fpositer -* A pointer to a UFieldPositionIterator created by {@link #ufieldpositer_open} -* (may be NULL if field position information is not needed, but in this -* case it's preferable to use {@link #unum_formatDouble}). Iteration -* information already present in the UFieldPositionIterator is deleted, -* and the iterator is reset to apply to the fields in the formatted -* string created by this function call. The field values and indexes -* returned by {@link #ufieldpositer_next} represent fields denoted by -* the UNumberFormatFields enum. Fields are not returned in a guaranteed -* order. Fields cannot overlap, but they may nest. For example, 1234 -* could format as "1,234" which might consist of a grouping separator -* field for ',' and an integer field encompassing the entire string. -* @param status -* A pointer to an UErrorCode to receive any errors -* @return -* The total buffer size needed; if greater than resultLength, the -* output was truncated. -* @see unum_formatDouble -* @see unum_parse -* @see unum_parseDouble -* @see UFieldPositionIterator -* @see UNumberFormatFields -* @stable ICU 59 -*/ -U_STABLE int32_t U_EXPORT2 -unum_formatDoubleForFields(const UNumberFormat* format, - double number, - UChar* result, - int32_t resultLength, - UFieldPositionIterator* fpositer, - UErrorCode* status); - - -/** +* Format a double using a UNumberFormat according to the UNumberFormat's locale, +* and initialize a UFieldPositionIterator that enumerates the subcomponents of +* the resulting string. +* +* @param format +* The formatter to use. +* @param number +* The number to format. +* @param result +* A pointer to a buffer to receive the NULL-terminated formatted +* number. If the formatted number fits into dest but cannot be +* NULL-terminated (length == resultLength) then the error code is set +* to U_STRING_NOT_TERMINATED_WARNING. If the formatted number doesn't +* fit into result then the error code is set to +* U_BUFFER_OVERFLOW_ERROR. +* @param resultLength +* The maximum size of result. +* @param fpositer +* A pointer to a UFieldPositionIterator created by {@link #ufieldpositer_open} +* (may be NULL if field position information is not needed, but in this +* case it's preferable to use {@link #unum_formatDouble}). Iteration +* information already present in the UFieldPositionIterator is deleted, +* and the iterator is reset to apply to the fields in the formatted +* string created by this function call. The field values and indexes +* returned by {@link #ufieldpositer_next} represent fields denoted by +* the UNumberFormatFields enum. Fields are not returned in a guaranteed +* order. Fields cannot overlap, but they may nest. For example, 1234 +* could format as "1,234" which might consist of a grouping separator +* field for ',' and an integer field encompassing the entire string. +* @param status +* A pointer to an UErrorCode to receive any errors +* @return +* The total buffer size needed; if greater than resultLength, the +* output was truncated. +* @see unum_formatDouble +* @see unum_parse +* @see unum_parseDouble +* @see UFieldPositionIterator +* @see UNumberFormatFields +* @stable ICU 59 +*/ +U_STABLE int32_t U_EXPORT2 +unum_formatDoubleForFields(const UNumberFormat* format, + double number, + UChar* result, + int32_t resultLength, + UFieldPositionIterator* fpositer, + UErrorCode* status); + + +/** * Format a decimal number using a UNumberFormat. * The number will be formatted according to the UNumberFormat's locale. * The syntax of the input number is a "numeric string" @@ -901,7 +901,7 @@ unum_parseToUFormattable(const UNumberFormat* fmt, * @param localized TRUE if the pattern is localized, FALSE otherwise. * @param pattern The new pattern * @param patternLength The length of pattern, or -1 if null-terminated. - * @param parseError A pointer to UParseError to receive information + * @param parseError A pointer to UParseError to receive information * about errors occurred during parsing, or NULL if no parse error * information is desired. * @param status A pointer to an input-output UErrorCode. @@ -1025,18 +1025,18 @@ typedef enum UNumberFormatAttribute { * <p>Example: setting the scale to 3, 123 formats as "123,000" * <p>Example: setting the scale to -4, 123 formats as "0.0123" * - * This setting is analogous to getMultiplierScale() and setMultiplierScale() in decimfmt.h. - * + * This setting is analogous to getMultiplierScale() and setMultiplierScale() in decimfmt.h. + * * @stable ICU 51 */ UNUM_SCALE = 21, - + /** - * Minimum grouping digits; most commonly set to 2 to print "1000" instead of "1,000". + * Minimum grouping digits; most commonly set to 2 to print "1000" instead of "1,000". * See DecimalFormat::getMinimumGroupingDigits(). * - * For better control over grouping strategies, use UNumberFormatter. - * - * @stable ICU 64 + * For better control over grouping strategies, use UNumberFormatter. + * + * @stable ICU 64 */ UNUM_MINIMUM_GROUPING_DIGITS = 22, @@ -1048,12 +1048,12 @@ typedef enum UNumberFormatAttribute { */ UNUM_CURRENCY_USAGE = 23, -#ifndef U_HIDE_INTERNAL_API +#ifndef U_HIDE_INTERNAL_API /** One below the first bitfield-boolean item. * All items after this one are stored in boolean form. * @internal */ UNUM_MAX_NONBOOLEAN_ATTRIBUTE = 0x0FFF, -#endif /* U_HIDE_INTERNAL_API */ +#endif /* U_HIDE_INTERNAL_API */ /** If 1, specifies that if setting the "max integer digits" attribute would truncate a value, set an error status rather than silently truncating. * For example, formatting the value 1234 with 4 max int digits would succeed, but formatting 12345 would fail. There is no effect on parsing. @@ -1067,7 +1067,7 @@ typedef enum UNumberFormatAttribute { * Default: 0 (unset) * @stable ICU 50 */ - UNUM_PARSE_NO_EXPONENT = 0x1001, + UNUM_PARSE_NO_EXPONENT = 0x1001, /** * if this attribute is set to 1, specifies that, if the pattern contains a @@ -1079,29 +1079,29 @@ typedef enum UNumberFormatAttribute { */ UNUM_PARSE_DECIMAL_MARK_REQUIRED = 0x1002, - /** - * Parsing: if set to 1, parsing is sensitive to case (lowercase/uppercase). - * - * @stable ICU 64 - */ - UNUM_PARSE_CASE_SENSITIVE = 0x1003, - - /** - * Formatting: if set to 1, whether to show the plus sign on non-negative numbers. - * - * For better control over sign display, use UNumberFormatter. - * - * @stable ICU 64 - */ - UNUM_SIGN_ALWAYS_SHOWN = 0x1004, - -#ifndef U_HIDE_INTERNAL_API - /** Limit of boolean attributes. (value should - * not depend on U_HIDE conditionals) + /** + * Parsing: if set to 1, parsing is sensitive to case (lowercase/uppercase). + * + * @stable ICU 64 + */ + UNUM_PARSE_CASE_SENSITIVE = 0x1003, + + /** + * Formatting: if set to 1, whether to show the plus sign on non-negative numbers. + * + * For better control over sign display, use UNumberFormatter. + * + * @stable ICU 64 + */ + UNUM_SIGN_ALWAYS_SHOWN = 0x1004, + +#ifndef U_HIDE_INTERNAL_API + /** Limit of boolean attributes. (value should + * not depend on U_HIDE conditionals) * @internal */ - UNUM_LIMIT_BOOLEAN_ATTRIBUTE = 0x1005, -#endif /* U_HIDE_INTERNAL_API */ - + UNUM_LIMIT_BOOLEAN_ATTRIBUTE = 0x1005, +#endif /* U_HIDE_INTERNAL_API */ + } UNumberFormatAttribute; /** @@ -1385,7 +1385,7 @@ typedef enum UNumberFormatSymbol { * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420. */ UNUM_FORMAT_SYMBOL_COUNT = 28 -#endif /* U_HIDE_DEPRECATED_API */ +#endif /* U_HIDE_DEPRECATED_API */ } UNumberFormatSymbol; /** |