2024-11-26 06:55:18 +00:00
|
|
|
#include <QScriptProgram>
|
|
|
|
#include <QString>
|
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
|
|
|
#include <qscriptprogram.h>
|
|
|
|
#include "gen_qscriptprogram.h"
|
|
|
|
#include "_cgo_export.h"
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QScriptProgram* QScriptProgram_new() {
|
|
|
|
return new QScriptProgram();
|
2024-11-26 06:55:18 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QScriptProgram* QScriptProgram_new2(struct miqt_string sourceCode) {
|
2024-11-26 06:55:18 +00:00
|
|
|
QString sourceCode_QString = QString::fromUtf8(sourceCode.data, sourceCode.len);
|
2024-12-07 04:15:57 +00:00
|
|
|
return new QScriptProgram(sourceCode_QString);
|
2024-11-26 06:55:18 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QScriptProgram* QScriptProgram_new3(QScriptProgram* other) {
|
|
|
|
return new QScriptProgram(*other);
|
2024-11-26 06:55:18 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QScriptProgram* QScriptProgram_new4(struct miqt_string sourceCode, struct miqt_string fileName) {
|
2024-11-26 06:55:18 +00:00
|
|
|
QString sourceCode_QString = QString::fromUtf8(sourceCode.data, sourceCode.len);
|
|
|
|
QString fileName_QString = QString::fromUtf8(fileName.data, fileName.len);
|
2024-12-07 04:15:57 +00:00
|
|
|
return new QScriptProgram(sourceCode_QString, fileName_QString);
|
2024-11-26 06:55:18 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QScriptProgram* QScriptProgram_new5(struct miqt_string sourceCode, struct miqt_string fileName, int firstLineNumber) {
|
2024-11-26 06:55:18 +00:00
|
|
|
QString sourceCode_QString = QString::fromUtf8(sourceCode.data, sourceCode.len);
|
|
|
|
QString fileName_QString = QString::fromUtf8(fileName.data, fileName.len);
|
2024-12-07 04:15:57 +00:00
|
|
|
return new QScriptProgram(sourceCode_QString, fileName_QString, static_cast<int>(firstLineNumber));
|
2024-11-26 06:55:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QScriptProgram_OperatorAssign(QScriptProgram* self, QScriptProgram* other) {
|
|
|
|
self->operator=(*other);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QScriptProgram_IsNull(const QScriptProgram* self) {
|
|
|
|
return self->isNull();
|
|
|
|
}
|
|
|
|
|
|
|
|
struct miqt_string QScriptProgram_SourceCode(const QScriptProgram* self) {
|
|
|
|
QString _ret = self->sourceCode();
|
|
|
|
// 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<char*>(malloc(_ms.len));
|
|
|
|
memcpy(_ms.data, _b.data(), _ms.len);
|
|
|
|
return _ms;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct miqt_string QScriptProgram_FileName(const QScriptProgram* self) {
|
|
|
|
QString _ret = self->fileName();
|
|
|
|
// 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<char*>(malloc(_ms.len));
|
|
|
|
memcpy(_ms.data, _b.data(), _ms.len);
|
|
|
|
return _ms;
|
|
|
|
}
|
|
|
|
|
|
|
|
int QScriptProgram_FirstLineNumber(const QScriptProgram* self) {
|
|
|
|
return self->firstLineNumber();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QScriptProgram_OperatorEqual(const QScriptProgram* self, QScriptProgram* other) {
|
|
|
|
return (*self == *other);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QScriptProgram_OperatorNotEqual(const QScriptProgram* self, QScriptProgram* other) {
|
|
|
|
return (*self != *other);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QScriptProgram_Delete(QScriptProgram* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QScriptProgram*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|