/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.7.0
 *
 * 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 24 "/build/pyqt6/src/PyQt6-6.4.0/sip/QtCore/qstringview.sip"
#include <qstringview.h>
#line 29 "/build/pyqt6/src/PyQt6-6.4.0/build/QtCore/sipQtCoreQStringView.cpp"



extern "C" {static void assign_QStringView(void *, Py_ssize_t, void *);}
static void assign_QStringView(void *sipDst, Py_ssize_t sipDstIdx, void *sipSrc)
{
    reinterpret_cast< ::QStringView *>(sipDst)[sipDstIdx] = *reinterpret_cast< ::QStringView *>(sipSrc);
}


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


extern "C" {static void *copy_QStringView(const void *, Py_ssize_t);}
static void *copy_QStringView(const void *sipSrc, Py_ssize_t sipSrcIdx)
{
    return new  ::QStringView(reinterpret_cast<const  ::QStringView *>(sipSrc)[sipSrcIdx]);
}


/* Call the mapped type's destructor. */
extern "C" {static void release_QStringView(void *, int, void *);}
static void release_QStringView(void *sipCppV, int, void *sipUserState)
{
     ::QStringView *sipCpp = reinterpret_cast< ::QStringView *>(sipCppV);
#line 45 "/build/pyqt6/src/PyQt6-6.4.0/sip/QtCore/qstringview.sip"
delete sipCpp;
delete reinterpret_cast<QString *>(sipUserState);
#line 62 "/build/pyqt6/src/PyQt6-6.4.0/build/QtCore/sipQtCoreQStringView.cpp"
}



extern "C" {static int convertTo_QStringView(PyObject *, void **, int *, PyObject *, void **);}
static int convertTo_QStringView(PyObject *sipPy, void **sipCppPtrV, int *sipIsErr, PyObject *sipTransferObj, void **sipUserStatePtr)
{
     ::QStringView **sipCppPtr = reinterpret_cast< ::QStringView **>(sipCppPtrV);

#line 28 "/build/pyqt6/src/PyQt6-6.4.0/sip/QtCore/qstringview.sip"
if (sipIsErr == NULL)
    return PyUnicode_Check(sipPy);

// TODO: consider creating the view directly from the Python object if it is
// using UTF-16.
QString *qs = new QString(qpycore_PyObject_AsQString(sipPy));
*sipCppPtr = new QStringView(*qs);
*sipUserStatePtr = qs;

return sipGetState(sipTransferObj);
#line 83 "/build/pyqt6/src/PyQt6-6.4.0/build/QtCore/sipQtCoreQStringView.cpp"
}


extern "C" {static PyObject *convertFrom_QStringView(void *, PyObject *);}
static PyObject *convertFrom_QStringView(void *sipCppV, PyObject *)
{
    ::QStringView *sipCpp = reinterpret_cast< ::QStringView *>(sipCppV);

#line 41 "/build/pyqt6/src/PyQt6-6.4.0/sip/QtCore/qstringview.sip"
    return qpycore_PyObject_FromQString(sipCpp->toString());
#line 94 "/build/pyqt6/src/PyQt6-6.4.0/build/QtCore/sipQtCoreQStringView.cpp"
}


sipMappedTypeDef sipTypeDef_QtCore_QStringView = {
    {
        SIP_NULLPTR,
        SIP_TYPE_USER_STATE|SIP_TYPE_MAPPED,
        sipNameNr_QStringView,
        SIP_NULLPTR,
        SIP_NULLPTR
    },
    {
        -1,
        {0, 0, 1},
        0, 0,
        0, 0,
        {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
    },
    assign_QStringView,
    array_QStringView,
    copy_QStringView,
    release_QStringView,
    convertTo_QStringView,
    convertFrom_QStringView
};
