2024-08-25 04:08:24 +00:00
|
|
|
#include <QBuffer>
|
|
|
|
#include <QByteArray>
|
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QObject>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qbuffer.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qbuffer.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
QBuffer* QBuffer_new() {
|
|
|
|
return new QBuffer();
|
|
|
|
}
|
|
|
|
|
|
|
|
QBuffer* QBuffer_new2(QByteArray* buf) {
|
|
|
|
return new QBuffer(buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
QBuffer* QBuffer_new3(QObject* parent) {
|
|
|
|
return new QBuffer(parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
QBuffer* QBuffer_new4(QByteArray* buf, QObject* parent) {
|
|
|
|
return new QBuffer(buf, parent);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMetaObject* QBuffer_MetaObject(const QBuffer* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 22:32:57 +00:00
|
|
|
void* QBuffer_Metacast(QBuffer* self, const char* param1) {
|
|
|
|
return self->qt_metacast(param1);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QBuffer_Tr(const char* s) {
|
|
|
|
QString _ret = QBuffer::tr(s);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QBuffer_TrUtf8(const char* s) {
|
|
|
|
QString _ret = QBuffer::trUtf8(s);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QByteArray* QBuffer_Buffer(QBuffer* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray& _ret = self->buffer();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Cast returned reference into pointer
|
2024-09-14 22:29:05 +00:00
|
|
|
return &_ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QByteArray* QBuffer_Buffer2(const QBuffer* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
const QByteArray& _ret = self->buffer();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Cast returned reference into pointer
|
2024-09-14 22:29:05 +00:00
|
|
|
return const_cast<QByteArray*>(&_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QBuffer_SetBuffer(QBuffer* self, QByteArray* a) {
|
|
|
|
self->setBuffer(a);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QBuffer_SetData(QBuffer* self, QByteArray* data) {
|
|
|
|
self->setData(*data);
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QBuffer_SetData2(QBuffer* self, const char* data, int lenVal) {
|
2024-08-25 04:08:24 +00:00
|
|
|
self->setData(data, static_cast<int>(lenVal));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QByteArray* QBuffer_Data(const QBuffer* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
const QByteArray& _ret = self->data();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Cast returned reference into pointer
|
2024-09-14 22:29:05 +00:00
|
|
|
return const_cast<QByteArray*>(&_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
bool QBuffer_Open(QBuffer* self, int openMode) {
|
|
|
|
return self->open(static_cast<QIODevice::OpenMode>(openMode));
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QBuffer_Close(QBuffer* self) {
|
|
|
|
self->close();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
long long QBuffer_Size(const QBuffer* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qint64 _ret = self->size();
|
|
|
|
return static_cast<long long>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
long long QBuffer_Pos(const QBuffer* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qint64 _ret = self->pos();
|
|
|
|
return static_cast<long long>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
bool QBuffer_Seek(QBuffer* self, long long off) {
|
|
|
|
return self->seek(static_cast<qint64>(off));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QBuffer_AtEnd(const QBuffer* self) {
|
|
|
|
return self->atEnd();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QBuffer_CanReadLine(const QBuffer* self) {
|
|
|
|
return self->canReadLine();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QBuffer_Tr2(const char* s, const char* c) {
|
|
|
|
QString _ret = QBuffer::tr(s, c);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QBuffer_Tr3(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QBuffer::tr(s, c, static_cast<int>(n));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QBuffer_TrUtf82(const char* s, const char* c) {
|
|
|
|
QString _ret = QBuffer::trUtf8(s, c);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QBuffer_TrUtf83(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QBuffer::trUtf8(s, c, static_cast<int>(n));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QBuffer_Delete(QBuffer* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|