ICU 76.1 76.1
Loading...
Searching...
No Matches
uformattednumber.h
Go to the documentation of this file.
1// © 2022 and later: Unicode, Inc. and others.
2// License & terms of use: http://www.unicode.org/copyright.html
3
4#ifndef __UFORMATTEDNUMBER_H__
5#define __UFORMATTEDNUMBER_H__
6
7#include "unicode/utypes.h"
8
9#if !UCONFIG_NO_FORMATTING
10
13#include "unicode/umisc.h"
14
35struct UFormattedNumber;
44
45
54U_CAPI UFormattedNumber* U_EXPORT2
56
57
72U_CAPI const UFormattedValue* U_EXPORT2
74
75
95U_CAPI int32_t U_EXPORT2
96unumf_resultToString(const UFormattedNumber* uresult, UChar* buffer, int32_t bufferCapacity,
97 UErrorCode* ec);
98
99
133U_CAPI UBool U_EXPORT2
135
136
158U_CAPI void U_EXPORT2
160 UErrorCode* ec);
161
162
181U_CAPI int32_t U_EXPORT2
183 const UFormattedNumber* uresult,
184 char* dest,
185 int32_t destCapacity,
186 UErrorCode* ec);
187
188
195U_CAPI void U_EXPORT2
197
198
199#if U_SHOW_CPLUSPLUS_API
200U_NAMESPACE_BEGIN
201
218
219U_NAMESPACE_END
220#endif // U_SHOW_CPLUSPLUS_API
221
222
223#endif /* #if !UCONFIG_NO_FORMATTING */
224#endif //__UFORMATTEDNUMBER_H__
"Smart pointer" class; closes a UFormattedNumber via unumf_closeResult().
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
"Smart pointer" definition macro, deletes objects via the closeFunction.
A struct representing a range of text containing a specific field.
Definition umisc.h:34
C API: UFieldPositionIterator for use with format APIs.
struct UFieldPositionIterator UFieldPositionIterator
C typedef for struct UFieldPositionIterator.
U_CAPI void unumf_closeResult(UFormattedNumber *uresult)
Releases the UFormattedNumber created by unumf_openResult().
struct UFormattedNumber UFormattedNumber
C-compatible version of icu::number::FormattedNumber.
U_CAPI const UFormattedValue * unumf_resultAsValue(const UFormattedNumber *uresult, UErrorCode *ec)
Returns a representation of a UFormattedNumber as a UFormattedValue, which can be subsequently passed...
U_CAPI int32_t unumf_resultToDecimalNumber(const UFormattedNumber *uresult, char *dest, int32_t destCapacity, UErrorCode *ec)
Extracts the formatted number as a "numeric string" conforming to the syntax defined in the Decimal A...
U_CAPI int32_t unumf_resultToString(const UFormattedNumber *uresult, UChar *buffer, int32_t bufferCapacity, UErrorCode *ec)
Extracts the result number string out of a UFormattedNumber to a UChar buffer if possible.
U_CAPI UFormattedNumber * unumf_openResult(UErrorCode *ec)
Creates an object to hold the result of a UNumberFormatter operation.
U_CAPI UBool unumf_resultNextFieldPosition(const UFormattedNumber *uresult, UFieldPosition *ufpos, UErrorCode *ec)
Determines the start and end indices of the next occurrence of the given field in the output string.
U_CAPI void unumf_resultGetAllFieldPositions(const UFormattedNumber *uresult, UFieldPositionIterator *ufpositer, UErrorCode *ec)
Populates the given iterator with all fields in the formatted output string.
C API: Abstract operations for localized strings.
struct UFormattedValue UFormattedValue
An abstract formatted value: a string with associated field attributes.
int8_t UBool
The ICU boolean type, a signed-byte integer.
Definition umachine.h:247
#define U_CAPI
This is used to declare a function as a public ICU C API.
Definition umachine.h:110
char16_t UChar
The base type for UTF-16 code units and pointers.
Definition umachine.h:378
C API: Miscellaneous definitions.
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition utypes.h:430