2024-08-25 04:08:24 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <QIODevice>
|
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
|
|
|
#include "qiodevice.h"
|
|
|
|
#include "gen_qiodevice.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMetaObject* QIODevice_MetaObject(const QIODevice* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QIODevice_Tr(const char* s) {
|
|
|
|
QString _ret = QIODevice::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* QIODevice_TrUtf8(const char* s) {
|
|
|
|
QString _ret = QIODevice::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
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QIODevice_OpenMode(const QIODevice* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QIODevice::OpenMode _ret = self->openMode();
|
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QIODevice_SetTextModeEnabled(QIODevice* self, bool enabled) {
|
|
|
|
self->setTextModeEnabled(enabled);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QIODevice_IsTextModeEnabled(const QIODevice* self) {
|
|
|
|
return self->isTextModeEnabled();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QIODevice_IsOpen(const QIODevice* self) {
|
|
|
|
return self->isOpen();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QIODevice_IsReadable(const QIODevice* self) {
|
|
|
|
return self->isReadable();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QIODevice_IsWritable(const QIODevice* self) {
|
|
|
|
return self->isWritable();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QIODevice_IsSequential(const QIODevice* self) {
|
|
|
|
return self->isSequential();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QIODevice_ReadChannelCount(const QIODevice* self) {
|
|
|
|
return self->readChannelCount();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QIODevice_WriteChannelCount(const QIODevice* self) {
|
|
|
|
return self->writeChannelCount();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QIODevice_CurrentReadChannel(const QIODevice* self) {
|
|
|
|
return self->currentReadChannel();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QIODevice_SetCurrentReadChannel(QIODevice* self, int channel) {
|
|
|
|
self->setCurrentReadChannel(static_cast<int>(channel));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QIODevice_CurrentWriteChannel(const QIODevice* self) {
|
|
|
|
return self->currentWriteChannel();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QIODevice_SetCurrentWriteChannel(QIODevice* self, int channel) {
|
|
|
|
self->setCurrentWriteChannel(static_cast<int>(channel));
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
bool QIODevice_Open(QIODevice* self, int mode) {
|
|
|
|
return self->open(static_cast<QIODevice::OpenMode>(mode));
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QIODevice_Close(QIODevice* self) {
|
|
|
|
self->close();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
long long QIODevice_Pos(const QIODevice* self) {
|
|
|
|
return self->pos();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
long long QIODevice_Size(const QIODevice* self) {
|
|
|
|
return self->size();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
bool QIODevice_Seek(QIODevice* self, long long pos) {
|
|
|
|
return self->seek(static_cast<qint64>(pos));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QIODevice_AtEnd(const QIODevice* self) {
|
|
|
|
return self->atEnd();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QIODevice_Reset(QIODevice* self) {
|
|
|
|
return self->reset();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
long long QIODevice_BytesAvailable(const QIODevice* self) {
|
|
|
|
return self->bytesAvailable();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
long long QIODevice_BytesToWrite(const QIODevice* self) {
|
|
|
|
return self->bytesToWrite();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
long long QIODevice_Read(QIODevice* self, char* data, long long maxlen) {
|
|
|
|
return self->read(data, static_cast<qint64>(maxlen));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
QByteArray* QIODevice_ReadWithMaxlen(QIODevice* self, long long maxlen) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _ret = self->read(static_cast<qint64>(maxlen));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
2024-09-14 22:29:05 +00:00
|
|
|
return static_cast<QByteArray*>(new QByteArray(_ret));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QByteArray* QIODevice_ReadAll(QIODevice* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _ret = self->readAll();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
2024-09-14 22:29:05 +00:00
|
|
|
return static_cast<QByteArray*>(new QByteArray(_ret));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
long long QIODevice_ReadLine(QIODevice* self, char* data, long long maxlen) {
|
|
|
|
return self->readLine(data, static_cast<qint64>(maxlen));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QByteArray* QIODevice_ReadLine2(QIODevice* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _ret = self->readLine();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
2024-09-14 22:29:05 +00:00
|
|
|
return static_cast<QByteArray*>(new QByteArray(_ret));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QIODevice_CanReadLine(const QIODevice* self) {
|
|
|
|
return self->canReadLine();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QIODevice_StartTransaction(QIODevice* self) {
|
|
|
|
self->startTransaction();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QIODevice_CommitTransaction(QIODevice* self) {
|
|
|
|
self->commitTransaction();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QIODevice_RollbackTransaction(QIODevice* self) {
|
|
|
|
self->rollbackTransaction();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QIODevice_IsTransactionStarted(const QIODevice* self) {
|
|
|
|
return self->isTransactionStarted();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
long long QIODevice_Write(QIODevice* self, const char* data, long long lenVal) {
|
|
|
|
return self->write(data, static_cast<qint64>(lenVal));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
long long QIODevice_WriteWithData(QIODevice* self, const char* data) {
|
2024-08-25 04:08:24 +00:00
|
|
|
return self->write(data);
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
long long QIODevice_Write2(QIODevice* self, QByteArray* data) {
|
2024-08-25 04:08:24 +00:00
|
|
|
return self->write(*data);
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
long long QIODevice_Peek(QIODevice* self, char* data, long long maxlen) {
|
|
|
|
return self->peek(data, static_cast<qint64>(maxlen));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
QByteArray* QIODevice_PeekWithMaxlen(QIODevice* self, long long maxlen) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _ret = self->peek(static_cast<qint64>(maxlen));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
2024-09-14 22:29:05 +00:00
|
|
|
return static_cast<QByteArray*>(new QByteArray(_ret));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
long long QIODevice_Skip(QIODevice* self, long long maxSize) {
|
|
|
|
return self->skip(static_cast<qint64>(maxSize));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QIODevice_WaitForReadyRead(QIODevice* self, int msecs) {
|
|
|
|
return self->waitForReadyRead(static_cast<int>(msecs));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QIODevice_WaitForBytesWritten(QIODevice* self, int msecs) {
|
|
|
|
return self->waitForBytesWritten(static_cast<int>(msecs));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QIODevice_UngetChar(QIODevice* self, char c) {
|
|
|
|
self->ungetChar(static_cast<char>(c));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QIODevice_PutChar(QIODevice* self, char c) {
|
|
|
|
return self->putChar(static_cast<char>(c));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QIODevice_GetChar(QIODevice* self, char* c) {
|
|
|
|
return self->getChar(c);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QIODevice_ErrorString(const QIODevice* self) {
|
|
|
|
QString _ret = self->errorString();
|
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 QIODevice_ReadyRead(QIODevice* self) {
|
|
|
|
self->readyRead();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QIODevice_connect_ReadyRead(QIODevice* self, void* slot) {
|
|
|
|
QIODevice::connect(self, static_cast<void (QIODevice::*)()>(&QIODevice::readyRead), self, [=]() {
|
2024-09-14 22:29:05 +00:00
|
|
|
miqt_exec_callback_QIODevice_ReadyRead(slot);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
void QIODevice_ChannelReadyRead(QIODevice* self, int channel) {
|
|
|
|
self->channelReadyRead(static_cast<int>(channel));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QIODevice_connect_ChannelReadyRead(QIODevice* self, void* slot) {
|
|
|
|
QIODevice::connect(self, static_cast<void (QIODevice::*)(int)>(&QIODevice::channelReadyRead), self, [=](int channel) {
|
2024-09-14 22:29:05 +00:00
|
|
|
int sigval1 = channel;
|
|
|
|
miqt_exec_callback_QIODevice_ChannelReadyRead(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QIODevice_BytesWritten(QIODevice* self, long long bytes) {
|
|
|
|
self->bytesWritten(static_cast<qint64>(bytes));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QIODevice_connect_BytesWritten(QIODevice* self, void* slot) {
|
|
|
|
QIODevice::connect(self, static_cast<void (QIODevice::*)(qint64)>(&QIODevice::bytesWritten), self, [=](qint64 bytes) {
|
2024-09-14 22:29:05 +00:00
|
|
|
long long sigval1 = bytes;
|
|
|
|
miqt_exec_callback_QIODevice_BytesWritten(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QIODevice_ChannelBytesWritten(QIODevice* self, int channel, long long bytes) {
|
|
|
|
self->channelBytesWritten(static_cast<int>(channel), static_cast<qint64>(bytes));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QIODevice_connect_ChannelBytesWritten(QIODevice* self, void* slot) {
|
|
|
|
QIODevice::connect(self, static_cast<void (QIODevice::*)(int, qint64)>(&QIODevice::channelBytesWritten), self, [=](int channel, qint64 bytes) {
|
2024-09-14 22:29:05 +00:00
|
|
|
int sigval1 = channel;
|
|
|
|
long long sigval2 = bytes;
|
|
|
|
miqt_exec_callback_QIODevice_ChannelBytesWritten(slot, sigval1, sigval2);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
void QIODevice_AboutToClose(QIODevice* self) {
|
|
|
|
self->aboutToClose();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QIODevice_connect_AboutToClose(QIODevice* self, void* slot) {
|
|
|
|
QIODevice::connect(self, static_cast<void (QIODevice::*)()>(&QIODevice::aboutToClose), self, [=]() {
|
2024-09-14 22:29:05 +00:00
|
|
|
miqt_exec_callback_QIODevice_AboutToClose(slot);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
void QIODevice_ReadChannelFinished(QIODevice* self) {
|
|
|
|
self->readChannelFinished();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QIODevice_connect_ReadChannelFinished(QIODevice* self, void* slot) {
|
|
|
|
QIODevice::connect(self, static_cast<void (QIODevice::*)()>(&QIODevice::readChannelFinished), self, [=]() {
|
2024-09-14 22:29:05 +00:00
|
|
|
miqt_exec_callback_QIODevice_ReadChannelFinished(slot);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QIODevice_Tr2(const char* s, const char* c) {
|
|
|
|
QString _ret = QIODevice::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* QIODevice_Tr3(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QIODevice::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* QIODevice_TrUtf82(const char* s, const char* c) {
|
|
|
|
QString _ret = QIODevice::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* QIODevice_TrUtf83(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QIODevice::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
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
QByteArray* QIODevice_ReadLine1(QIODevice* self, long long maxlen) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _ret = self->readLine(static_cast<qint64>(maxlen));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
2024-09-14 22:29:05 +00:00
|
|
|
return static_cast<QByteArray*>(new QByteArray(_ret));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QIODevice_Delete(QIODevice* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|