mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-20 15:27:32 +09:00
Issue #1756 - Initial wrapped implementation in C++
This commit is contained in:
parent
618fa768c8
commit
5df0028108
10 changed files with 760 additions and 27 deletions
|
|
@ -875,4 +875,32 @@ unum_formatUFormattable(const UNumberFormat* fmt,
|
|||
return res.extract(result, resultLength, *status);
|
||||
}
|
||||
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
unum_formatDoubleForFields(const UNumberFormat* format,
|
||||
double number,
|
||||
UChar* result,
|
||||
int32_t resultLength,
|
||||
UFieldPositionIterator* fpositer,
|
||||
UErrorCode* status)
|
||||
{
|
||||
if (U_FAILURE(*status))
|
||||
return -1;
|
||||
|
||||
if (result == NULL ? resultLength != 0 : resultLength < 0) {
|
||||
*status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return -1;
|
||||
}
|
||||
|
||||
UnicodeString res;
|
||||
if (result != NULL) {
|
||||
// NULL destination for pure preflighting: empty dummy string
|
||||
// otherwise, alias the destination buffer
|
||||
res.setTo(result, 0, resultLength);
|
||||
}
|
||||
|
||||
((const NumberFormat*)format)->format(number, res, (FieldPositionIterator*)fpositer, *status);
|
||||
|
||||
return res.extract(result, resultLength, *status);
|
||||
}
|
||||
|
||||
#endif /* #if !UCONFIG_NO_FORMATTING */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue