Tizen Native API
3.0
|
The MeasureFormat is a formatter for Measure objects.
Required Header
#include <utils_i18n.h>
Overview
Functions | |
int | i18n_measure_format_create (const char *language, const char *country, i18n_umeasure_format_width_e width, i18n_measure_format_h *measure_format) |
Creates the measure format object using given locale. | |
int | i18n_measure_format_destroy (i18n_measure_format_h measure_format) |
Destroys the measure format object. | |
int | i18n_measure_format_clone (i18n_measure_format_h measure_format, i18n_format_h *clone) |
Creates a polymorphic clone of the given measure_format object. | |
int | i18n_measure_format_format (i18n_measure_format_h measure_format, i18n_formattable_h formattable, char **append_to, i18n_field_position_h field_position) |
Formats an object to produce a string. | |
int | i18n_measure_format_parse_object (i18n_measure_format_h measure_format, const char *source, i18n_parse_position_h parse_position, i18n_formattable_h *result) |
Parses a string to produce an object. | |
int | i18n_measure_format_create_currency_format_from_locale (const char *language, const char *country, i18n_measure_format_h *measure_format) |
Gets a formatter for currency amount objects in the given locale. | |
int | i18n_measure_format_create_currency_format (i18n_measure_format_h *measure_format) |
Gets a formatter for currency amount objects in the default locale. | |
Typedefs | |
typedef void * | i18n_measure_format_h |
Handle to the object that represents a formatter for measure objects. |
Typedef Documentation
typedef void* i18n_measure_format_h |
Handle to the object that represents a formatter for measure objects.
- Since :
- 3.0
Enumeration Type Documentation
Enumeration for various widths.
- Since :
- 3.0
- Enumerator:
Function Documentation
int i18n_measure_format_clone | ( | i18n_measure_format_h | measure_format, |
i18n_format_h * | clone | ||
) |
Creates a polymorphic clone of the given measure_format object.
- Since :
- 2.3.2 and 3.0
- Remarks:
- The clone object should be released by the caller with the i18n_measure_format_destroy() function.
- Parameters:
-
[in] measure_format The measure format object to be cloned [out] clone The created measure format object
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
I18N_ERROR_NONE Successful I18N_ERROR_INVALID_PARAMETER Invalid function parameter I18N_ERROR_OUT_OF_MEMORY Out of memory
int i18n_measure_format_create | ( | const char * | language, |
const char * | country, | ||
i18n_umeasure_format_width_e | width, | ||
i18n_measure_format_h * | measure_format | ||
) |
Creates the measure format object using given locale.
- Since :
- 2.3.2 and 3.0
- Remarks:
- The created object should be released by the caller with the i18n_measure_format_destroy() function.
- Parameters:
-
[in] language The language of the locale [in] country The country of the locale [in] width The format width [out] measure_format The created measure format object
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
I18N_ERROR_NONE Successful I18N_ERROR_INVALID_PARAMETER Invalid function parameter I18N_ERROR_OUT_OF_MEMORY Out of memory
int i18n_measure_format_create_currency_format | ( | i18n_measure_format_h * | measure_format | ) |
Gets a formatter for currency amount objects in the default locale.
- Since :
- 2.3.2 and 3.0
- Remarks:
- The created object should be released by the caller with the i18n_measure_format_destroy() function.
- Parameters:
-
[out] measure_format The measure format object
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
I18N_ERROR_NONE Successful I18N_ERROR_INVALID_PARAMETER Invalid function parameter I18N_ERROR_OUT_OF_MEMORY Out of memory
int i18n_measure_format_create_currency_format_from_locale | ( | const char * | language, |
const char * | country, | ||
i18n_measure_format_h * | measure_format | ||
) |
Gets a formatter for currency amount objects in the given locale.
- Since :
- 2.3.2 and 3.0
- Remarks:
- The created object should be released by the caller with the i18n_measure_format_destroy() function.
- Parameters:
-
[in] language The language of the locale [in] country The country of the locale [out] measure_format The measure format object
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
I18N_ERROR_NONE Successful I18N_ERROR_INVALID_PARAMETER Invalid function parameter I18N_ERROR_OUT_OF_MEMORY Out of memory
int i18n_measure_format_destroy | ( | i18n_measure_format_h | measure_format | ) |
Destroys the measure format object.
- Since :
- 2.3.2 and 3.0
- Parameters:
-
[in] measure_format The measure format object to destroy
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
I18N_ERROR_NONE Successful I18N_ERROR_INVALID_PARAMETER Invalid function parameter
int i18n_measure_format_format | ( | i18n_measure_format_h | measure_format, |
i18n_formattable_h | formattable, | ||
char ** | append_to, | ||
i18n_field_position_h | field_position | ||
) |
Formats an object to produce a string.
- Since :
- 2.3.2 and 3.0
- Remarks:
- The obtained append_to string is actually a concatenation of the given input string and the result of the function (appended to the string). Actually, the append_to buffer is being reallocated inside the function which means that the buffer is not at the same place in memory as it was on the input. Please note that the append_to buffer should be released by the caller with the free() function.
- Parameters:
-
[in] measure_format The format object [in] formattable The object to format [out] append_to Input/output parameter to receive the result. The result is appended to the existing contents. [out] field_position On input: an alignment field, if desired. On output: the offsets of the alignment field.
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
I18N_ERROR_NONE Successful I18N_ERROR_INVALID_PARAMETER Invalid function parameter I18N_ERROR_OUT_OF_MEMORY Out of memory
int i18n_measure_format_parse_object | ( | i18n_measure_format_h | measure_format, |
const char * | source, | ||
i18n_parse_position_h | parse_position, | ||
i18n_formattable_h * | result | ||
) |
Parses a string to produce an object.
- Since :
- 2.3.2 and 3.0
- Remarks:
- The obtained result object should be released by the caller with the i18n_formattable_destroy() function.
- Parameters:
-
[in] measure_format The format object [in] source The string to be parsed into an object [out] parse_position The position to start parsing at. Upon return this parameter is set to the position after the last character successfully parsed. If the source is not parsed successfully, this parameter will remain unchanged. [out] result The formattable object to be set to the parse result. If parse fails, return contents are undefined.
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
I18N_ERROR_NONE Successful I18N_ERROR_INVALID_PARAMETER Invalid function parameter I18N_ERROR_OUT_OF_MEMORY Out of memory