*/
#include <utils_i18n_measure_format.h>
+#include <utils_i18n_ustring.h>
#include <utils_i18n_private.h>
#include <malloc.h>
#include <vector>
#include <unicode/measfmt.h>
#include <unicode/measure.h>
-#include <unicode/ustring.h>
int i18n_measure_format_create(const char *language,
const char *country,
unicode_append_to,
*((FieldPosition *) field_position),
status);
- const UChar *uchar_result = result.getTerminatedBuffer();
+ const i18n_uchar *uchar_result = (i18n_uchar *)result.getTerminatedBuffer();
retv_if(uchar_result == NULL, I18N_ERROR_INVALID_PARAMETER);
- int32_t ulen = u_strlen(uchar_result);
+ int32_t ulen = i18n_ustring_get_length(uchar_result);
retv_if(ulen <= 0, I18N_ERROR_INVALID_PARAMETER);
free(*append_to);
retv_if(*append_to == NULL, I18N_ERROR_OUT_OF_MEMORY);
- u_austrcpy(*append_to, uchar_result);
+ i18n_ustring_copy_au(*append_to, uchar_result);
return _i18n_error_mapping(status);
}
unicode_append_to,
*((FieldPosition *) field_position),
status);
- const UChar *uchar_result = result.getTerminatedBuffer();
+ const i18n_uchar *uchar_result = (i18n_uchar *)result.getTerminatedBuffer();
retv_if(uchar_result == NULL, I18N_ERROR_INVALID_PARAMETER);
- *output_length = u_strlen(uchar_result);
+ *output_length = i18n_ustring_get_length(uchar_result);
retv_if(append_to_size < *output_length, I18N_ERROR_BUFFER_OVERFLOW);
if (*output_length > 0)
- u_strncpy(append_to, uchar_result, append_to_size);
+ i18n_ustring_copy_n(append_to, uchar_result, append_to_size);
return _i18n_error_mapping(status);
}
*((FieldPosition *) field_position),
status);
- const UChar *uchar_result = result.getTerminatedBuffer();
+ const i18n_uchar *uchar_result = (i18n_uchar *)result.getTerminatedBuffer();
retv_if(uchar_result == NULL, I18N_ERROR_INVALID_PARAMETER);
- *output_length = u_strlen(uchar_result);
+ *output_length = i18n_ustring_get_length(uchar_result);
retv_if(append_to_size < *output_length, I18N_ERROR_BUFFER_OVERFLOW);
if (*output_length > 0)
- u_strncpy(append_to, uchar_result, append_to_size);
+ i18n_ustring_copy_n(append_to, uchar_result, append_to_size);
return _i18n_error_mapping(status);
}
*((FieldPosition *) field_position),
status);
- const UChar *uchar_result = result.getTerminatedBuffer();
+ const i18n_uchar *uchar_result = (i18n_uchar *)result.getTerminatedBuffer();
retv_if(uchar_result == NULL, I18N_ERROR_INVALID_PARAMETER);
- *output_length = u_strlen(uchar_result);
+ *output_length = i18n_ustring_get_length(uchar_result);
retv_if(append_to_size < *output_length, I18N_ERROR_BUFFER_OVERFLOW);
if (*output_length > 0)
- u_strncpy(append_to, uchar_result, append_to_size);
+ i18n_ustring_copy_n(append_to, uchar_result, append_to_size);
return _i18n_error_mapping(status);
}