ICU 66.0.1  66.0.1
uformattedvalue.h
Go to the documentation of this file.
1 // © 2018 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 
4 #ifndef __UFORMATTEDVALUE_H__
5 #define __UFORMATTEDVALUE_H__
6 
7 #include "unicode/utypes.h"
8 
9 #if !UCONFIG_NO_FORMATTING
10 
11 #include "unicode/ufieldpositer.h"
12 
13 #ifndef U_HIDE_DRAFT_API
14 
36 typedef enum UFieldCategory {
43 
50 
57 
64 
71 
78 
79 #ifndef U_HIDE_INTERNAL_API
80 
82 #endif /* U_HIDE_INTERNAL_API */
83 
90 
97 
99 
100 
114 
115 
127 
128 
138 U_DRAFT void U_EXPORT2
141  UErrorCode* ec);
142 
143 
150 U_DRAFT void U_EXPORT2
152 
153 
179 U_DRAFT void U_EXPORT2
182  int32_t category,
183  UErrorCode* ec);
184 
185 
212 U_DRAFT void U_EXPORT2
215  int32_t category,
216  int32_t field,
217  UErrorCode* ec);
218 
219 
232 U_DRAFT int32_t U_EXPORT2
234  const UConstrainedFieldPosition* ucfpos,
235  UErrorCode* ec);
236 
237 
250 U_DRAFT int32_t U_EXPORT2
252  const UConstrainedFieldPosition* ucfpos,
253  UErrorCode* ec);
254 
255 
267 U_DRAFT void U_EXPORT2
269  const UConstrainedFieldPosition* ucfpos,
270  int32_t* pStart,
271  int32_t* pLimit,
272  UErrorCode* ec);
273 
274 
287 U_DRAFT int64_t U_EXPORT2
289  const UConstrainedFieldPosition* ucfpos,
290  UErrorCode* ec);
291 
292 
303 U_DRAFT void U_EXPORT2
306  int64_t context,
307  UErrorCode* ec);
308 
309 
322 U_DRAFT UBool U_EXPORT2
324  const UConstrainedFieldPosition* ucfpos,
325  int32_t category,
326  int32_t field,
327  UErrorCode* ec);
328 
329 
346 U_DRAFT void U_EXPORT2
349  int32_t category,
350  int32_t field,
351  int32_t start,
352  int32_t limit,
353  UErrorCode* ec);
354 
355 
356 struct UFormattedValue;
364 
365 
379 U_DRAFT const UChar* U_EXPORT2
381  const UFormattedValue* ufmtval,
382  int32_t* pLength,
383  UErrorCode* ec);
384 
385 
409 U_DRAFT UBool U_EXPORT2
411  const UFormattedValue* ufmtval,
413  UErrorCode* ec);
414 
415 
416 #if U_SHOW_CPLUSPLUS_API
417 U_NAMESPACE_BEGIN
418 
433  ucfpos_close);
434 
435 U_NAMESPACE_END
436 #endif // U_SHOW_CPLUSPLUS_API
437 
438 
439 #endif /* U_HIDE_DRAFT_API */
440 #endif /* #if !UCONFIG_NO_FORMATTING */
441 #endif // __UFORMATTEDVALUE_H__
"Smart pointer" class; closes a UConstrainedFieldPosition via ucfpos_close().
void ucfpos_setInt64IterationContext(UConstrainedFieldPosition *ucfpos, int64_t context, UErrorCode *ec)
Sets an int64 that FormattedValue implementations may use for storage.
For fields in UDateFormatField (udat.h), from ICU 3.0.
Category for spans in a date interval.
UBool ufmtval_nextPosition(const UFormattedValue *ufmtval, UConstrainedFieldPosition *ucfpos, UErrorCode *ec)
Iterates over field positions in the UFormattedValue.
For fields in UListFormatterField (ulistformatter.h), from ICU 63.
int32_t ucfpos_getField(const UConstrainedFieldPosition *ucfpos, UErrorCode *ec)
Gets the field for the current position.
For an undefined field category.
int32_t ucfpos_getCategory(const UConstrainedFieldPosition *ucfpos, UErrorCode *ec)
Gets the field category for the current position.
UFieldCategory
All possible field categories in ICU.
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
"Smart pointer" definition macro, deletes objects via the closeFunction.
Definition: localpointer.h:562
void ucfpos_close(UConstrainedFieldPosition *ucfpos)
Destroys a UConstrainedFieldPosition and releases its memory.
void ucfpos_reset(UConstrainedFieldPosition *ucfpos, UErrorCode *ec)
Resets a UConstrainedFieldPosition to its initial state, as if it were newly created.
Category for spans in a list.
uint16_t UChar
The base type for UTF-16 code units and pointers.
Definition: umachine.h:378
void ucfpos_constrainCategory(UConstrainedFieldPosition *ucfpos, int32_t category, UErrorCode *ec)
Sets a constraint on the field category.
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:415
void ucfpos_constrainField(UConstrainedFieldPosition *ucfpos, int32_t category, int32_t field, UErrorCode *ec)
Sets a constraint on the category and field.
C API: UFieldPositionIterator for use with format APIs.
UBool ucfpos_matchesField(const UConstrainedFieldPosition *ucfpos, int32_t category, int32_t field, UErrorCode *ec)
Determines whether a given field should be included given the constraints.
Basic definitions for ICU, for both C and C++ APIs.
void ucfpos_getIndexes(const UConstrainedFieldPosition *ucfpos, int32_t *pStart, int32_t *pLimit, UErrorCode *ec)
Gets the INCLUSIVE start and EXCLUSIVE end index stored for the current position. ...
void ucfpos_setState(UConstrainedFieldPosition *ucfpos, int32_t category, int32_t field, int32_t start, int32_t limit, UErrorCode *ec)
Sets new values for the primary public getters.
UConstrainedFieldPosition * ucfpos_open(UErrorCode *ec)
Creates a new UConstrainedFieldPosition.
struct UConstrainedFieldPosition UConstrainedFieldPosition
Represents a span of a string containing a given field.
struct UFormattedValue UFormattedValue
An abstract formatted value: a string with associated field attributes.
const UChar * ufmtval_getString(const UFormattedValue *ufmtval, int32_t *pLength, UErrorCode *ec)
Returns a pointer to the formatted string.
#define U_DRAFT
This is used to declare a function as a draft public ICU C API.
Definition: umachine.h:113
int64_t ucfpos_getInt64IterationContext(const UConstrainedFieldPosition *ucfpos, UErrorCode *ec)
Gets an int64 that FormattedValue implementations may use for storage.
For fields in UNumberFormatFields (unum.h), from ICU 49.
For fields in URelativeDateTimeFormatterField (ureldatefmt.h), from ICU 64.
int8_t UBool
The ICU boolean type.
Definition: umachine.h:261
Reserved for possible future fields in UDateIntervalFormatField.