Field Position is a simple type used by the Format module and its submodules to identify fields in formatted output.
Required Header
#include <utils_i18n.h>
Overview
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 function to perform partial formatting or to get information about the formatted output (such as the position of a field).
Typedef Documentation
Handle to the object of class used by the i18n_format_h and its subclasses to identify fields in a formatted output.
- Since :
- 3.0
Enumeration Type Documentation
DONT_CARE may be specified as the field to indicate that the caller doesn't need to specify a field.
- Since :
- 3.0
Function Documentation
Creates a clone of the given field_position object.
- Since :
- 2.3.2 and 3.0
- Parameters:
-
[in] | field_position | The field position object to be cloned |
[out] | clone | The created field position object |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
Creates a field position object with a non-specified field.
- Since :
- 2.3.2 and 3.0
- Parameters:
-
[out] | field_position | The created field position object |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
Creates a field position object for the given field.
The only fields currently supported are the fields accepted by the date formatter, see i18n_udate_format_field_e.
- Since :
- 2.3.2 and 3.0
- Parameters:
-
[in] | field | The field value |
[out] | field_position | The created field position object |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
Destroys the field position object.
- Since :
- 2.3.2 and 3.0
- Parameters:
-
[in] | field_position | The field position object to destroy |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
Retrieves the index of the first character in the requested field.
- Since :
- 2.3.2 and 3.0
- Parameters:
-
[in] | field_position | The field position object |
[out] | begin_index | The index of the first character in the requested field |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
Retrieves the index of the character following the last character in the requested field.
- Since :
- 2.3.2 and 3.0
- Parameters:
-
[in] | field_position | The field position object |
[out] | end_index | The index of the character following the last character in the requested field |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
Retrieves the field identifier.
- Since :
- 2.3.2 and 3.0
- Parameters:
-
[in] | field_position | The field_position object |
[out] | field | The field identifier |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
Sets the begin index.
- Since :
- 2.3.2 and 3.0
- Parameters:
-
[in] | field_position | The field_position object |
[in] | begin_index | The new value of the begin index |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
Sets the end index.
- Since :
- 2.3.2 and 3.0
- Parameters:
-
[in] | field_position | The field_position object |
[in] | end_index | The new value of the end index |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
Sets the field.
- Since :
- 2.3.2 and 3.0
- Parameters:
-
[in] | field_position | The field_position object |
[in] | field | The new value of the field |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-