Commit 8d4130cb authored by Andi Vajda's avatar Andi Vajda
Browse files

added FieldPosition-less overloads to RuleBasedNumberFormat.format()

parent 4569a8ef
...@@ -3,6 +3,7 @@ Version 2.7.4 -> ...@@ -3,6 +3,7 @@ Version 2.7.4 ->
- fixed test failure in test_DateTimeParserGenerator.py with version 70.1rc - fixed test failure in test_DateTimeParserGenerator.py with version 70.1rc
- added wrappers for UCurrNameStyle and for ucurr_getName() onto CurrencyUnit - added wrappers for UCurrNameStyle and for ucurr_getName() onto CurrencyUnit
- added support for ICU 70.1 - added support for ICU 70.1
- added FieldPosition-less overloads to RuleBasedNumberFormat.format()
- -
Version 2.7.3 -> 2.7.4 Version 2.7.3 -> 2.7.4
......
...@@ -3099,9 +3099,27 @@ static PyObject *t_rulebasednumberformat_format(t_rulebasednumberformat *self, ...@@ -3099,9 +3099,27 @@ static PyObject *t_rulebasednumberformat_format(t_rulebasednumberformat *self,
double d; double d;
int i; int i;
PY_LONG_LONG l; PY_LONG_LONG l;
FieldPosition *fp; FieldPosition _fp, *fp;
switch (PyTuple_Size(args)) { switch (PyTuple_Size(args)) {
case 2:
if (!parseArgs(args, "dS", &d, &u, &_u))
{
STATUS_CALL(self->object->format(d, *u, _v, _fp, status));
return PyUnicode_FromUnicodeString(&_v);
}
if (!parseArgs(args, "iS", &i, &u, &_u))
{
STATUS_CALL(self->object->format(i, *u, _v, _fp, status));
return PyUnicode_FromUnicodeString(&_v);
}
if (!parseArgs(args, "LS", &l, &u, &_u))
{
STATUS_CALL(self->object->format((int64_t) l, *u, _v, _fp, status));
return PyUnicode_FromUnicodeString(&_v);
}
break;
case 3: case 3:
if (!parseArgs(args, "dSP", TYPE_CLASSID(FieldPosition), if (!parseArgs(args, "dSP", TYPE_CLASSID(FieldPosition),
&d, &u, &_u, &fp)) &d, &u, &_u, &fp))
...@@ -3118,9 +3136,11 @@ static PyObject *t_rulebasednumberformat_format(t_rulebasednumberformat *self, ...@@ -3118,9 +3136,11 @@ static PyObject *t_rulebasednumberformat_format(t_rulebasednumberformat *self,
if (!parseArgs(args, "LSP", TYPE_CLASSID(FieldPosition), if (!parseArgs(args, "LSP", TYPE_CLASSID(FieldPosition),
&l, &u, &_u, &fp)) &l, &u, &_u, &fp))
{ {
STATUS_CALL(self->object->format((int64_t) l, *u, _v, *fp, status)); STATUS_CALL(self->object->format((int64_t) l, *u, _v, *fp, status));
return PyUnicode_FromUnicodeString(&_v); return PyUnicode_FromUnicodeString(&_v);
} }
break;
case 4: case 4:
if (!parseArgs(args, "dSUP", TYPE_CLASSID(FieldPosition), if (!parseArgs(args, "dSUP", TYPE_CLASSID(FieldPosition),
&d, &u, &_u, &v, &fp)) &d, &u, &_u, &v, &fp))
...@@ -3137,7 +3157,7 @@ static PyObject *t_rulebasednumberformat_format(t_rulebasednumberformat *self, ...@@ -3137,7 +3157,7 @@ static PyObject *t_rulebasednumberformat_format(t_rulebasednumberformat *self,
if (!parseArgs(args, "LSUP", TYPE_CLASSID(FieldPosition), if (!parseArgs(args, "LSUP", TYPE_CLASSID(FieldPosition),
&l, &u, &_u, &v, &fp)) &l, &u, &_u, &v, &fp))
{ {
STATUS_CALL(self->object->format((int64_t) l, *u, *v, *fp, status)); STATUS_CALL(self->object->format((int64_t) l, *u, *v, *fp, status));
Py_RETURN_ARG(args, 2); Py_RETURN_ARG(args, 2);
} }
break; break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment