/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.6.2
 *
 * Copyright (c) 2022 Riverbank Computing Limited <info@riverbankcomputing.com>
 * 
 * This file is part of PyQt6.
 * 
 * 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 45 "/build/pyqt6/src/PyQt6-6.3.1/sip/QtCore/qstringconverter.sip"
#include <qstringconverter.h>
#line 29 "/build/pyqt6/src/PyQt6-6.3.1/build/QtCore/sipQtCoreQStringConverter.cpp"

#line 25 "/build/pyqt6/src/PyQt6-6.3.1/sip/QtCore/qflags.sip"
#include <qglobal.h>
#line 33 "/build/pyqt6/src/PyQt6-6.3.1/build/QtCore/sipQtCoreQStringConverter.cpp"
#line 26 "/build/pyqt6/src/PyQt6-6.3.1/sip/QtCore/qstringconverter.sip"
#include <qstringconverter.h>
#line 36 "/build/pyqt6/src/PyQt6-6.3.1/build/QtCore/sipQtCoreQStringConverter.cpp"


PyDoc_STRVAR(doc_QStringConverter_isValid, "isValid(self) -> bool");

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

    {
        const  ::QStringConverter *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QStringConverter, &sipCpp))
        {
            bool sipRes;

            sipRes = sipCpp->isValid();

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QStringConverter, sipName_isValid, doc_QStringConverter_isValid);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QStringConverter_resetState, "resetState(self)");

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

    {
         ::QStringConverter *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QStringConverter, &sipCpp))
        {
            sipCpp->resetState();

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QStringConverter, sipName_resetState, doc_QStringConverter_resetState);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QStringConverter_hasError, "hasError(self) -> bool");

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

    {
        const  ::QStringConverter *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QStringConverter, &sipCpp))
        {
            bool sipRes;

            sipRes = sipCpp->hasError();

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QStringConverter, sipName_hasError, doc_QStringConverter_hasError);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QStringConverter_name, "name(self) -> str");

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

    {
        const  ::QStringConverter *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QStringConverter, &sipCpp))
        {
            const char*sipRes;

            sipRes = sipCpp->name();

            if (sipRes == SIP_NULLPTR)
            {
                Py_INCREF(Py_None);
                return Py_None;
            }

            return PyUnicode_DecodeASCII(sipRes, strlen(sipRes), SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QStringConverter, sipName_name, doc_QStringConverter_name);

    return SIP_NULLPTR;
}


/* Cast a pointer to a type somewhere in its inheritance hierarchy. */
extern "C" {static void *cast_QStringConverter(void *, const sipTypeDef *);}
static void *cast_QStringConverter(void *sipCppV, const sipTypeDef *targetType)
{
     ::QStringConverter *sipCpp = reinterpret_cast< ::QStringConverter *>(sipCppV);

    if (targetType == sipType_QStringConverter)
        return sipCppV;

    if (targetType == sipType_QStringConverterBase)
        return static_cast< ::QStringConverterBase *>(sipCpp);

    return SIP_NULLPTR;
}


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


extern "C" {static void *array_QStringConverter(Py_ssize_t);}
static void *array_QStringConverter(Py_ssize_t sipNrElem)
{
    return new  ::QStringConverter[sipNrElem];
}


extern "C" {static void array_delete_QStringConverter(void *);}
static void array_delete_QStringConverter(void *sipCpp)
{
    delete[] reinterpret_cast< ::QStringConverter *>(sipCpp);
}


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


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

    {
        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
        {
            sipCpp = new  ::QStringConverter();

            return sipCpp;
        }
    }

    {
         ::QStringConverter::Encoding a0;
         ::QStringConverterBase::Flags* a1;
        int a1State = 0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "EJ1", sipType_QStringConverter_Encoding, &a0, sipType_QFlags_0100QStringConverterBase_Flag, &a1, &a1State))
        {
            sipCpp = new  ::QStringConverter(a0,*a1);
            sipReleaseType(a1, sipType_QFlags_0100QStringConverterBase_Flag, a1State);

            return sipCpp;
        }
    }

    {
        const char* a0;
        PyObject *a0Keep;
         ::QStringConverterBase::Flags* a1;
        int a1State = 0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "AAJ1", &a0Keep, &a0, sipType_QFlags_0100QStringConverterBase_Flag, &a1, &a1State))
        {
            sipCpp = new  ::QStringConverter(a0,*a1);
            Py_DECREF(a0Keep);
            sipReleaseType(a1, sipType_QFlags_0100QStringConverterBase_Flag, a1State);

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


/* Define this type's super-types. */
static sipEncodedTypeDef supers_QStringConverter[] = {{293, 255, 1}};


static PyMethodDef methods_QStringConverter[] = {
    {sipName_hasError, meth_QStringConverter_hasError, METH_VARARGS, doc_QStringConverter_hasError},
    {sipName_isValid, meth_QStringConverter_isValid, METH_VARARGS, doc_QStringConverter_isValid},
    {sipName_name, meth_QStringConverter_name, METH_VARARGS, doc_QStringConverter_name},
    {sipName_resetState, meth_QStringConverter_resetState, METH_VARARGS, doc_QStringConverter_resetState}
};


/* Define the enum members and ints to be added to this type. */
static sipIntInstanceDef intInstances_QStringConverter[] = {
    {sipName_Utf8, static_cast<int>( ::QStringConverter::Utf8)},
    {sipName_Utf16, static_cast<int>( ::QStringConverter::Utf16)},
    {sipName_Utf16LE, static_cast<int>( ::QStringConverter::Utf16LE)},
    {sipName_Utf16BE, static_cast<int>( ::QStringConverter::Utf16BE)},
    {sipName_Utf32, static_cast<int>( ::QStringConverter::Utf32)},
    {sipName_Utf32LE, static_cast<int>( ::QStringConverter::Utf32LE)},
    {sipName_Utf32BE, static_cast<int>( ::QStringConverter::Utf32BE)},
    {sipName_Latin1, static_cast<int>( ::QStringConverter::Latin1)},
    {sipName_System, static_cast<int>( ::QStringConverter::System)},
    {0, 0}
};

PyDoc_STRVAR(doc_QStringConverter, "\1QStringConverter()\n"
"QStringConverter(QStringConverter.Encoding, QStringConverterBase.Flag)\n"
"QStringConverter(str, QStringConverterBase.Flag)");


sipClassTypeDef sipTypeDef_QtCore_QStringConverter = {
    {
        SIP_NULLPTR,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QStringConverter,
        SIP_NULLPTR,
        SIP_NULLPTR
    },
    {
        sipNameNr_QStringConverter,
        {0, 0, 1},
        4, methods_QStringConverter,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, intInstances_QStringConverter, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QStringConverter,
    -1,
    -1,
    supers_QStringConverter,
    SIP_NULLPTR,
    init_type_QStringConverter,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QStringConverter,
    SIP_NULLPTR,
    array_QStringConverter,
    SIP_NULLPTR,
    release_QStringConverter,
    cast_QStringConverter,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_QStringConverter,
    sizeof ( ::QStringConverter),
};
