2024-08-25 04:08:24 +00:00
|
|
|
#include <QLibrary>
|
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QObject>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
|
|
|
#include "qlibrary.h"
|
|
|
|
#include "gen_qlibrary.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
QLibrary* QLibrary_new() {
|
|
|
|
return new QLibrary();
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QLibrary* QLibrary_new2(struct miqt_string* fileName) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QLibrary(fileName_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QLibrary* QLibrary_new3(struct miqt_string* fileName, int verNum) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QLibrary(fileName_QString, static_cast<int>(verNum));
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QLibrary* QLibrary_new4(struct miqt_string* fileName, struct miqt_string* version) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len);
|
|
|
|
QString version_QString = QString::fromUtf8(&version->data, version->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QLibrary(fileName_QString, version_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
QLibrary* QLibrary_new5(QObject* parent) {
|
|
|
|
return new QLibrary(parent);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QLibrary* QLibrary_new6(struct miqt_string* fileName, QObject* parent) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QLibrary(fileName_QString, parent);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QLibrary* QLibrary_new7(struct miqt_string* fileName, int verNum, QObject* parent) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QLibrary(fileName_QString, static_cast<int>(verNum), parent);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QLibrary* QLibrary_new8(struct miqt_string* fileName, struct miqt_string* version, QObject* parent) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len);
|
|
|
|
QString version_QString = QString::fromUtf8(&version->data, version->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QLibrary(fileName_QString, version_QString, parent);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMetaObject* QLibrary_MetaObject(const QLibrary* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QLibrary_Tr(const char* s) {
|
|
|
|
QString _ret = QLibrary::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* QLibrary_TrUtf8(const char* s) {
|
|
|
|
QString _ret = QLibrary::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
|
|
|
}
|
|
|
|
|
|
|
|
bool QLibrary_Load(QLibrary* self) {
|
|
|
|
return self->load();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QLibrary_Unload(QLibrary* self) {
|
|
|
|
return self->unload();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QLibrary_IsLoaded(const QLibrary* self) {
|
|
|
|
return self->isLoaded();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
bool QLibrary_IsLibrary(struct miqt_string* fileName) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return QLibrary::isLibrary(fileName_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
void QLibrary_SetFileName(QLibrary* self, struct miqt_string* fileName) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->setFileName(fileName_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QLibrary_FileName(const QLibrary* self) {
|
|
|
|
QString _ret = self->fileName();
|
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
|
|
|
void QLibrary_SetFileNameAndVersion(QLibrary* self, struct miqt_string* fileName, int verNum) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->setFileNameAndVersion(fileName_QString, static_cast<int>(verNum));
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
void QLibrary_SetFileNameAndVersion2(QLibrary* self, struct miqt_string* fileName, struct miqt_string* version) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len);
|
|
|
|
QString version_QString = QString::fromUtf8(&version->data, version->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->setFileNameAndVersion(fileName_QString, version_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QLibrary_ErrorString(const QLibrary* 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
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QLibrary_SetLoadHints(QLibrary* self, int hints) {
|
|
|
|
self->setLoadHints(static_cast<QLibrary::LoadHints>(hints));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QLibrary_LoadHints(const QLibrary* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QLibrary::LoadHints _ret = self->loadHints();
|
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QLibrary_Tr2(const char* s, const char* c) {
|
|
|
|
QString _ret = QLibrary::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* QLibrary_Tr3(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QLibrary::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* QLibrary_TrUtf82(const char* s, const char* c) {
|
|
|
|
QString _ret = QLibrary::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* QLibrary_TrUtf83(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QLibrary::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 QLibrary_Delete(QLibrary* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|