当前位置: 首页>>代码示例>>C++>>正文


C++ STATUS_CALL函数代码示例

本文整理汇总了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);
}
开发者ID:fish2000,项目名称:pyicu-praxa,代码行数:51,代码来源:regex.cpp

示例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);
}
开发者ID:fish2000,项目名称:pyicu-praxa,代码行数:25,代码来源:regex.cpp

示例3: STATUS_CALL

static PyObject *t_resourcebundle_getInt(t_resourcebundle *self)
{
    int n;

    STATUS_CALL(n = self->object->getInt(status));
    return PyInt_FromLong(n);
}
开发者ID:ezmiller,项目名称:pyicu,代码行数:7,代码来源:locale.cpp

示例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);
}
开发者ID:ezmiller,项目名称:pyicu,代码行数:7,代码来源:search.cpp

示例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);
}
开发者ID:ezmiller,项目名称:pyicu,代码行数:19,代码来源:locale.cpp

示例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);
}
开发者ID:nikolamilosevic86,项目名称:SerbianComparisonExtractor,代码行数:21,代码来源:iterators.cpp

示例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);
}
开发者ID:nikolamilosevic86,项目名称:SerbianComparisonExtractor,代码行数:12,代码来源:iterators.cpp


注:本文中的STATUS_CALL函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。