2024-08-29 07:01:51 +00:00
|
|
|
#include <QDateTime>
|
2024-08-25 04:08:24 +00:00
|
|
|
#include <QFileDevice>
|
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qfiledevice.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qfiledevice.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* QFileDevice_MetaObject(const QFileDevice* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 22:32:57 +00:00
|
|
|
void* QFileDevice_Metacast(QFileDevice* self, const char* param1) {
|
|
|
|
return self->qt_metacast(param1);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QFileDevice_Tr(const char* s) {
|
|
|
|
QString _ret = QFileDevice::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* QFileDevice_TrUtf8(const char* s) {
|
|
|
|
QString _ret = QFileDevice::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-18 00:12:02 +00:00
|
|
|
int QFileDevice_Error(const QFileDevice* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QFileDevice::FileError _ret = self->error();
|
2024-09-18 00:12:02 +00:00
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QFileDevice_UnsetError(QFileDevice* self) {
|
|
|
|
self->unsetError();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFileDevice_Close(QFileDevice* self) {
|
|
|
|
self->close();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFileDevice_IsSequential(const QFileDevice* self) {
|
|
|
|
return self->isSequential();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFileDevice_Handle(const QFileDevice* self) {
|
|
|
|
return self->handle();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QFileDevice_FileName(const QFileDevice* 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-11 05:41:09 +00:00
|
|
|
long long QFileDevice_Pos(const QFileDevice* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qint64 _ret = self->pos();
|
|
|
|
return static_cast<long long>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
bool QFileDevice_Seek(QFileDevice* self, long long offset) {
|
|
|
|
return self->seek(static_cast<qint64>(offset));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFileDevice_AtEnd(const QFileDevice* self) {
|
|
|
|
return self->atEnd();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QFileDevice_Flush(QFileDevice* self) {
|
|
|
|
return self->flush();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
long long QFileDevice_Size(const QFileDevice* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qint64 _ret = self->size();
|
|
|
|
return static_cast<long long>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
bool QFileDevice_Resize(QFileDevice* self, long long sz) {
|
|
|
|
return self->resize(static_cast<qint64>(sz));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFileDevice_Permissions(const QFileDevice* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QFileDevice::Permissions _ret = self->permissions();
|
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QFileDevice_SetPermissions(QFileDevice* self, int permissionSpec) {
|
|
|
|
return self->setPermissions(static_cast<QFileDevice::Permissions>(permissionSpec));
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned char* QFileDevice_Map(QFileDevice* self, long long offset, long long size) {
|
2024-09-18 00:12:02 +00:00
|
|
|
uchar* _ret = self->map(static_cast<qint64>(offset), static_cast<qint64>(size));
|
|
|
|
return static_cast<unsigned char*>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QFileDevice_Unmap(QFileDevice* self, unsigned char* address) {
|
|
|
|
return self->unmap(static_cast<uchar*>(address));
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
QDateTime* QFileDevice_FileTime(const QFileDevice* self, int time) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QDateTime(self->fileTime(static_cast<QFileDevice::FileTime>(time)));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
bool QFileDevice_SetFileTime(QFileDevice* self, QDateTime* newDate, int fileTime) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return self->setFileTime(*newDate, static_cast<QFileDevice::FileTime>(fileTime));
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QFileDevice_Tr2(const char* s, const char* c) {
|
|
|
|
QString _ret = QFileDevice::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* QFileDevice_Tr3(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QFileDevice::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* QFileDevice_TrUtf82(const char* s, const char* c) {
|
|
|
|
QString _ret = QFileDevice::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* QFileDevice_TrUtf83(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QFileDevice::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-09-18 00:12:02 +00:00
|
|
|
unsigned char* QFileDevice_Map3(QFileDevice* self, long long offset, long long size, int flags) {
|
|
|
|
uchar* _ret = self->map(static_cast<qint64>(offset), static_cast<qint64>(size), static_cast<QFileDevice::MemoryMapFlags>(flags));
|
|
|
|
return static_cast<unsigned char*>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QFileDevice_Delete(QFileDevice* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|