miqt/qt/gen_qoperatingsystemversion.cpp

74 lines
2.4 KiB
C++
Raw Normal View History

#include <QOperatingSystemVersion>
#include <QString>
2024-08-29 07:01:51 +00:00
#include <QByteArray>
#include <cstring>
#include <qoperatingsystemversion.h>
2024-08-29 07:01:51 +00:00
#include "gen_qoperatingsystemversion.h"
#ifndef _Bool
#define _Bool bool
#endif
#include "_cgo_export.h"
2024-12-07 04:15:57 +00:00
QOperatingSystemVersion* QOperatingSystemVersion_new(int osType, int vmajor) {
return new QOperatingSystemVersion(static_cast<QOperatingSystemVersion::OSType>(osType), static_cast<int>(vmajor));
2024-08-29 07:01:51 +00:00
}
2024-12-07 04:15:57 +00:00
QOperatingSystemVersion* QOperatingSystemVersion_new2(int osType, int vmajor, int vminor) {
return new QOperatingSystemVersion(static_cast<QOperatingSystemVersion::OSType>(osType), static_cast<int>(vmajor), static_cast<int>(vminor));
2024-08-29 07:01:51 +00:00
}
2024-12-07 04:15:57 +00:00
QOperatingSystemVersion* QOperatingSystemVersion_new3(int osType, int vmajor, int vminor, int vmicro) {
return new QOperatingSystemVersion(static_cast<QOperatingSystemVersion::OSType>(osType), static_cast<int>(vmajor), static_cast<int>(vminor), static_cast<int>(vmicro));
2024-08-29 07:01:51 +00:00
}
QOperatingSystemVersion* QOperatingSystemVersion_Current() {
return new QOperatingSystemVersion(QOperatingSystemVersion::current());
}
int QOperatingSystemVersion_CurrentType() {
QOperatingSystemVersion::OSType _ret = QOperatingSystemVersion::currentType();
return static_cast<int>(_ret);
2024-08-29 07:01:51 +00:00
}
int QOperatingSystemVersion_MajorVersion(const QOperatingSystemVersion* self) {
return self->majorVersion();
}
int QOperatingSystemVersion_MinorVersion(const QOperatingSystemVersion* self) {
return self->minorVersion();
}
int QOperatingSystemVersion_MicroVersion(const QOperatingSystemVersion* self) {
return self->microVersion();
}
int QOperatingSystemVersion_SegmentCount(const QOperatingSystemVersion* self) {
return self->segmentCount();
2024-08-29 07:01:51 +00:00
}
int QOperatingSystemVersion_Type(const QOperatingSystemVersion* self) {
QOperatingSystemVersion::OSType _ret = self->type();
return static_cast<int>(_ret);
}
struct miqt_string QOperatingSystemVersion_Name(const QOperatingSystemVersion* self) {
QString _ret = self->name();
// 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;
}
2024-11-19 06:29:06 +00:00
void QOperatingSystemVersion_Delete(QOperatingSystemVersion* self, bool isSubclass) {
if (isSubclass) {
delete dynamic_cast<QOperatingSystemVersion*>( self );
} else {
delete self;
}
}