/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.6.2
 *
 * Copyright (c) 2022 Riverbank Computing Limited <info@riverbankcomputing.com>
 * 
 * This file is part of PyQt5.
 * 
 * This file may be used under the terms of the GNU General Public License
 * version 3.0 as published by the Free Software Foundation and appearing in
 * the file LICENSE included in the packaging of this file.  Please review the
 * following information to ensure the GNU General Public License version 3.0
 * requirements will be met: http://www.gnu.org/copyleft/gpl.html.
 * 
 * If you do not wish to use this file under the terms of the GPL version 3.0
 * then you may purchase a commercial license.  For more information contact
 * info@riverbankcomputing.com.
 * 
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

#include "sipAPIQtCore.h"

#line 106 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qtextcodec.sip"
#include <qtextcodec.h>
#line 29 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQTextDecoder.cpp"

#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qtextcodec.sip"
#include <qtextcodec.h>
#line 33 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQTextDecoder.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qtextcodec.sip"
#include <qtextcodec.h>
#line 36 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQTextDecoder.cpp"
#line 27 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qstring.sip"
#include <qstring.h>
#line 39 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQTextDecoder.cpp"
#line 30 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qbytearray.sip"
#include <qbytearray.h>
#line 42 "/build/pyqt5/src/PyQt5-5.15.7/build/QtCore/sipQtCoreQTextDecoder.cpp"


PyDoc_STRVAR(doc_QTextDecoder_toUnicode, "toUnicode(self, PyQt5.sip.array[bytes]) -> str\n"
"toUnicode(self, Union[QByteArray, bytes, bytearray]) -> str");

extern "C" {static PyObject *meth_QTextDecoder_toUnicode(PyObject *, PyObject *);}
static PyObject *meth_QTextDecoder_toUnicode(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const char* a0;
        Py_ssize_t a1;
         ::QTextDecoder *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "Bk", &sipSelf, sipType_QTextDecoder, &sipCpp, &a0, &a1))
        {
             ::QString*sipRes;

            sipRes = new  ::QString(sipCpp->toUnicode(a0,(int)a1));

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

    {
        const  ::QByteArray* a0;
        int a0State = 0;
         ::QTextDecoder *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ1", &sipSelf, sipType_QTextDecoder, &sipCpp, sipType_QByteArray, &a0, &a0State))
        {
             ::QString*sipRes;

            sipRes = new  ::QString(sipCpp->toUnicode(*a0));
            sipReleaseType(const_cast< ::QByteArray *>(a0), sipType_QByteArray, a0State);

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

    sipNoMethod(sipParseErr, sipName_QTextDecoder, sipName_toUnicode, doc_QTextDecoder_toUnicode);

    return SIP_NULLPTR;
}


/* Call the instance's destructor. */
extern "C" {static void release_QTextDecoder(void *, int);}
static void release_QTextDecoder(void *sipCppV, int)
{
    delete reinterpret_cast< ::QTextDecoder *>(sipCppV);
}


extern "C" {static void dealloc_QTextDecoder(sipSimpleWrapper *);}
static void dealloc_QTextDecoder(sipSimpleWrapper *sipSelf)
{
    if (sipIsOwnedByPython(sipSelf))
    {
        release_QTextDecoder(sipGetAddress(sipSelf), 0);
    }
}


extern "C" {static void *init_type_QTextDecoder(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_QTextDecoder(sipSimpleWrapper *, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
     ::QTextDecoder *sipCpp = SIP_NULLPTR;

    {
        const  ::QTextCodec* a0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J8", sipType_QTextCodec, &a0))
        {
            sipCpp = new  ::QTextDecoder(a0);

            return sipCpp;
        }
    }

    {
        const  ::QTextCodec* a0;
         ::QTextCodec::ConversionFlags* a1;
        int a1State = 0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J8J1", sipType_QTextCodec, &a0, sipType_QTextCodec_ConversionFlags, &a1, &a1State))
        {
            sipCpp = new  ::QTextDecoder(a0,*a1);
            sipReleaseType(a1, sipType_QTextCodec_ConversionFlags, a1State);

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_QTextDecoder[] = {
    {sipName_toUnicode, meth_QTextDecoder_toUnicode, METH_VARARGS, doc_QTextDecoder_toUnicode}
};

PyDoc_STRVAR(doc_QTextDecoder, "\1QTextDecoder(QTextCodec)\n"
"QTextDecoder(QTextCodec, Union[QTextCodec.ConversionFlags, QTextCodec.ConversionFlag])");


static pyqt5ClassPluginDef plugin_QTextDecoder = {
    SIP_NULLPTR,
    0,
    SIP_NULLPTR,
    SIP_NULLPTR
};


sipClassTypeDef sipTypeDef_QtCore_QTextDecoder = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QTextDecoder,
        SIP_NULLPTR,
        &plugin_QTextDecoder
    },
    {
        sipNameNr_QTextDecoder,
        {0, 0, 1},
        1, methods_QTextDecoder,
        0, SIP_NULLPTR,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QTextDecoder,
    -1,
    -1,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_QTextDecoder,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QTextDecoder,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_QTextDecoder,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof ( ::QTextDecoder),
};
