本文整理汇总了C++中STATUS_CALL函数的典型用法代码示例。如果您正苦于以下问题:C++ STATUS_CALL函数的具体用法?C++ STATUS_CALL怎么用?C++ STATUS_CALL使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了STATUS_CALL函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: STATUS_CALL
static PyObject *t_regexmatcher_split(t_regexmatcher *self, PyObject *args)
{
UnicodeString *u, _u;
int capacity, count;
if (!parseArgs(args, "Si", &u, &_u, &capacity))
{
if (capacity < 32)
{
UnicodeString array[31];
PyObject *tuple;
STATUS_CALL(count = self->object->split(*u, array, capacity,
status));
tuple = PyTuple_New(count);
for (int i = 0; i < count; i++)
PyTuple_SET_ITEM(tuple, i,
PyUnicode_FromUnicodeString(&array[i]));
return tuple;
}
else
{
class finalizer {
public:
UnicodeString *array;
finalizer(int size) {
array = new UnicodeString[size];
}
~finalizer() {
delete[] array;
}
};
finalizer finally(capacity);
PyObject *tuple;
if (!finally.array)
return PyErr_NoMemory();
STATUS_CALL(count = self->object->split(*u, finally.array,
capacity, status));
tuple = PyTuple_New(count);
for (int i = 0; i < count; i++)
PyTuple_SET_ITEM(tuple, i, PyUnicode_FromUnicodeString(&finally.array[i]));
return tuple;
}
}
return PyErr_SetArgsError((PyObject *) self, "split", args);
}
示例2: switch
static PyObject *t_regexmatcher_reset(t_regexmatcher *self, PyObject *args)
{
int32_t index;
UnicodeString *u, _u;
switch (PyTuple_Size(args)) {
case 0:
self->object->reset();
Py_RETURN_SELF();
case 1:
if (!parseArgs(args, "i", &index))
{
STATUS_CALL(self->object->reset(index, status));
Py_RETURN_SELF();
}
if (!parseArgs(args, "S", &u, &_u))
{
self->object->reset(*u);
Py_RETURN_SELF();
}
break;
}
return PyErr_SetArgsError((PyObject *) self, "reset", args);
}
示例3: STATUS_CALL
static PyObject *t_resourcebundle_getInt(t_resourcebundle *self)
{
int n;
STATUS_CALL(n = self->object->getInt(status));
return PyInt_FromLong(n);
}
示例4: STATUS_CALL
static PyObject *t_searchiterator_nextMatch(t_searchiterator *self)
{
int32_t next;
STATUS_CALL(next = self->object->next(status));
return PyInt_FromLong(next);
}
示例5: switch
static PyObject *t_locale_setDefault(PyTypeObject *type, PyObject *args)
{
Locale *locale;
switch (PyTuple_Size(args)) {
case 0:
STATUS_CALL(Locale::setDefault(NULL, status));
Py_RETURN_NONE;
case 1:
if (!parseArgs(args, "P", TYPE_CLASSID(Locale), &locale))
{
STATUS_CALL(Locale::setDefault(*locale, status)); /* transient */
Py_RETURN_NONE;
}
break;
}
return PyErr_SetArgsError(type, "setDefault", args);
}
示例6: switch
static PyObject *t_breakiterator_getLocale(t_breakiterator *self,
PyObject *args)
{
ULocDataLocaleType type;
Locale locale;
switch (PyTuple_Size(args)) {
case 0:
STATUS_CALL(locale = self->object->getLocale(ULOC_VALID_LOCALE, status));
return wrap_Locale(locale);
case 1:
if (!parseArgs(args, "i", &type))
{
STATUS_CALL(locale = self->object->getLocale(type, status));
return wrap_Locale(locale);
}
break;
}
return PyErr_SetArgsError((PyObject *) self, "getLocale", args);
}
示例7: STATUS_CALL
static PyObject *t_collationelementiterator_setOffset(t_collationelementiterator *self, PyObject *arg)
{
int offset;
if (!parseArg(arg, "i", &offset))
{
STATUS_CALL(self->object->setOffset(offset, status));
Py_RETURN_NONE;
}
return PyErr_SetArgsError((PyObject *) self, "setOffset", arg);
}