/*
 * Interface wrapper code.
 *
 * Generated by SIP 4.19.6
 */

#include "sipAPIKCodecs.h"

#include <kcodecs.h>

#include <qbytearray.h>
#include <qstring.h>


extern "C" {static PyObject *meth_KCodecs_encodeRFC2047String(PyObject *, PyObject *);}
static PyObject *meth_KCodecs_encodeRFC2047String(PyObject *, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        const  ::QString* a0;
        int a0State = 0;
        const  ::QByteArray* a1;
        int a1State = 0;

        if (sipParseArgs(&sipParseErr, sipArgs, "J1J1", sipType_QString,&a0, &a0State, sipType_QByteArray, &a1, &a1State))
        {
             ::QByteArray*sipRes;

            sipRes = new  ::QByteArray( ::KCodecs::encodeRFC2047String(*a0,*a1));
            sipReleaseType(const_cast< ::QString *>(a0),sipType_QString,a0State);
            sipReleaseType(const_cast< ::QByteArray *>(a1),sipType_QByteArray,a1State);

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

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

    return NULL;
}


extern "C" {static PyObject *meth_KCodecs_decodeRFC2047String(PyObject *, PyObject *);}
static PyObject *meth_KCodecs_decodeRFC2047String(PyObject *, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        const  ::QString* a0;
        int a0State = 0;

        if (sipParseArgs(&sipParseErr, sipArgs, "J1", sipType_QString,&a0, &a0State))
        {
             ::QString*sipRes;

            sipRes = new  ::QString( ::KCodecs::decodeRFC2047String(*a0));
            sipReleaseType(const_cast< ::QString *>(a0),sipType_QString,a0State);

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

    {
        const  ::QByteArray* a0;
        int a0State = 0;
         ::QByteArray* a1;
        int a1State = 0;
        const  ::QByteArray& a2def = QByteArray();
        const  ::QByteArray* a2 = &a2def;
        int a2State = 0;
         ::KCodecs::CharsetOption a3 = KCodecs::NoOption;

        if (sipParseArgs(&sipParseErr, sipArgs, "J1J0|J1E", sipType_QByteArray, &a0, &a0State, sipType_QByteArray, &a1, &a1State, sipType_QByteArray, &a2, &a2State, sipType_KCodecs_CharsetOption, &a3))
        {
             ::QString*sipRes;

            sipRes = new  ::QString( ::KCodecs::decodeRFC2047String(*a0,a1,*a2,a3));
            sipReleaseType(const_cast< ::QByteArray *>(a0),sipType_QByteArray,a0State);
            sipReleaseType(a1,sipType_QByteArray,a1State);
            sipReleaseType(const_cast< ::QByteArray *>(a2),sipType_QByteArray,a2State);

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

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

    return NULL;
}


extern "C" {static PyObject *meth_KCodecs_base64Decode(PyObject *, PyObject *);}
static PyObject *meth_KCodecs_base64Decode(PyObject *, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

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

        if (sipParseArgs(&sipParseErr, sipArgs, "J1", sipType_QByteArray, &a0, &a0State))
        {
             ::QByteArray*sipRes;

            sipRes = new  ::QByteArray( ::KCodecs::base64Decode(*a0));
            sipReleaseType(const_cast< ::QByteArray *>(a0),sipType_QByteArray,a0State);

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

    {
        const  ::QByteArray* a0;
        int a0State = 0;
         ::QByteArray* a1;
        int a1State = 0;

        if (sipParseArgs(&sipParseErr, sipArgs, "J1J1", sipType_QByteArray, &a0, &a0State, sipType_QByteArray, &a1, &a1State))
        {
             ::KCodecs::base64Decode(*a0,*a1);
            sipReleaseType(const_cast< ::QByteArray *>(a0),sipType_QByteArray,a0State);
            sipReleaseType(a1,sipType_QByteArray,a1State);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

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

    return NULL;
}


extern "C" {static PyObject *meth_KCodecs_base64Encode(PyObject *, PyObject *);}
static PyObject *meth_KCodecs_base64Encode(PyObject *, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

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

        if (sipParseArgs(&sipParseErr, sipArgs, "J1", sipType_QByteArray, &a0, &a0State))
        {
             ::QByteArray*sipRes;

            sipRes = new  ::QByteArray( ::KCodecs::base64Encode(*a0));
            sipReleaseType(const_cast< ::QByteArray *>(a0),sipType_QByteArray,a0State);

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

    {
        const  ::QByteArray* a0;
        int a0State = 0;
        bool a1;

        if (sipParseArgs(&sipParseErr, sipArgs, "J1b", sipType_QByteArray, &a0, &a0State, &a1))
        {
             ::QByteArray*sipRes;

            sipRes = new  ::QByteArray( ::KCodecs::base64Encode(*a0,a1));
            sipReleaseType(const_cast< ::QByteArray *>(a0),sipType_QByteArray,a0State);

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

    {
        const  ::QByteArray* a0;
        int a0State = 0;
         ::QByteArray* a1;
        int a1State = 0;
        bool a2 = 0;

        if (sipParseArgs(&sipParseErr, sipArgs, "J1J1|b", sipType_QByteArray, &a0, &a0State, sipType_QByteArray, &a1, &a1State, &a2))
        {
             ::KCodecs::base64Encode(*a0,*a1,a2);
            sipReleaseType(const_cast< ::QByteArray *>(a0),sipType_QByteArray,a0State);
            sipReleaseType(a1,sipType_QByteArray,a1State);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

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

    return NULL;
}


extern "C" {static PyObject *meth_KCodecs_uudecode(PyObject *, PyObject *);}
static PyObject *meth_KCodecs_uudecode(PyObject *, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

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

        if (sipParseArgs(&sipParseErr, sipArgs, "J1", sipType_QByteArray, &a0, &a0State))
        {
             ::QByteArray*sipRes;

            sipRes = new  ::QByteArray( ::KCodecs::uudecode(*a0));
            sipReleaseType(const_cast< ::QByteArray *>(a0),sipType_QByteArray,a0State);

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

    {
        const  ::QByteArray* a0;
        int a0State = 0;
         ::QByteArray* a1;
        int a1State = 0;

        if (sipParseArgs(&sipParseErr, sipArgs, "J1J1", sipType_QByteArray, &a0, &a0State, sipType_QByteArray, &a1, &a1State))
        {
             ::KCodecs::uudecode(*a0,*a1);
            sipReleaseType(const_cast< ::QByteArray *>(a0),sipType_QByteArray,a0State);
            sipReleaseType(a1,sipType_QByteArray,a1State);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

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

    return NULL;
}


extern "C" {static PyObject *meth_KCodecs_uuencode(PyObject *, PyObject *);}
static PyObject *meth_KCodecs_uuencode(PyObject *, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

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

        if (sipParseArgs(&sipParseErr, sipArgs, "J1", sipType_QByteArray, &a0, &a0State))
        {
             ::QByteArray*sipRes;

            sipRes = new  ::QByteArray( ::KCodecs::uuencode(*a0));
            sipReleaseType(const_cast< ::QByteArray *>(a0),sipType_QByteArray,a0State);

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

    {
        const  ::QByteArray* a0;
        int a0State = 0;
         ::QByteArray* a1;
        int a1State = 0;

        if (sipParseArgs(&sipParseErr, sipArgs, "J1J1", sipType_QByteArray, &a0, &a0State, sipType_QByteArray, &a1, &a1State))
        {
             ::KCodecs::uuencode(*a0,*a1);
            sipReleaseType(const_cast< ::QByteArray *>(a0),sipType_QByteArray,a0State);
            sipReleaseType(a1,sipType_QByteArray,a1State);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

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

    return NULL;
}


extern "C" {static PyObject *meth_KCodecs_quotedPrintableDecode(PyObject *, PyObject *);}
static PyObject *meth_KCodecs_quotedPrintableDecode(PyObject *, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

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

        if (sipParseArgs(&sipParseErr, sipArgs, "J1", sipType_QByteArray, &a0, &a0State))
        {
             ::QByteArray*sipRes;

            sipRes = new  ::QByteArray( ::KCodecs::quotedPrintableDecode(*a0));
            sipReleaseType(const_cast< ::QByteArray *>(a0),sipType_QByteArray,a0State);

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

    {
        const  ::QByteArray* a0;
        int a0State = 0;
         ::QByteArray* a1;
        int a1State = 0;

        if (sipParseArgs(&sipParseErr, sipArgs, "J1J1", sipType_QByteArray, &a0, &a0State, sipType_QByteArray, &a1, &a1State))
        {
             ::KCodecs::quotedPrintableDecode(*a0,*a1);
            sipReleaseType(const_cast< ::QByteArray *>(a0),sipType_QByteArray,a0State);
            sipReleaseType(a1,sipType_QByteArray,a1State);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

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

    return NULL;
}


extern "C" {static PyObject *meth_KCodecs_quotedPrintableEncode(PyObject *, PyObject *);}
static PyObject *meth_KCodecs_quotedPrintableEncode(PyObject *, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        const  ::QByteArray* a0;
        int a0State = 0;
        bool a1 = 1;

        if (sipParseArgs(&sipParseErr, sipArgs, "J1|b", sipType_QByteArray, &a0, &a0State, &a1))
        {
             ::QByteArray*sipRes;

            sipRes = new  ::QByteArray( ::KCodecs::quotedPrintableEncode(*a0,a1));
            sipReleaseType(const_cast< ::QByteArray *>(a0),sipType_QByteArray,a0State);

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

    {
        const  ::QByteArray* a0;
        int a0State = 0;
         ::QByteArray* a1;
        int a1State = 0;
        bool a2;

        if (sipParseArgs(&sipParseErr, sipArgs, "J1J1b", sipType_QByteArray, &a0, &a0State, sipType_QByteArray, &a1, &a1State, &a2))
        {
             ::KCodecs::quotedPrintableEncode(*a0,*a1,a2);
            sipReleaseType(const_cast< ::QByteArray *>(a0),sipType_QByteArray,a0State);
            sipReleaseType(a1,sipType_QByteArray,a1State);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

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

    return NULL;
}


static PyMethodDef methods_KCodecs[] = {
    {SIP_MLNAME_CAST(sipName_base64Decode), meth_KCodecs_base64Decode, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_base64Encode), meth_KCodecs_base64Encode, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_decodeRFC2047String), meth_KCodecs_decodeRFC2047String, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_encodeRFC2047String), meth_KCodecs_encodeRFC2047String, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_quotedPrintableDecode), meth_KCodecs_quotedPrintableDecode, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_quotedPrintableEncode), meth_KCodecs_quotedPrintableEncode, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_uudecode), meth_KCodecs_uudecode, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_uuencode), meth_KCodecs_uuencode, METH_VARARGS, NULL}
};

static sipEnumMemberDef enummembers_KCodecs[] = {
    {sipName_ForceDefaultCharset, static_cast<int>( ::KCodecs::ForceDefaultCharset), 2},
    {sipName_NoOption, static_cast<int>( ::KCodecs::NoOption), 2},
};


static pyqt5ClassPluginDef plugin_KCodecs = {
    0,
    0,
    0,
    0
};


sipClassTypeDef sipTypeDef_KCodecs_KCodecs = {
    {
        -1,
        0,
        0,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_NAMESPACE,
        sipNameNr_KCodecs,
        {0},
        &plugin_KCodecs
    },
    {
        sipNameNr_KCodecs,
        {0, 0, 1},
        8, methods_KCodecs,
        2, enummembers_KCodecs,
        0, 0,
        {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    },
    0,
    -1,
    -1,
    0,
    0,
    0,
    0,
    0,
#if PY_MAJOR_VERSION >= 3
    0,
    0,
#else
    0,
    0,
    0,
    0,
#endif
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0
};
