From f8859bc87280e5e240b67d948c182e435f034d2a Mon Sep 17 00:00:00 2001 From: Rafal Szczekutek Date: Tue, 26 Jul 2016 16:05:26 +0200 Subject: [PATCH] [Base-utils][Formattable] Fixes related to the ACR comments This commit contains fixes related to the ACR-661 comments posted on 26.07.2016 Change-Id: I38c9d5dff0f173f3eff1461b321e07ce7269ecff Signed-off-by: Rafal Szczekutek --- src/include/mobile/utils_i18n_field_position.h | 8 ++-- src/include/mobile/utils_i18n_formattable.h | 47 ++++++++++++----------- src/include/wearable/utils_i18n_field_position.h | 8 ++-- src/include/wearable/utils_i18n_formattable.h | 49 ++++++++++++------------ src/utils_i18n_formattable.cpp | 18 ++++----- 5 files changed, 68 insertions(+), 62 deletions(-) diff --git a/src/include/mobile/utils_i18n_field_position.h b/src/include/mobile/utils_i18n_field_position.h index e349420..9ea3878 100644 --- a/src/include/mobile/utils_i18n_field_position.h +++ b/src/include/mobile/utils_i18n_field_position.h @@ -38,7 +38,9 @@ extern "C" { * \#include * * @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 @@ -68,8 +70,8 @@ int i18n_field_position_create(i18n_field_position_h *field_position); /** * @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. diff --git a/src/include/mobile/utils_i18n_formattable.h b/src/include/mobile/utils_i18n_formattable.h index fa371ee..4c76c90 100644 --- a/src/include/mobile/utils_i18n_formattable.h +++ b/src/include/mobile/utils_i18n_formattable.h @@ -63,7 +63,7 @@ extern "C" { * @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); @@ -80,7 +80,7 @@ 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); @@ -97,7 +97,7 @@ int i18n_formattable_create_with_udate(i18n_udate date, i18n_formattable_h *form * @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); @@ -114,7 +114,7 @@ int i18n_formattable_create_with_double(double value, i18n_formattable_h *format * @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); @@ -131,7 +131,7 @@ int i18n_formattable_create_with_long(int32_t value, i18n_formattable_h *formatt * @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); @@ -149,7 +149,7 @@ int i18n_formattable_create_with_int64(int64_t value, i18n_formattable_h *format * @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); @@ -168,7 +168,7 @@ int i18n_formattable_create_with_char_string(const char *str_to_copy, i18n_forma * @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); @@ -199,14 +199,14 @@ int i18n_formattable_destroy(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 @@ -223,7 +223,7 @@ int i18n_formattable_get_array(i18n_formattable_h formattable, i18n_formattable_ /** * @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 @@ -239,7 +239,7 @@ int i18n_formattable_get_date(i18n_formattable_h formattable, i18n_udate *date); /** * @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 @@ -255,7 +255,7 @@ int i18n_formattable_get_double(i18n_formattable_h formattable, double *value); /** * @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 @@ -301,6 +301,7 @@ int i18n_formattable_get_long(i18n_formattable_h formattable, int32_t *value); * @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); @@ -322,8 +323,8 @@ int i18n_formattable_get_type(i18n_formattable_h formattable, i18n_formattable_t /** * @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 @@ -373,13 +374,13 @@ int i18n_formattable_equal(i18n_formattable_h formattable, i18n_formattable_h ot /** * @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 @@ -397,7 +398,7 @@ int i18n_formattable_element_at(i18n_formattable_h formattable, int32_t index, i /** * @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 @@ -412,7 +413,7 @@ int i18n_formattable_set_array(i18n_formattable_h formattable, const i18n_format /** * @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 @@ -426,7 +427,7 @@ int i18n_formattable_set_date(i18n_formattable_h formattable, i18n_udate date); /** * @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 @@ -440,7 +441,7 @@ int i18n_formattable_set_double(i18n_formattable_h formattable, double value); /** * @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 @@ -454,7 +455,7 @@ int i18n_formattable_set_int64(i18n_formattable_h formattable, int64_t value); /** * @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 @@ -468,7 +469,7 @@ int i18n_formattable_set_long(i18n_formattable_h formattable, int32_t value); /** * @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 diff --git a/src/include/wearable/utils_i18n_field_position.h b/src/include/wearable/utils_i18n_field_position.h index 88179b2..04b8b42 100644 --- a/src/include/wearable/utils_i18n_field_position.h +++ b/src/include/wearable/utils_i18n_field_position.h @@ -38,7 +38,9 @@ extern "C" { * \#include * * @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 @@ -68,8 +70,8 @@ int i18n_field_position_create(i18n_field_position_h *field_position); /** * @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. diff --git a/src/include/wearable/utils_i18n_formattable.h b/src/include/wearable/utils_i18n_formattable.h index d10c678..4f228d5 100644 --- a/src/include/wearable/utils_i18n_formattable.h +++ b/src/include/wearable/utils_i18n_formattable.h @@ -63,7 +63,7 @@ extern "C" { * @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); @@ -80,7 +80,7 @@ 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); @@ -97,7 +97,7 @@ int i18n_formattable_create_with_udate(i18n_udate date, i18n_formattable_h *form * @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); @@ -114,7 +114,7 @@ int i18n_formattable_create_with_double(double value, i18n_formattable_h *format * @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); @@ -131,7 +131,7 @@ int i18n_formattable_create_with_long(int32_t value, i18n_formattable_h *formatt * @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); @@ -149,7 +149,7 @@ int i18n_formattable_create_with_int64(int64_t value, i18n_formattable_h *format * @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); @@ -168,7 +168,7 @@ int i18n_formattable_create_with_char_string(const char *str_to_copy, i18n_forma * @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); @@ -199,15 +199,15 @@ int i18n_formattable_destroy(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 @@ -223,7 +223,7 @@ int i18n_formattable_get_array(i18n_formattable_h formattable, i18n_formattable_ /** * @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 @@ -239,7 +239,7 @@ int i18n_formattable_get_date(i18n_formattable_h formattable, i18n_udate *date); /** * @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 @@ -255,7 +255,7 @@ int i18n_formattable_get_double(i18n_formattable_h formattable, double *value); /** * @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 @@ -301,6 +301,7 @@ int i18n_formattable_get_long(i18n_formattable_h formattable, int32_t *value); * @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); @@ -322,8 +323,8 @@ int i18n_formattable_get_type(i18n_formattable_h formattable, i18n_formattable_t /** * @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 @@ -373,13 +374,13 @@ int i18n_formattable_equal(i18n_formattable_h formattable, i18n_formattable_h ot /** * @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 @@ -397,7 +398,7 @@ int i18n_formattable_element_at(i18n_formattable_h formattable, int32_t index, i /** * @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 @@ -412,7 +413,7 @@ int i18n_formattable_set_array(i18n_formattable_h formattable, const i18n_format /** * @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 @@ -426,7 +427,7 @@ int i18n_formattable_set_date(i18n_formattable_h formattable, i18n_udate date); /** * @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 @@ -440,7 +441,7 @@ int i18n_formattable_set_double(i18n_formattable_h formattable, double value); /** * @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 @@ -454,7 +455,7 @@ int i18n_formattable_set_int64(i18n_formattable_h formattable, int64_t value); /** * @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 @@ -468,7 +469,7 @@ int i18n_formattable_set_long(i18n_formattable_h formattable, int32_t value); /** * @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 diff --git a/src/utils_i18n_formattable.cpp b/src/utils_i18n_formattable.cpp index 598f57b..6cf34b3 100644 --- a/src/utils_i18n_formattable.cpp +++ b/src/utils_i18n_formattable.cpp @@ -25,7 +25,7 @@ int i18n_formattable_create_default(i18n_formattable_h *formattable) 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; } @@ -35,7 +35,7 @@ int i18n_formattable_create_with_udate(i18n_udate date, i18n_formattable_h *form 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; } @@ -45,7 +45,7 @@ int i18n_formattable_create_with_double(double d, i18n_formattable_h *formattabl 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; } @@ -55,7 +55,7 @@ int i18n_formattable_create_with_long(int32_t l, i18n_formattable_h *formattable 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; } @@ -65,7 +65,7 @@ int i18n_formattable_create_with_int64(int64_t ll, i18n_formattable_h *formattab 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; } @@ -75,7 +75,7 @@ int i18n_formattable_create_with_char_string(const char *str_to_copy, i18n_forma 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; } @@ -99,7 +99,7 @@ int i18n_formattable_create_with_formattable_array(const i18n_formattable_h *arr delete[] f_array; - retv_if(*formattable == NULL, I18N_ERROR_UNKNOWN); + retv_if(*formattable == NULL, I18N_ERROR_OUT_OF_MEMORY); return I18N_ERROR_NONE; } @@ -121,7 +121,7 @@ int i18n_formattable_clone(i18n_formattable_h formattable, i18n_formattable_h *c 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; } @@ -206,7 +206,7 @@ int i18n_formattable_get_string(i18n_formattable_h formattable, char **value) 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); -- 2.7.4