
// Workaround to access protected functions
#ifndef protected
#  define protected public
#endif

// default includes
#include <shiboken.h>
#include <sbkpep.h>
#include <sbkpepbuffer.h>

#define PYSIDE6_COMOPT_COMPRESS 1

#ifndef QT_NO_VERSION_TAGGING
#  define QT_NO_VERSION_TAGGING
#endif
#include <QtCore/QDebug>
#include <pysideqenum.h>
#include <pysideutils.h>
#include <feature_select.h>
QT_WARNING_DISABLE_DEPRECATED


// module include
#include "kcoreaddons_python.h"

// main header
#include "kcharmacroexpander_wrapper.h"

// Wrappers providing overrides
#include "kmacroexpanderbase_wrapper.h"

// Argument includes
#include <QString>
#include <QStringList>
#include <qchar.h>

#include <cctype>
#include <cstring>
#include <iterator>
#include <type_traits>
#include <typeinfo>

extern "C" {
static PyTypeObject *Sbk_KCharMacroExpander_TypeF(void)
{
    return SbkKCoreAddonsTypeStructs[SBK_KCharMacroExpander_IDX].type;
}
} // extern "C"

// Native ---------------------------------------------------------

void KCharMacroExpanderWrapper::resetPyMethodCache()
{
    std::fill(m_PyMethodCache.begin(), m_PyMethodCache.end(), nullptr);
}

KCharMacroExpanderWrapper::KCharMacroExpanderWrapper(::QChar c) : KCharMacroExpander(c)
{
}

int KCharMacroExpanderWrapper::expandEscapedMacro(const ::QString & str, int pos, ::QStringList & ret)
{
    static const char *funcName = "expandEscapedMacro";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_KCharMacroExpander_TypeF(), gil, funcName, m_PyMethodCache[0], nameCache));
    if (pyOverride.isNull()) {
        return this->::KCharMacroExpander::expandEscapedMacro(str, pos, ret);
    }
    return KMacroExpanderBaseWrapper::sbk_o_expandEscapedMacro("KCharMacroExpander", funcName, gil, pyOverride, str, pos, ret);
}

bool KCharMacroExpanderWrapper::expandMacro(::QChar chr, ::QStringList & ret)
{
    static const char *funcName = "expandMacro";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_KCharMacroExpander_TypeF(), gil, funcName, m_PyMethodCache[1], nameCache));
    if (pyOverride.isNull()) {
        gil.acquire();
        Shiboken::Errors::setPureVirtualMethodError("KCharMacroExpander.expandMacro");
        return false;
    }
    return sbk_o_expandMacro("KCharMacroExpander", funcName, gil, pyOverride, chr, ret);
}

bool KCharMacroExpanderWrapper::sbk_o_expandMacro([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] ::QChar chr, [[maybe_unused]] ::QStringList & ret)
{
#if !defined(PYPY_VERSION) && (!defined(Py_LIMITED_API) || Py_LIMITED_API >= 0x030C0000)
    PyObject *pyArgArray[2] = {
        Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypeConverters[SBK_QChar_IDX], &chr),
        Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypeConverters[SBK_QStringList_IDX], &ret)
    };
#else
    Shiboken::AutoDecRef pyArgs(Py_BuildValue("(NN)",
        Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypeConverters[SBK_QChar_IDX], &chr),
        Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypeConverters[SBK_QStringList_IDX], &ret)
    ));
#endif

#if !defined(PYPY_VERSION) && (!defined(Py_LIMITED_API) || Py_LIMITED_API >= 0x030C0000)
    Shiboken::AutoDecRef pyResult(PyObject_Vectorcall(pyOverride, pyArgArray, 2, nullptr));
    Py_DECREF(pyArgArray[0]);
    Py_DECREF(pyArgArray[1]);
#else
    Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr));
#endif
    if (pyResult.isNull()) {
        // An error happened in python code!
        Shiboken::Errors::storePythonOverrideErrorOrPrint(ownerClassName, funcName);
        return false;
    }
    // Check return type
    Shiboken::Conversions::PythonToCppConversion pythonToCpp =
        Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), pyResult);
    if (!pythonToCpp) {
        Shiboken::Warnings::warnInvalidReturnValue(ownerClassName, funcName, "bool", Py_TYPE(pyResult)->tp_name);
        return false;
    }
    bool cppResult;
    pythonToCpp(pyResult, &cppResult);
    return cppResult;
}

int KCharMacroExpanderWrapper::expandPlainMacro(const ::QString & str, int pos, ::QStringList & ret)
{
    static const char *funcName = "expandPlainMacro";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_KCharMacroExpander_TypeF(), gil, funcName, m_PyMethodCache[2], nameCache));
    if (pyOverride.isNull()) {
        return this->::KCharMacroExpander::expandPlainMacro(str, pos, ret);
    }
    return KMacroExpanderBaseWrapper::sbk_o_expandEscapedMacro("KCharMacroExpander", funcName, gil, pyOverride, str, pos, ret);
}

KCharMacroExpanderWrapper::~KCharMacroExpanderWrapper()
{
    auto *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this, Sbk_KCharMacroExpander_TypeF());
    Shiboken::Object::destroy(wrapper, this);
}

// Target ---------------------------------------------------------

extern "C" {
static int
Sbk_KCharMacroExpander_Init(PyObject *self, [[maybe_unused]] PyObject *args, [[maybe_unused]] PyObject *kwds)
{
    auto *sbkSelf = reinterpret_cast<SbkObject *>(self);
    PyTypeObject *type = self->ob_type;
    PyTypeObject *myType = Shiboken::Module::get(SbkKCoreAddonsTypeStructs[SBK_KCharMacroExpander_IDX]);
    if (type == myType) {
        Shiboken::Errors::setInstantiateAbstractClass("KCharMacroExpander");
        return -1;
    }

    PySide::Feature::Select(self);
    if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType< ::KCharMacroExpander >()))
        return -1;

    KCharMacroExpanderWrapper *cptr{};
    Shiboken::AutoDecRef errInfo{};
    Shiboken::PythonContextMarker pcm;
    int overloadId = -1;
    [[maybe_unused]] Shiboken::Conversions::PythonToCppConversion pythonToCpp[1];
    const Py_ssize_t numArgs = PyTuple_Size(args);
    SBK_UNUSED(numArgs)
    PyObject *pyArgs[] = {nullptr};

    // invalid argument lengths
    errInfo.reset(Shiboken::checkInvalidArgumentCount(numArgs, 0, 1));
    if (!errInfo.isNull())
        return Shiboken::returnWrongArguments_MinusOne(args, "__init__", errInfo, SbkKCoreAddonsTypeStructs[SBK_KCharMacroExpander_IDX]);

    if (PyArg_ParseTuple(args, "|O:KCharMacroExpander", &(pyArgs[0])) == 0)
        return -1;


    // Overloaded function decisor
    // 0: KCharMacroExpander::KCharMacroExpander(QChar=)
    if (numArgs == 0) {
        overloadId = 0; // KCharMacroExpander(QChar)
    } else if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtCoreTypeConverters[SBK_QChar_IDX], (pyArgs[0])))) {
        overloadId = 0; // KCharMacroExpander::KCharMacroExpander(QChar=)
    }

    // Function signature not found.
    if (overloadId == -1)
        return Shiboken::returnWrongArguments_MinusOne(args, "__init__", SbkKCoreAddonsTypeStructs[SBK_KCharMacroExpander_IDX]);

    // Resolve keyword arguments
    {
        if (kwds != nullptr && PyDict_Size(kwds) > 0) {
            static const Shiboken::ArgumentNameIndexMapping mapping[1] = {{"c", 0}};
            if (!Shiboken::parseKeywordArguments(kwds, mapping, 1, errInfo, pyArgs)
                || (pyArgs[0] != nullptr && !((pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtCoreTypeConverters[SBK_QChar_IDX], (pyArgs[0])))))) {
                Py_XINCREF(errInfo.object());
                return Shiboken::returnWrongArguments_MinusOne(args, "__init__", errInfo, SbkKCoreAddonsTypeStructs[SBK_KCharMacroExpander_IDX]);
            }
        }
    }

    // PyMI support
    Shiboken::callInheritedInit(self, args, errInfo.isNull() ? kwds : errInfo.object(), SbkKCoreAddonsTypeStructs[SBK_KCharMacroExpander_IDX]);
    if (Shiboken::Errors::occurred() != nullptr)
        return -1;

    // Call function/method
    {
        ::QChar cppArg0 = QLatin1Char('%');
        if (pythonToCpp[0])
            pythonToCpp[0](pyArgs[0], &cppArg0);

        if (Shiboken::Errors::occurred() == nullptr) {
            // KCharMacroExpander::KCharMacroExpander(QChar=)
            cptr = new KCharMacroExpanderWrapper(cppArg0);
        }
    }

    if (Shiboken::Errors::occurred() != nullptr || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< KCharMacroExpander >(), cptr)) {
        delete cptr;
        return -1;
    }
    if (cptr == nullptr)
        return Shiboken::returnWrongArguments_MinusOne(args, "__init__", SbkKCoreAddonsTypeStructs[SBK_KCharMacroExpander_IDX]);

    Shiboken::Object::setValidCpp(sbkSelf, true);
    Shiboken::Object::setHasCppWrapper(sbkSelf, true);
    Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr);


    return 1;
}

static PyObject *Sbk_KCharMacroExpanderFunc_expandEscapedMacro(PyObject *self, PyObject *args)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::KCharMacroExpander *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkKCoreAddonsTypeStructs[SBK_KCharMacroExpander_IDX]), reinterpret_cast<SbkObject *>(self)));
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    Shiboken::PythonContextMarker pcm;
    int overloadId = -1;
    [[maybe_unused]] Shiboken::Conversions::PythonToCppConversion pythonToCpp[3];
    const Py_ssize_t numArgs = PyTuple_Size(args);
    SBK_UNUSED(numArgs)
    PyObject *pyArgs[] = {nullptr, nullptr, nullptr};

    // invalid argument lengths

    if (PyArg_UnpackTuple(args, "expandEscapedMacro", 3, 3, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2])) == 0)
        return {};


    // Overloaded function decisor
    // 0: KMacroExpanderBase::expandEscapedMacro(const QString&,int,QStringList&)->int
    if (numArgs == 3
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtCoreTypeConverters[SBK_QString_IDX], (pyArgs[0])))
        && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[1])))
        && (pythonToCpp[2] = Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtCoreTypeConverters[SBK_QStringList_IDX], (pyArgs[2])))) {
        overloadId = 0; // KMacroExpanderBase::expandEscapedMacro(const QString&,int,QStringList&)->int
    }

    // Function signature not found.
    if (overloadId == -1)
        return Shiboken::returnWrongArguments(args, "expandEscapedMacro", SbkKCoreAddonsTypeStructs[SBK_KCharMacroExpander_IDX]);

    // Call function/method
    {
        ::QString cppArg0;
        pythonToCpp[0](pyArgs[0], &cppArg0);
        int cppArg1;
        pythonToCpp[1](pyArgs[1], &cppArg1);
        ::QStringList cppArg2;
        pythonToCpp[2](pyArgs[2], &cppArg2);

        if (Shiboken::Errors::occurred() == nullptr) {
            // KMacroExpanderBase::expandEscapedMacro(const QString&,int,QStringList&)->int
            int cppResult = Shiboken::Object::hasCppWrapper(reinterpret_cast<SbkObject *>(self))
                ? cppSelf->::KCharMacroExpander::expandEscapedMacro(cppArg0, cppArg1, cppArg2)
                : cppSelf->expandEscapedMacro(cppArg0, cppArg1, cppArg2);
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<int>(), &cppResult);
        }
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

static PyObject *Sbk_KCharMacroExpanderFunc_expandMacro(PyObject *self, PyObject *args)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::KCharMacroExpander *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkKCoreAddonsTypeStructs[SBK_KCharMacroExpander_IDX]), reinterpret_cast<SbkObject *>(self)));
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    Shiboken::PythonContextMarker pcm;
    int overloadId = -1;
    [[maybe_unused]] Shiboken::Conversions::PythonToCppConversion pythonToCpp[2];
    const Py_ssize_t numArgs = PyTuple_Size(args);
    SBK_UNUSED(numArgs)
    PyObject *pyArgs[] = {nullptr, nullptr};

    // invalid argument lengths

    if (PyArg_UnpackTuple(args, "expandMacro", 2, 2, &(pyArgs[0]), &(pyArgs[1])) == 0)
        return {};


    // Overloaded function decisor
    // 0: KCharMacroExpander::expandMacro(QChar,QStringList&)->bool
    if (numArgs == 2
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtCoreTypeConverters[SBK_QChar_IDX], (pyArgs[0])))
        && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtCoreTypeConverters[SBK_QStringList_IDX], (pyArgs[1])))) {
        overloadId = 0; // KCharMacroExpander::expandMacro(QChar,QStringList&)->bool
    }

    // Function signature not found.
    if (overloadId == -1)
        return Shiboken::returnWrongArguments(args, "expandMacro", SbkKCoreAddonsTypeStructs[SBK_KCharMacroExpander_IDX]);

    // Call function/method
    {
        ::QChar cppArg0;
        pythonToCpp[0](pyArgs[0], &cppArg0);
        ::QStringList cppArg1;
        pythonToCpp[1](pyArgs[1], &cppArg1);

        if (Shiboken::Errors::occurred() == nullptr) {
            // KCharMacroExpander::expandMacro(QChar,QStringList&)->bool
            if (Shiboken::Object::hasCppWrapper(reinterpret_cast<SbkObject *>(self))) {
                Shiboken::Errors::setPureVirtualMethodError("KCharMacroExpander.expandMacro");
                return {};
            }
            bool cppResult = cppSelf->expandMacro(cppArg0, cppArg1);
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
        }
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

static PyObject *Sbk_KCharMacroExpanderFunc_expandPlainMacro(PyObject *self, PyObject *args)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::KCharMacroExpander *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkKCoreAddonsTypeStructs[SBK_KCharMacroExpander_IDX]), reinterpret_cast<SbkObject *>(self)));
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    Shiboken::PythonContextMarker pcm;
    int overloadId = -1;
    [[maybe_unused]] Shiboken::Conversions::PythonToCppConversion pythonToCpp[3];
    const Py_ssize_t numArgs = PyTuple_Size(args);
    SBK_UNUSED(numArgs)
    PyObject *pyArgs[] = {nullptr, nullptr, nullptr};

    // invalid argument lengths

    if (PyArg_UnpackTuple(args, "expandPlainMacro", 3, 3, &(pyArgs[0]), &(pyArgs[1]), &(pyArgs[2])) == 0)
        return {};


    // Overloaded function decisor
    // 0: KMacroExpanderBase::expandPlainMacro(const QString&,int,QStringList&)->int
    if (numArgs == 3
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtCoreTypeConverters[SBK_QString_IDX], (pyArgs[0])))
        && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Conversions::PrimitiveTypeConverter<int>(), (pyArgs[1])))
        && (pythonToCpp[2] = Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtCoreTypeConverters[SBK_QStringList_IDX], (pyArgs[2])))) {
        overloadId = 0; // KMacroExpanderBase::expandPlainMacro(const QString&,int,QStringList&)->int
    }

    // Function signature not found.
    if (overloadId == -1)
        return Shiboken::returnWrongArguments(args, "expandPlainMacro", SbkKCoreAddonsTypeStructs[SBK_KCharMacroExpander_IDX]);

    // Call function/method
    {
        ::QString cppArg0;
        pythonToCpp[0](pyArgs[0], &cppArg0);
        int cppArg1;
        pythonToCpp[1](pyArgs[1], &cppArg1);
        ::QStringList cppArg2;
        pythonToCpp[2](pyArgs[2], &cppArg2);

        if (Shiboken::Errors::occurred() == nullptr) {
            // KMacroExpanderBase::expandPlainMacro(const QString&,int,QStringList&)->int
            int cppResult = Shiboken::Object::hasCppWrapper(reinterpret_cast<SbkObject *>(self))
                ? cppSelf->::KCharMacroExpander::expandPlainMacro(cppArg0, cppArg1, cppArg2)
                : cppSelf->expandPlainMacro(cppArg0, cppArg1, cppArg2);
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<int>(), &cppResult);
        }
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}


static const char *Sbk_KCharMacroExpander_PropertyStrings[] = {
    nullptr // Sentinel
};

static PyMethodDef Sbk_KCharMacroExpander_methods[] = {
    {"expandEscapedMacro", reinterpret_cast<PyCFunction>(Sbk_KCharMacroExpanderFunc_expandEscapedMacro), METH_VARARGS, nullptr},
    {"expandMacro", reinterpret_cast<PyCFunction>(Sbk_KCharMacroExpanderFunc_expandMacro), METH_VARARGS, nullptr},
    {"expandPlainMacro", reinterpret_cast<PyCFunction>(Sbk_KCharMacroExpanderFunc_expandPlainMacro), METH_VARARGS, nullptr},
    {nullptr, nullptr, 0, nullptr} // Sentinel
};

static int Sbk_KCharMacroExpander_setattro(PyObject *self, PyObject *name, PyObject *value)
{
    PySide::Feature::Select(self);
    if (value != nullptr && PyCallable_Check(value) != 0) {
        auto plain_inst = reinterpret_cast< ::KCharMacroExpander *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkKCoreAddonsTypeStructs[SBK_KCharMacroExpander_IDX]), reinterpret_cast<SbkObject *>(self)));
        auto *inst = dynamic_cast<KCharMacroExpanderWrapper *>(plain_inst);
        if (inst != nullptr)
            inst->resetPyMethodCache();
    }
    return PyObject_GenericSetAttr(self, name, value);
}

} // extern "C"

static int Sbk_KCharMacroExpander_traverse(PyObject *self, visitproc visit, void *arg)
{
    auto traverseProc = reinterpret_cast<traverseproc>(PyType_GetSlot(SbkObject_TypeF(), Py_tp_traverse));
    ;
    return traverseProc(self, visit, arg);
}
static int Sbk_KCharMacroExpander_clear(PyObject *self)
{
    auto clearProc = reinterpret_cast<inquiry>(PyType_GetSlot(SbkObject_TypeF(), Py_tp_clear));
    ;
    return clearProc(self);
}

// Class Definition -----------------------------------------------
extern "C" {

static PyType_Slot Sbk_KCharMacroExpander_slots[] = {
    {Py_tp_base,        nullptr}, // inserted by introduceWrapperType
    {Py_tp_dealloc,     reinterpret_cast<void *>(&SbkDeallocWrapper)},
    {Py_tp_setattro,    reinterpret_cast<void *>(Sbk_KCharMacroExpander_setattro)},
    {Py_tp_traverse,    reinterpret_cast<void *>(Sbk_KCharMacroExpander_traverse)},
    {Py_tp_clear,       reinterpret_cast<void *>(Sbk_KCharMacroExpander_clear)},
    {Py_tp_methods,     reinterpret_cast<void *>(Sbk_KCharMacroExpander_methods)},
    {Py_tp_init,        reinterpret_cast<void *>(Sbk_KCharMacroExpander_Init)},
    {Py_tp_new,         reinterpret_cast<void *>(SbkObject_tp_new)},
    {0, nullptr}
};
static PyType_Spec Sbk_KCharMacroExpander_spec = {
    "1:KCoreAddons.KCharMacroExpander",
    sizeof(SbkObject),
    0,
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
    Sbk_KCharMacroExpander_slots
};

} //extern "C"

static void *Sbk_KCharMacroExpander_typeDiscovery([[maybe_unused]] void *cptr, [[maybe_unused]] PyTypeObject *instanceType)
{
    if (instanceType == Shiboken::SbkType< ::KMacroExpanderBase >())
        return dynamic_cast< ::KCharMacroExpander *>(reinterpret_cast< ::KMacroExpanderBase *>(cptr));
    return {};
}


// Type conversion functions.

// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity).
static void KCharMacroExpander_PythonToCpp_KCharMacroExpander_PTR(PyObject *pyIn, void *cppOut)
{
    Shiboken::Conversions::pythonToCppPointer(Sbk_KCharMacroExpander_TypeF(), pyIn, cppOut);
}
static PythonToCppFunc is_KCharMacroExpander_PythonToCpp_KCharMacroExpander_PTR_Convertible(PyObject *pyIn)
{
    if (pyIn == Py_None)
        return Shiboken::Conversions::nonePythonToCppNullPtr;
    if (PyObject_TypeCheck(pyIn, Sbk_KCharMacroExpander_TypeF()))
        return KCharMacroExpander_PythonToCpp_KCharMacroExpander_PTR;
    return {};
}

// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity).
static PyObject *KCharMacroExpander_PTR_CppToPython_KCharMacroExpander(const void *cppIn)
{
    auto *pyOut = reinterpret_cast<PyObject *>(Shiboken::BindingManager::instance().retrieveWrapper(cppIn, Sbk_KCharMacroExpander_TypeF()));
    if (pyOut) {
        Py_INCREF(pyOut);
        return pyOut;
    }
    auto *tCppIn = reinterpret_cast<const ::KCharMacroExpander *>(cppIn);
    const char *typeName = typeid(*tCppIn).name();
    return Shiboken::Object::newObjectForPointer(Sbk_KCharMacroExpander_TypeF(), const_cast<void *>(cppIn), false, typeName);

}

// The signatures string for the functions.
// Multiple signatures have their index "n:" in front.
#if PYSIDE6_COMOPT_COMPRESS == 0
static const char *KCharMacroExpander_SignatureStrings[] = {
    "KCoreAddons.KCharMacroExpander(self,c:QChar=QLatin1Char('%'))",
    "KCoreAddons.KCharMacroExpander.expandEscapedMacro(self,str:QString,pos:int,ret:QStringList)->int",
    "KCoreAddons.KCharMacroExpander.expandMacro(self,chr:QChar,ret:QStringList)->bool",
    "KCoreAddons.KCharMacroExpander.expandPlainMacro(self,str:QString,pos:int,ret:QStringList)->int",
    nullptr}; // Sentinel
#else
static constexpr size_t KCharMacroExpander_SignatureByteSize = 144;
static constexpr uint8_t KCharMacroExpander_SignatureBytes[144] = {
    0x78, 0xda, 0xf3, 0x76, 0xce, 0x2f, 0x4a, 0x75, 0x4c, 0x49, 0xc9, 0xcf, 0x2b, 0xd6, 0xf3, 0x76,
    0xce, 0x48, 0x2c, 0xf2, 0x4d, 0x4c, 0x2e, 0xca, 0x77, 0xad, 0x28, 0x48, 0xcc, 0x4b, 0x49, 0x2d,
    0xd2, 0x28, 0x4e, 0xcd, 0x49, 0xd3, 0x49, 0xb6, 0x0a, 0x04, 0xc9, 0xd8, 0x06, 0xfa, 0x24, 0x96,
    0x64, 0xe6, 0x19, 0x82, 0xd8, 0x1a, 0xea, 0xaa, 0xea, 0x9a, 0x9a, 0x5c, 0xde, 0x78, 0x75, 0xeb,
    0xa5, 0x82, 0x19, 0xae, 0xc5, 0xc9, 0x89, 0x05, 0xa9, 0x29, 0x60, 0x29, 0x88, 0x81, 0xc5, 0x25,
    0x45, 0x56, 0x81, 0xc1, 0x25, 0x45, 0x99, 0x79, 0xe9, 0x3a, 0x05, 0xf9, 0xc5, 0x56, 0x99, 0x79,
    0x25, 0x3a, 0x45, 0xa9, 0x25, 0x30, 0x31, 0x9f, 0xcc, 0xe2, 0x12, 0x4d, 0x5d, 0x3b, 0xa0, 0x28,
    0x71, 0x16, 0x20, 0x99, 0x9c, 0x9c, 0x51, 0x04, 0x71, 0x2c, 0x16, 0xf3, 0x92, 0xf2, 0xf3, 0x73,
    0x88, 0x33, 0x30, 0x20, 0x27, 0x31, 0x33, 0x8f, 0x2c, 0xf7, 0x02, 0x00, 0x37, 0x65, 0x79, 0xab
};
#endif

PyTypeObject *init_KCharMacroExpander(PyObject *module)
{
    auto &typeStruct = SbkKCoreAddonsTypeStructs[SBK_KCharMacroExpander_IDX];
    if (typeStruct.type != nullptr)
        return typeStruct.type;

    auto *base1 = reinterpret_cast<PyObject *>(Shiboken::Module::get(SbkKCoreAddonsTypeStructs[SBK_KMacroExpanderBase_IDX]));
    Shiboken::AutoDecRef Sbk_KCharMacroExpander_Type_bases(PyTuple_Pack(1, base1));

    PyTypeObject *pyType = Shiboken::ObjectType::introduceWrapperType(
        module,
        "KCharMacroExpander",
        "KCharMacroExpander*",
        &Sbk_KCharMacroExpander_spec,
        &Shiboken::callCppDestructor< KCharMacroExpander >,
        Sbk_KCharMacroExpander_Type_bases.object(),
        0);
#if PYSIDE6_COMOPT_COMPRESS == 0
    InitSignatureStrings(pyType, KCharMacroExpander_SignatureStrings);
#else
    InitSignatureBytes(pyType, KCharMacroExpander_SignatureBytes, KCharMacroExpander_SignatureByteSize);
#endif
    SbkObjectType_SetPropertyStrings(pyType, Sbk_KCharMacroExpander_PropertyStrings);
    typeStruct.type = pyType;

    // Register Converter
    SbkConverter *converter = Shiboken::Conversions::createConverter(pyType,
        KCharMacroExpander_PythonToCpp_KCharMacroExpander_PTR,
        is_KCharMacroExpander_PythonToCpp_KCharMacroExpander_PTR_Convertible,
        KCharMacroExpander_PTR_CppToPython_KCharMacroExpander);

    Shiboken::Conversions::registerConverterName(converter, "KCharMacroExpander");
    Shiboken::Conversions::registerConverterName(converter, "KCharMacroExpander*");
    Shiboken::Conversions::registerConverterName(converter, "KCharMacroExpander&");
    Shiboken::Conversions::registerConverterName(converter, typeid(::KCharMacroExpander).name());
    Shiboken::Conversions::registerConverterName(converter, typeid(KCharMacroExpanderWrapper).name());

    Shiboken::ObjectType::setTypeDiscoveryFunctionV2(pyType, &Sbk_KCharMacroExpander_typeDiscovery);

    qRegisterMetaType< ::KCharMacroExpander *>();

    return pyType;
}
