Tizen Native API  5.0
Measure

Measure object contains an amount of a specified unit, consisting of a number and an unit.

Required Header

#include <utils_i18n.h>

Overview

Functions

int i18n_measure_create (const i18n_formattable_h formattable, i18n_measure_unit_h measure_unit, i18n_measure_h *measure)
 Creates an object with the given numeric amount and the given unit.
int i18n_measure_clone (i18n_measure_h measure, i18n_measure_h *clone)
 Creates a polymorphic clone of the given clone object.
int i18n_measure_destroy (i18n_measure_h measure)
 Destroys the measure object.
int i18n_measure_get_number (i18n_measure_h measure, i18n_formattable_h *formattable)
 Gets a reference to the numeric value of the measure object.
int i18n_measure_get_unit (i18n_measure_h measure, i18n_measure_unit_h *measure_unit)
 Gets a reference to the unit of the measure object.

Typedefs

typedef void * i18n_measure_h
 Handle to the object that represents an amount of a specified unit.

Typedef Documentation

typedef void* i18n_measure_h

Handle to the object that represents an amount of a specified unit.

Since :
3.0

Function Documentation

int i18n_measure_clone ( i18n_measure_h  measure,
i18n_measure_h clone 
)

Creates a polymorphic clone of the given clone object.

Since :
2.3.2 and 3.0
Remarks:
The clone object should be released by the caller with the i18n_measure_destroy() function.
Parameters:
[in]measureThe measure object to be cloned
[out]cloneThe created measure object
Returns:
0 on success, otherwise a negative error value
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
I18N_ERROR_OUT_OF_MEMORYOut of memory
int i18n_measure_create ( const i18n_formattable_h  formattable,
i18n_measure_unit_h  measure_unit,
i18n_measure_h measure 
)

Creates an object with the given numeric amount and the given unit.

After this call, the caller must not delete the given measure unit object.

Since :
2.3.2 and 3.0
Remarks:
The created object should be released by the caller with the i18n_measure_destroy() function.
Parameters:
[in]formattableA numeric object; The i18n_formattable_is_numeric() function must return true for this object.
[in]measure_unitThe unit object, which must not be NULL
[out]measureThe created measure object
Returns:
0 on success, otherwise a negative error value
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
I18N_ERROR_OUT_OF_MEMORYOut of memory

Destroys the measure object.

Since :
2.3.2 and 3.0
Parameters:
[in]measureThe measure object to destroy
Returns:
0 on success, otherwise a negative error value
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
int i18n_measure_get_number ( i18n_measure_h  measure,
i18n_formattable_h formattable 
)

Gets a reference to the numeric value of the measure object.

Since :
2.3.2 and 3.0
Remarks:
The obtained formattable object should be released by the caller with the i18n_formattable_destroy() function.
Parameters:
[in]measureThe measure object
[out]formattableThe numeric value of the measure object
Returns:
0 on success, otherwise a negative error value
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
I18N_ERROR_OUT_OF_MEMORYOut of memory
int i18n_measure_get_unit ( i18n_measure_h  measure,
i18n_measure_unit_h measure_unit 
)

Gets a reference to the unit of the measure object.

Since :
2.3.2 and 3.0
Remarks:
The obtained measure unit object should be released by the caller with the i18n_measure_unit_destroy() function.
Parameters:
[in]measureThe measure object
[out]measure_unitThe unit of the measure object
Returns:
0 on success, otherwise a negative error value
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
I18N_ERROR_OUT_OF_MEMORYOut of memory