miqt/qt/gen_qtemporarydir.cpp

60 lines
1.8 KiB
C++

#include <QString>
#include <QByteArray>
#include <cstring>
#include <QTemporaryDir>
#include "qtemporarydir.h"
#include "gen_qtemporarydir.h"
#include "_cgo_export.h"
QTemporaryDir* QTemporaryDir_new() {
return new QTemporaryDir();
}
QTemporaryDir* QTemporaryDir_new2(struct miqt_string* templateName) {
QString templateName_QString = QString::fromUtf8(&templateName->data, templateName->len);
return new QTemporaryDir(templateName_QString);
}
bool QTemporaryDir_IsValid(const QTemporaryDir* self) {
return self->isValid();
}
struct miqt_string* QTemporaryDir_ErrorString(const QTemporaryDir* self) {
QString _ret = self->errorString();
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
return miqt_strdup(_b.data(), _b.length());
}
bool QTemporaryDir_AutoRemove(const QTemporaryDir* self) {
return self->autoRemove();
}
void QTemporaryDir_SetAutoRemove(QTemporaryDir* self, bool b) {
self->setAutoRemove(b);
}
bool QTemporaryDir_Remove(QTemporaryDir* self) {
return self->remove();
}
struct miqt_string* QTemporaryDir_Path(const QTemporaryDir* self) {
QString _ret = self->path();
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
return miqt_strdup(_b.data(), _b.length());
}
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);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
return miqt_strdup(_b.data(), _b.length());
}
void QTemporaryDir_Delete(QTemporaryDir* self) {
delete self;
}