2024-08-25 04:08:24 +00:00
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
2024-08-25 04:08:24 +00:00
|
|
|
#include <QTemporaryDir>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qtemporarydir.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qtemporarydir.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
QTemporaryDir* QTemporaryDir_new() {
|
|
|
|
return new QTemporaryDir();
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QTemporaryDir* QTemporaryDir_new2(struct miqt_string* templateName) {
|
|
|
|
QString templateName_QString = QString::fromUtf8(&templateName->data, templateName->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QTemporaryDir(templateName_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QTemporaryDir_IsValid(const QTemporaryDir* self) {
|
|
|
|
return self->isValid();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QTemporaryDir_ErrorString(const QTemporaryDir* 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-09-11 05:41:09 +00:00
|
|
|
bool QTemporaryDir_AutoRemove(const QTemporaryDir* self) {
|
|
|
|
return self->autoRemove();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QTemporaryDir_SetAutoRemove(QTemporaryDir* self, bool b) {
|
|
|
|
self->setAutoRemove(b);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QTemporaryDir_Remove(QTemporaryDir* self) {
|
|
|
|
return self->remove();
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QTemporaryDir_Path(const QTemporaryDir* self) {
|
|
|
|
QString _ret = self->path();
|
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* QTemporaryDir_FilePath(const QTemporaryDir* self, struct miqt_string* fileName) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len);
|
|
|
|
QString _ret = self->filePath(fileName_QString);
|
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 QTemporaryDir_Delete(QTemporaryDir* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|