mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 08:58:37 +00:00
150 lines
4.6 KiB
C++
150 lines
4.6 KiB
C++
#include <QDateTime>
|
|
#include <QFileDevice>
|
|
#include <QMetaObject>
|
|
#include <QString>
|
|
#include <QByteArray>
|
|
#include <cstring>
|
|
#include "qfiledevice.h"
|
|
#include "gen_qfiledevice.h"
|
|
#include "_cgo_export.h"
|
|
|
|
QMetaObject* QFileDevice_MetaObject(const QFileDevice* self) {
|
|
return (QMetaObject*) self->metaObject();
|
|
}
|
|
|
|
void* QFileDevice_Metacast(QFileDevice* self, const char* param1) {
|
|
return self->qt_metacast(param1);
|
|
}
|
|
|
|
struct miqt_string* QFileDevice_Tr(const char* s) {
|
|
QString _ret = QFileDevice::tr(s);
|
|
// 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* QFileDevice_TrUtf8(const char* s) {
|
|
QString _ret = QFileDevice::trUtf8(s);
|
|
// 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());
|
|
}
|
|
|
|
int QFileDevice_Error(const QFileDevice* self) {
|
|
QFileDevice::FileError _ret = self->error();
|
|
return static_cast<int>(_ret);
|
|
}
|
|
|
|
void QFileDevice_UnsetError(QFileDevice* self) {
|
|
self->unsetError();
|
|
}
|
|
|
|
void QFileDevice_Close(QFileDevice* self) {
|
|
self->close();
|
|
}
|
|
|
|
bool QFileDevice_IsSequential(const QFileDevice* self) {
|
|
return self->isSequential();
|
|
}
|
|
|
|
int QFileDevice_Handle(const QFileDevice* self) {
|
|
return self->handle();
|
|
}
|
|
|
|
struct miqt_string* QFileDevice_FileName(const QFileDevice* 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();
|
|
return miqt_strdup(_b.data(), _b.length());
|
|
}
|
|
|
|
long long QFileDevice_Pos(const QFileDevice* self) {
|
|
qint64 _ret = self->pos();
|
|
return static_cast<long long>(_ret);
|
|
}
|
|
|
|
bool QFileDevice_Seek(QFileDevice* self, long long offset) {
|
|
return self->seek(static_cast<qint64>(offset));
|
|
}
|
|
|
|
bool QFileDevice_AtEnd(const QFileDevice* self) {
|
|
return self->atEnd();
|
|
}
|
|
|
|
bool QFileDevice_Flush(QFileDevice* self) {
|
|
return self->flush();
|
|
}
|
|
|
|
long long QFileDevice_Size(const QFileDevice* self) {
|
|
qint64 _ret = self->size();
|
|
return static_cast<long long>(_ret);
|
|
}
|
|
|
|
bool QFileDevice_Resize(QFileDevice* self, long long sz) {
|
|
return self->resize(static_cast<qint64>(sz));
|
|
}
|
|
|
|
int QFileDevice_Permissions(const QFileDevice* self) {
|
|
QFileDevice::Permissions _ret = self->permissions();
|
|
return static_cast<int>(_ret);
|
|
}
|
|
|
|
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) {
|
|
uchar* _ret = self->map(static_cast<qint64>(offset), static_cast<qint64>(size));
|
|
return static_cast<unsigned char*>(_ret);
|
|
}
|
|
|
|
bool QFileDevice_Unmap(QFileDevice* self, unsigned char* address) {
|
|
return self->unmap(static_cast<uchar*>(address));
|
|
}
|
|
|
|
QDateTime* QFileDevice_FileTime(const QFileDevice* self, int time) {
|
|
return new QDateTime(self->fileTime(static_cast<QFileDevice::FileTime>(time)));
|
|
}
|
|
|
|
bool QFileDevice_SetFileTime(QFileDevice* self, QDateTime* newDate, int fileTime) {
|
|
return self->setFileTime(*newDate, static_cast<QFileDevice::FileTime>(fileTime));
|
|
}
|
|
|
|
struct miqt_string* QFileDevice_Tr2(const char* s, const char* c) {
|
|
QString _ret = QFileDevice::tr(s, c);
|
|
// 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* QFileDevice_Tr3(const char* s, const char* c, int n) {
|
|
QString _ret = QFileDevice::tr(s, c, static_cast<int>(n));
|
|
// 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* QFileDevice_TrUtf82(const char* s, const char* c) {
|
|
QString _ret = QFileDevice::trUtf8(s, c);
|
|
// 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* QFileDevice_TrUtf83(const char* s, const char* c, int n) {
|
|
QString _ret = QFileDevice::trUtf8(s, c, static_cast<int>(n));
|
|
// 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());
|
|
}
|
|
|
|
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);
|
|
}
|
|
|
|
void QFileDevice_Delete(QFileDevice* self) {
|
|
delete self;
|
|
}
|
|
|