#include #include #include #include #include #include #include #include #include "gen_qbuffer.h" #include "_cgo_export.h" QBuffer* QBuffer_new() { return new QBuffer(); } QBuffer* QBuffer_new2(QObject* parent) { return new QBuffer(parent); } QMetaObject* QBuffer_MetaObject(const QBuffer* self) { return (QMetaObject*) self->metaObject(); } void* QBuffer_Metacast(QBuffer* self, const char* param1) { return self->qt_metacast(param1); } struct miqt_string QBuffer_Tr(const char* s) { QString _ret = QBuffer::tr(s); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); struct miqt_string _ms; _ms.len = _b.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _b.data(), _ms.len); return _ms; } struct miqt_string QBuffer_TrUtf8(const char* s) { QString _ret = QBuffer::trUtf8(s); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); struct miqt_string _ms; _ms.len = _b.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _b.data(), _ms.len); return _ms; } struct miqt_string QBuffer_Buffer(QBuffer* self) { QByteArray _qb = self->buffer(); struct miqt_string _ms; _ms.len = _qb.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _qb.data(), _ms.len); return _ms; } struct miqt_string QBuffer_Buffer2(const QBuffer* self) { const QByteArray _qb = self->buffer(); struct miqt_string _ms; _ms.len = _qb.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _qb.data(), _ms.len); return _ms; } void QBuffer_SetData(QBuffer* self, struct miqt_string data) { QByteArray data_QByteArray(data.data, data.len); self->setData(data_QByteArray); } void QBuffer_SetData2(QBuffer* self, const char* data, int lenVal) { self->setData(data, static_cast(lenVal)); } struct miqt_string QBuffer_Data(const QBuffer* self) { const QByteArray _qb = self->data(); struct miqt_string _ms; _ms.len = _qb.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _qb.data(), _ms.len); return _ms; } bool QBuffer_Open(QBuffer* self, int openMode) { return self->open(static_cast(openMode)); } void QBuffer_Close(QBuffer* self) { self->close(); } long long QBuffer_Size(const QBuffer* self) { qint64 _ret = self->size(); return static_cast(_ret); } long long QBuffer_Pos(const QBuffer* self) { qint64 _ret = self->pos(); return static_cast(_ret); } bool QBuffer_Seek(QBuffer* self, long long off) { return self->seek(static_cast(off)); } bool QBuffer_AtEnd(const QBuffer* self) { return self->atEnd(); } bool QBuffer_CanReadLine(const QBuffer* self) { return self->canReadLine(); } struct miqt_string QBuffer_Tr2(const char* s, const char* c) { QString _ret = QBuffer::tr(s, c); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); struct miqt_string _ms; _ms.len = _b.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _b.data(), _ms.len); return _ms; } struct miqt_string QBuffer_Tr3(const char* s, const char* c, int n) { QString _ret = QBuffer::tr(s, c, static_cast(n)); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); struct miqt_string _ms; _ms.len = _b.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _b.data(), _ms.len); return _ms; } struct miqt_string QBuffer_TrUtf82(const char* s, const char* c) { QString _ret = QBuffer::trUtf8(s, c); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); struct miqt_string _ms; _ms.len = _b.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _b.data(), _ms.len); return _ms; } struct miqt_string QBuffer_TrUtf83(const char* s, const char* c, int n) { QString _ret = QBuffer::trUtf8(s, c, static_cast(n)); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); struct miqt_string _ms; _ms.len = _b.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _b.data(), _ms.len); return _ms; } void QBuffer_Delete(QBuffer* self) { delete self; }