* \#include <utils_i18n.h>
*
* @section CAPI_BASE_UTILS_I18N_FIELD_POSITION_MODULE_OVERVIEW Overview
- * @details Field position keeps track of the position of the field within the formatted
+ * @details Fields are identified by constants defined in *_format_field_e enumerations.
+ * The only fields currently supported are the fields accepted by the date formatter, see #i18n_udate_format_field_e.
+ * Field position keeps track of the position of the field within the formatted
* output with two indices: the index of the first character of the field and the index
* of the last character of the field. One version of the format function in the various
* Format modules requires a Field Position object as an argument. You use this format
/**
* @brief Creates a field position object for the given field.
- * @details Fields are identified by constants, whose names typically end with _FIELD,
- * in the various subtypes of Format.
+ * @details The only fields currently supported are the fields accepted by the date formatter,
+ * see #i18n_udate_format_field_e.
* @since_tizen 3.0
* @remarks The created object should be released by the caller with the
* i18n_field_position_destroy() function.
* @return @c 0 on success, otherwise a negative error value
* @retval #I18N_ERROR_NONE Successful
* @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
- * @retval #I18N_ERROR_UNKNOWN Unknown error
+ * @retval #I18N_ERROR_OUT_OF_MEMORY Out of memory
*/
int i18n_formattable_create_default(i18n_formattable_h *formattable);
* @return @c 0 on success, otherwise a negative error value
* @retval #I18N_ERROR_NONE Successful
* @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
- * @retval #I18N_ERROR_UNKNOWN Unknown error
+ * @retval #I18N_ERROR_OUT_OF_MEMORY Out of memory
*/
int i18n_formattable_create_with_udate(i18n_udate date, i18n_formattable_h *formattable);
* @return @c 0 on success, otherwise a negative error value
* @retval #I18N_ERROR_NONE Successful
* @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
- * @retval #I18N_ERROR_UNKNOWN Unknown error
+ * @retval #I18N_ERROR_OUT_OF_MEMORY Out of memory
*/
int i18n_formattable_create_with_double(double value, i18n_formattable_h *formattable);
* @return @c 0 on success, otherwise a negative error value
* @retval #I18N_ERROR_NONE Successful
* @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
- * @retval #I18N_ERROR_UNKNOWN Unknown error
+ * @retval #I18N_ERROR_OUT_OF_MEMORY Out of memory
*/
int i18n_formattable_create_with_long(int32_t value, i18n_formattable_h *formattable);
* @return @c 0 on success, otherwise a negative error value
* @retval #I18N_ERROR_NONE Successful
* @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
- * @retval #I18N_ERROR_UNKNOWN Unknown error
+ * @retval #I18N_ERROR_OUT_OF_MEMORY Out of memory
*/
int i18n_formattable_create_with_int64(int64_t value, i18n_formattable_h *formattable);
* @return @c 0 on success, otherwise a negative error value
* @retval #I18N_ERROR_NONE Successful
* @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
- * @retval #I18N_ERROR_UNKNOWN Unknown error
+ * @retval #I18N_ERROR_OUT_OF_MEMORY Out of memory
*/
int i18n_formattable_create_with_char_string(const char *str_to_copy, i18n_formattable_h *formattable);
* @return @c 0 on success, otherwise a negative error value
* @retval #I18N_ERROR_NONE Successful
* @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
- * @retval #I18N_ERROR_UNKNOWN Unknown error
+ * @retval #I18N_ERROR_OUT_OF_MEMORY Out of memory
*/
int i18n_formattable_create_with_formattable_array(const i18n_formattable_h *array_to_copy, int32_t count, i18n_formattable_h *formattable);
* @return @c 0 on success, otherwise a negative error value
* @retval #I18N_ERROR_NONE Successful
* @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
- * @retval #I18N_ERROR_UNKNOWN Unknown error
+ * @retval #I18N_ERROR_OUT_OF_MEMORY Out of memory
*/
int i18n_formattable_clone(i18n_formattable_h formattable, i18n_formattable_h *clone);
/**
* @brief Gets the array value and count of the given formattable object.
* @since_tizen 3.0
- * @remarks If this object is not of type #I18N_FORMATTABLE_K_ARRAY then the
+ * @remarks If this object is not of type #I18N_FORMATTABLE_TYPE_ARRAY then the
* result is undefined.
*
* @param[in] formattable A handle to the formattable object
/**
* @brief Gets the date value of the given formattable object.
* @since_tizen 3.0
- * @remarks If this object is not of type #I18N_FORMATTABLE_K_DATE then the
+ * @remarks If this object is not of type #I18N_FORMATTABLE_TYPE_DATE then the
* result is undefined.
*
* @param[in] formattable A handle to the formattable object
/**
* @brief Gets the double value of the given formattable object.
* @since_tizen 3.0
- * @remarks If this object is not of type #I18N_FORMATTABLE_K_DOUBLE then the
+ * @remarks If this object is not of type #I18N_FORMATTABLE_TYPE_DOUBLE then the
* result is undefined.
*
* @param[in] formattable A handle to the formattable object
/**
* @brief Gets the int64 value of the given formattable object.
* @since_tizen 3.0
- * @remarks If this object is not of type #I18N_FORMATTABLE_K_INT64 then the
+ * @remarks If this object is not of type #I18N_FORMATTABLE_TYPE_INT64 then the
* result is undefined.
*
* @param[in] formattable A handle to the formattable object
* @retval #I18N_ERROR_NONE Successful
* @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
* @retval #I18N_ERROR_INVALID_FORMAT The given formattable type is not a string
+ * @retval #I18N_ERROR_OUT_OF_MEMORY Out of memory
* @retval #I18N_ERROR_UNKNOWN Unknown error
*/
int i18n_formattable_get_string(i18n_formattable_h formattable, char **value);
/**
* @brief Sets the variable pointed by the @a is_numeric pointer to @c true if
- * the data type of the given formattable object is #I18N_FORMATTABLE_K_DOUBLE,
- * #I18N_FORMATTABLE_K_LONG or #I18N_FORMATTABLE_K_INT64.
+ * the data type of the given formattable object is #I18N_FORMATTABLE_TYPE_DOUBLE,
+ * #I18N_FORMATTABLE_TYPE_LONG or #I18N_FORMATTABLE_TYPE_INT64.
* @since_tizen 3.0
*
* @param[in] formattable A handle to the formattable object
/**
* @brief Sets the object pointed by the @a element pointer to the element at
* the @a index position in the array stored by the given formattable
- * object (if its type is #I18N_FORMATTABLE_K_ARRAY).
+ * object (if its type is #I18N_FORMATTABLE_TYPE_ARRAY).
* @since_tizen 3.0
- * @remarks If this object is not of type #I18N_FORMATTABLE_K_ARRAY then the
+ * @remarks If this object is not of type #I18N_FORMATTABLE_TYPE_ARRAY then the
* result is undefined.
*
* The obtained formattable element should not be released by the caller
- * as it belongs to the given formattable object of type #I18N_FORMATTABLE_K_ARRAY.
+ * as it belongs to the given formattable object of type #I18N_FORMATTABLE_TYPE_ARRAY.
*
* @param[in] formattable A handle to the formattable object
* @param[in] index A number representing the position in the array from
/**
* @brief Sets the array value and count of the given formattable object and
- * changes the type to #I18N_FORMATTABLE_K_ARRAY.
+ * changes the type to #I18N_FORMATTABLE_TYPE_ARRAY.
* @since_tizen 3.0
*
* @param[in] formattable A handle to the formattable object
/**
* @brief Sets the date value of the given formattable object and changes the
- * type to the #I18N_FORMATTABLE_K_DATE.
+ * type to the #I18N_FORMATTABLE_TYPE_DATE.
* @since_tizen 3.0
*
* @param[in] formattable A handle to the formattable object
/**
* @brief Sets the double value of the given formattable object and changes
- * the type to the #I18N_FORMATTABLE_K_DOUBLE.
+ * the type to the #I18N_FORMATTABLE_TYPE_DOUBLE.
* @since_tizen 3.0
*
* @param[in] formattable A handle to the formattable object
/**
* @brief Sets the int64 value of the given formattable object and changes the
- * type to the #I18N_FORMATTABLE_K_INT64.
+ * type to the #I18N_FORMATTABLE_TYPE_INT64.
* @since_tizen 3.0
*
* @param[in] formattable A handle to the formattable object
/**
* @brief Sets the long value of the given formattable object and changes the
- * type to the #I18N_FORMATTABLE_K_LONG.
+ * type to the #I18N_FORMATTABLE_TYPE_LONG.
* @since_tizen 3.0
*
* @param[in] formattable A handle to the formattable object
/**
* @brief Sets the string value of the given formattable object and changes
- * the type to the #I18N_FORMATTABLE_K_STRING.
+ * the type to the #I18N_FORMATTABLE_TYPE_STRING.
* @since_tizen 3.0
*
* @param[in] formattable A handle to the formattable object
* \#include <utils_i18n.h>
*
* @section CAPI_BASE_UTILS_I18N_FIELD_POSITION_MODULE_OVERVIEW Overview
- * @details Field position keeps track of the position of the field within the formatted
+ * @details Fields are identified by constants defined in *_format_field_e enumerations.
+ * The only fields currently supported are the fields accepted by the date formatter, see #i18n_udate_format_field_e.
+ * Field position keeps track of the position of the field within the formatted
* output with two indices: the index of the first character of the field and the index
* of the last character of the field. One version of the format function in the various
* Format modules requires a Field Position object as an argument. You use this format
/**
* @brief Creates a field position object for the given field.
- * @details Fields are identified by constants, whose names typically end with _FIELD,
- * in the various subtypes of Format.
+ * @details The only fields currently supported are the fields accepted by the date formatter,
+ * see #i18n_udate_format_field_e.
* @since_tizen 2.3.2
* @remarks The created object should be released by the caller with the
* i18n_field_position_destroy() function.
* @return @c 0 on success, otherwise a negative error value
* @retval #I18N_ERROR_NONE Successful
* @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
- * @retval #I18N_ERROR_UNKNOWN Unknown error
+ * @retval #I18N_ERROR_OUT_OF_MEMORY Out of memory
*/
int i18n_formattable_create_default(i18n_formattable_h *formattable);
* @return @c 0 on success, otherwise a negative error value
* @retval #I18N_ERROR_NONE Successful
* @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
- * @retval #I18N_ERROR_UNKNOWN Unknown error
+ * @retval #I18N_ERROR_OUT_OF_MEMORY Out of memory
*/
int i18n_formattable_create_with_udate(i18n_udate date, i18n_formattable_h *formattable);
* @return @c 0 on success, otherwise a negative error value
* @retval #I18N_ERROR_NONE Successful
* @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
- * @retval #I18N_ERROR_UNKNOWN Unknown error
+ * @retval #I18N_ERROR_OUT_OF_MEMORY Out of memory
*/
int i18n_formattable_create_with_double(double value, i18n_formattable_h *formattable);
* @return @c 0 on success, otherwise a negative error value
* @retval #I18N_ERROR_NONE Successful
* @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
- * @retval #I18N_ERROR_UNKNOWN Unknown error
+ * @retval #I18N_ERROR_OUT_OF_MEMORY Out of memory
*/
int i18n_formattable_create_with_long(int32_t value, i18n_formattable_h *formattable);
* @return @c 0 on success, otherwise a negative error value
* @retval #I18N_ERROR_NONE Successful
* @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
- * @retval #I18N_ERROR_UNKNOWN Unknown error
+ * @retval #I18N_ERROR_OUT_OF_MEMORY Out of memory
*/
int i18n_formattable_create_with_int64(int64_t value, i18n_formattable_h *formattable);
* @return @c 0 on success, otherwise a negative error value
* @retval #I18N_ERROR_NONE Successful
* @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
- * @retval #I18N_ERROR_UNKNOWN Unknown error
+ * @retval #I18N_ERROR_OUT_OF_MEMORY Out of memory
*/
int i18n_formattable_create_with_char_string(const char *str_to_copy, i18n_formattable_h *formattable);
* @return @c 0 on success, otherwise a negative error value
* @retval #I18N_ERROR_NONE Successful
* @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
- * @retval #I18N_ERROR_UNKNOWN Unknown error
+ * @retval #I18N_ERROR_OUT_OF_MEMORY Out of memory
*/
int i18n_formattable_create_with_formattable_array(const i18n_formattable_h *array_to_copy, int32_t count, i18n_formattable_h *formattable);
* @return @c 0 on success, otherwise a negative error value
* @retval #I18N_ERROR_NONE Successful
* @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
- * @retval #I18N_ERROR_UNKNOWN Unknown error
+ * @retval #I18N_ERROR_OUT_OF_MEMORY Out of memory
*/
int i18n_formattable_clone(i18n_formattable_h formattable, i18n_formattable_h *clone);
/**
* @brief Gets the array value and count of the given formattable object.
* @since_tizen 2.3.2
- * @remarks If this object is not of type #I18N_FORMATTABLE_K_ARRAY then the
- * result is undefined.
+ * @remarks If this object is not of type #I18N_FORMATTABLE_TYPE_ARRAY then the
+ * result is undefined.
*
* @param[in] formattable A handle to the formattable object
* @param[out] array A pointer to an array of #i18n_formattable_h handles
/**
* @brief Gets the date value of the given formattable object.
* @since_tizen 2.3.2
- * @remarks If this object is not of type #I18N_FORMATTABLE_K_DATE then the
+ * @remarks If this object is not of type #I18N_FORMATTABLE_TYPE_DATE then the
* result is undefined.
*
* @param[in] formattable A handle to the formattable object
/**
* @brief Gets the double value of the given formattable object.
* @since_tizen 2.3.2
- * @remarks If this object is not of type #I18N_FORMATTABLE_K_DOUBLE then the
+ * @remarks If this object is not of type #I18N_FORMATTABLE_TYPE_DOUBLE then the
* result is undefined.
*
* @param[in] formattable A handle to the formattable object
/**
* @brief Gets the int64 value of the given formattable object.
* @since_tizen 2.3.2
- * @remarks If this object is not of type #I18N_FORMATTABLE_K_INT64 then the
+ * @remarks If this object is not of type #I18N_FORMATTABLE_TYPE_INT64 then the
* result is undefined.
*
* @param[in] formattable A handle to the formattable object
* @retval #I18N_ERROR_NONE Successful
* @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
* @retval #I18N_ERROR_INVALID_FORMAT The given formattable type is not a string
+ * @retval #I18N_ERROR_OUT_OF_MEMORY Out of memory
* @retval #I18N_ERROR_UNKNOWN Unknown error
*/
int i18n_formattable_get_string(i18n_formattable_h formattable, char **value);
/**
* @brief Sets the variable pointed by the @a is_numeric pointer to @c true if
- * the data type of the given formattable object is #I18N_FORMATTABLE_K_DOUBLE,
- * #I18N_FORMATTABLE_K_LONG or #I18N_FORMATTABLE_K_INT64.
+ * the data type of the given formattable object is #I18N_FORMATTABLE_TYPE_DOUBLE,
+ * #I18N_FORMATTABLE_TYPE_LONG or #I18N_FORMATTABLE_TYPE_INT64.
* @since_tizen 2.3.2
*
* @param[in] formattable A handle to the formattable object
/**
* @brief Sets the object pointed by the @a element pointer to the element at
* the @a index position in the array stored by the given formattable
- * object (if its type is #I18N_FORMATTABLE_K_ARRAY).
+ * object (if its type is #I18N_FORMATTABLE_TYPE_ARRAY).
* @since_tizen 2.3.2
- * @remarks If this object is not of type #I18N_FORMATTABLE_K_ARRAY then the
+ * @remarks If this object is not of type #I18N_FORMATTABLE_TYPE_ARRAY then the
* result is undefined.
*
* The obtained formattable element should not be released by the caller
- * as it belongs to the given formattable object of type #I18N_FORMATTABLE_K_ARRAY.
+ * as it belongs to the given formattable object of type #I18N_FORMATTABLE_TYPE_ARRAY.
*
* @param[in] formattable A handle to the formattable object
* @param[in] index A number representing the position in the array from
/**
* @brief Sets the array value and count of the given formattable object and
- * changes the type to #I18N_FORMATTABLE_K_ARRAY.
+ * changes the type to #I18N_FORMATTABLE_TYPE_ARRAY.
* @since_tizen 2.3.2
*
* @param[in] formattable A handle to the formattable object
/**
* @brief Sets the date value of the given formattable object and changes the
- * type to the #I18N_FORMATTABLE_K_DATE.
+ * type to the #I18N_FORMATTABLE_TYPE_DATE.
* @since_tizen 2.3.2
*
* @param[in] formattable A handle to the formattable object
/**
* @brief Sets the double value of the given formattable object and changes
- * the type to the #I18N_FORMATTABLE_K_DOUBLE.
+ * the type to the #I18N_FORMATTABLE_TYPE_DOUBLE.
* @since_tizen 2.3.2
*
* @param[in] formattable A handle to the formattable object
/**
* @brief Sets the int64 value of the given formattable object and changes the
- * type to the #I18N_FORMATTABLE_K_INT64.
+ * type to the #I18N_FORMATTABLE_TYPE_INT64.
* @since_tizen 2.3.2
*
* @param[in] formattable A handle to the formattable object
/**
* @brief Sets the long value of the given formattable object and changes the
- * type to the #I18N_FORMATTABLE_K_LONG.
+ * type to the #I18N_FORMATTABLE_TYPE_LONG.
* @since_tizen 2.3.2
*
* @param[in] formattable A handle to the formattable object
/**
* @brief Sets the string value of the given formattable object and changes
- * the type to the #I18N_FORMATTABLE_K_STRING.
+ * the type to the #I18N_FORMATTABLE_TYPE_STRING.
* @since_tizen 2.3.2
*
* @param[in] formattable A handle to the formattable object
retv_if(formattable == NULL, I18N_ERROR_INVALID_PARAMETER);
*formattable = new Formattable();
- retv_if(*formattable == NULL, I18N_ERROR_UNKNOWN);
+ retv_if(*formattable == NULL, I18N_ERROR_OUT_OF_MEMORY);
return I18N_ERROR_NONE;
}
retv_if(formattable == NULL, I18N_ERROR_INVALID_PARAMETER);
*formattable = new Formattable(date, Formattable::kIsDate);
- retv_if(*formattable == NULL, I18N_ERROR_UNKNOWN);
+ retv_if(*formattable == NULL, I18N_ERROR_OUT_OF_MEMORY);
return I18N_ERROR_NONE;
}
retv_if(formattable == NULL, I18N_ERROR_INVALID_PARAMETER);
*formattable = new Formattable(d);
- retv_if(*formattable == NULL, I18N_ERROR_UNKNOWN);
+ retv_if(*formattable == NULL, I18N_ERROR_OUT_OF_MEMORY);
return I18N_ERROR_NONE;
}
retv_if(formattable == NULL, I18N_ERROR_INVALID_PARAMETER);
*formattable = new Formattable(l);
- retv_if(*formattable == NULL, I18N_ERROR_UNKNOWN);
+ retv_if(*formattable == NULL, I18N_ERROR_OUT_OF_MEMORY);
return I18N_ERROR_NONE;
}
retv_if(formattable == NULL, I18N_ERROR_INVALID_PARAMETER);
*formattable = new Formattable(ll);
- retv_if(*formattable == NULL, I18N_ERROR_UNKNOWN);
+ retv_if(*formattable == NULL, I18N_ERROR_OUT_OF_MEMORY);
return I18N_ERROR_NONE;
}
retv_if(formattable == NULL, I18N_ERROR_INVALID_PARAMETER);
*formattable = new Formattable(str_to_copy);
- retv_if(*formattable == NULL, I18N_ERROR_UNKNOWN);
+ retv_if(*formattable == NULL, I18N_ERROR_OUT_OF_MEMORY);
return I18N_ERROR_NONE;
}
delete[] f_array;
- retv_if(*formattable == NULL, I18N_ERROR_UNKNOWN);
+ retv_if(*formattable == NULL, I18N_ERROR_OUT_OF_MEMORY);
return I18N_ERROR_NONE;
}
retv_if(clone == NULL, I18N_ERROR_INVALID_PARAMETER);
*clone = ((Formattable *) formattable)->clone();
- retv_if(*clone == NULL, I18N_ERROR_UNKNOWN);
+ retv_if(*clone == NULL, I18N_ERROR_OUT_OF_MEMORY);
return I18N_ERROR_NONE;
}
retv_if(ulen <= 0, I18N_ERROR_UNKNOWN);
*value = (char *) malloc(ulen + 1);
- retv_if(*value == NULL, I18N_ERROR_UNKNOWN);
+ retv_if(*value == NULL, I18N_ERROR_OUT_OF_MEMORY);
u_austrcpy(*value, uchar_result);