fCategory = UFIELD_CATEGORY_UNDEFINED;
}
-void ConstrainedFieldPosition::constrainCategory(UFieldCategory category) {
+void ConstrainedFieldPosition::constrainCategory(int32_t category) {
fConstraint = UCFPOS_CONSTRAINT_CATEGORY;
fCategory = category;
}
-void ConstrainedFieldPosition::constrainField(UFieldCategory category, int32_t field) {
+void ConstrainedFieldPosition::constrainField(int32_t category, int32_t field) {
fConstraint = UCFPOS_CONSTRAINT_FIELD;
fCategory = category;
fField = field;
}
void ConstrainedFieldPosition::setState(
- UFieldCategory category,
+ int32_t category,
int32_t field,
int32_t start,
int32_t limit) {
}
U_CAPI void U_EXPORT2
-ucfpos_constrainCategory(UConstrainedFieldPosition* ptr, UFieldCategory category, UErrorCode* ec) {
+ucfpos_constrainCategory(UConstrainedFieldPosition* ptr, int32_t category, UErrorCode* ec) {
auto* impl = UConstrainedFieldPositionImpl::validate(ptr, *ec);
if (U_FAILURE(*ec)) {
return;
}
U_CAPI void U_EXPORT2
-ucfpos_constrainField(UConstrainedFieldPosition* ptr, UFieldCategory category, int32_t field, UErrorCode* ec) {
+ucfpos_constrainField(UConstrainedFieldPosition* ptr, int32_t category, int32_t field, UErrorCode* ec) {
auto* impl = UConstrainedFieldPositionImpl::validate(ptr, *ec);
if (U_FAILURE(*ec)) {
return;
return impl->fImpl.getConstraintType();
}
-U_CAPI UFieldCategory U_EXPORT2
+U_CAPI int32_t U_EXPORT2
ucfpos_getCategory(const UConstrainedFieldPosition* ptr, UErrorCode* ec) {
const auto* impl = UConstrainedFieldPositionImpl::validate(ptr, *ec);
if (U_FAILURE(*ec)) {
U_CAPI void U_EXPORT2
ucfpos_setState(
UConstrainedFieldPosition* ptr,
- UFieldCategory category,
+ int32_t category,
int32_t field,
int32_t start,
int32_t limit,
* @param category The field category to fix when iterating.
* @draft ICU 64
*/
- void constrainCategory(UFieldCategory category);
+ void constrainCategory(int32_t category);
/**
* Sets a constraint on the category and field.
* @param field The field to fix when iterating.
* @draft ICU 64
*/
- void constrainField(UFieldCategory category, int32_t field);
+ void constrainField(int32_t category, int32_t field);
/**
* Gets the currently active constraint.
* @return The field category saved in the instance.
* @draft ICU 64
*/
- inline UFieldCategory getCategory() const {
+ inline int32_t getCategory() const {
return fCategory;
};
* @draft ICU 64
*/
void setState(
- UFieldCategory category,
+ int32_t category,
int32_t field,
int32_t start,
int32_t limit);
int32_t fStart = 0;
int32_t fLimit = 0;
UCFPosConstraintType fConstraint = UCFPOS_CONSTRAINT_NONE;
- UFieldCategory fCategory = UFIELD_CATEGORY_UNDEFINED;
+ int32_t fCategory = UFIELD_CATEGORY_UNDEFINED;
};
/**
* All possible field categories in ICU. Every entry in this enum corresponds
* to another enum that exists in ICU.
+ *
+ * In the APIs that take a UFieldCategory, an int32_t type is used. Field
+ * categories having any of the top four bits turned on are reserved as
+ * private-use for external APIs implementing FormattedValue. This means that
+ * categories 2^28 and higher or below zero (with the highest bit turned on)
+ * are private-use and will not be used by ICU in the future.
*
* @draft ICU 64
*/
U_DRAFT void U_EXPORT2
ucfpos_constrainCategory(
UConstrainedFieldPosition* ucfpos,
- UFieldCategory category,
+ int32_t category,
UErrorCode* ec);
U_DRAFT void U_EXPORT2
ucfpos_constrainField(
UConstrainedFieldPosition* ucfpos,
- UFieldCategory category,
+ int32_t category,
int32_t field,
UErrorCode* ec);
* @return The field category saved in the instance.
* @draft ICU 64
*/
-U_DRAFT UFieldCategory U_EXPORT2
+U_DRAFT int32_t U_EXPORT2
ucfpos_getCategory(
const UConstrainedFieldPosition* ucfpos,
UErrorCode* ec);
U_DRAFT void U_EXPORT2
ucfpos_setState(
UConstrainedFieldPosition* ucfpos,
- UFieldCategory category,
+ int32_t category,
int32_t field,
int32_t start,
int32_t limit,