static PyObject *meth_QXmlNamespaceSupport_prefix(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        const QString * a0;
        int a0State = 0;
        QXmlNamespaceSupport *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ1", &sipSelf, sipType_QXmlNamespaceSupport, &sipCpp, sipType_QString,&a0, &a0State))
        {
            QString *sipRes;

            Py_BEGIN_ALLOW_THREADS
            sipRes = new QString(sipCpp->prefix(*a0));
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast<QString *>(a0),sipType_QString,a0State);

            return sipConvertFromNewType(sipRes,sipType_QString,NULL);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_QXmlNamespaceSupport, sipName_prefix, NULL);

    return NULL;
}
static PyObject *meth_QXmlNamespaceSupport_setPrefix(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        const QString * a0;
        int a0State = 0;
        const QString * a1;
        int a1State = 0;
        QXmlNamespaceSupport *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ1J1", &sipSelf, sipType_QXmlNamespaceSupport, &sipCpp, sipType_QString,&a0, &a0State, sipType_QString,&a1, &a1State))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp->setPrefix(*a0,*a1);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast<QString *>(a0),sipType_QString,a0State);
            sipReleaseType(const_cast<QString *>(a1),sipType_QString,a1State);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_QXmlNamespaceSupport, sipName_setPrefix, NULL);

    return NULL;
}
static PyObject *meth_QXmlNamespaceSupport_processName(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        const QString * a0;
        int a0State = 0;
        bool a1;
        QString * a2;
        int a2State = 0;
        QString * a3;
        int a3State = 0;
        QXmlNamespaceSupport *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ1bJ1J1", &sipSelf, sipType_QXmlNamespaceSupport, &sipCpp, sipType_QString,&a0, &a0State, &a1, sipType_QString,&a2, &a2State, sipType_QString,&a3, &a3State))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp->processName(*a0,a1,*a2,*a3);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast<QString *>(a0),sipType_QString,a0State);
            sipReleaseType(a2,sipType_QString,a2State);
            sipReleaseType(a3,sipType_QString,a3State);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_QXmlNamespaceSupport, sipName_processName, NULL);

    return NULL;
}
Ejemplo n.º 4
0
void XMLHandler::fixUpNSURI(QString &uri, const QString &qname)
{
    /* QXml does not resolve the namespaces of attributes in the same
       tag that preceed the xmlns declaration. This fixes up that case */
    if(uri.isEmpty() && qname.find(':') != -1)
    {
        QXmlNamespaceSupport ns;
        QString localName, prefix;
        ns.splitName(qname, prefix, localName);
        if(namespaceInfo.contains(prefix))
        {
            uri = namespaceInfo[prefix].top();
        }
    }
}
static PyObject *meth_QXmlNamespaceSupport_prefixes(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        QXmlNamespaceSupport *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QXmlNamespaceSupport, &sipCpp))
        {
            QStringList *sipRes;

            Py_BEGIN_ALLOW_THREADS
            sipRes = new QStringList(sipCpp->prefixes());
            Py_END_ALLOW_THREADS

            return sipConvertFromNewType(sipRes,sipType_QStringList,NULL);
        }
    }