2024-08-25 04:08:24 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
2024-08-25 04:08:24 +00:00
|
|
|
#include <QUuid>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "quuid.h"
|
|
|
|
#include "gen_quuid.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
QUuid* QUuid_new() {
|
|
|
|
return new QUuid();
|
|
|
|
}
|
|
|
|
|
|
|
|
QUuid* QUuid_new2(unsigned int l, uint16_t w1, uint16_t w2, unsigned char b1, unsigned char b2, unsigned char b3, unsigned char b4, unsigned char b5, unsigned char b6, unsigned char b7, unsigned char b8) {
|
|
|
|
return new QUuid(static_cast<uint>(l), static_cast<ushort>(w1), static_cast<ushort>(w2), static_cast<uchar>(b1), static_cast<uchar>(b2), static_cast<uchar>(b3), static_cast<uchar>(b4), static_cast<uchar>(b5), static_cast<uchar>(b6), static_cast<uchar>(b7), static_cast<uchar>(b8));
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QUuid* QUuid_new3(struct miqt_string* param1) {
|
|
|
|
QString param1_QString = QString::fromUtf8(¶m1->data, param1->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QUuid(param1_QString);
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
QUuid* QUuid_new4(const char* param1) {
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QUuid(param1);
|
|
|
|
}
|
|
|
|
|
|
|
|
QUuid* QUuid_new5(QByteArray* param1) {
|
|
|
|
return new QUuid(*param1);
|
|
|
|
}
|
|
|
|
|
|
|
|
QUuid* QUuid_new6(QUuid* param1) {
|
|
|
|
return new QUuid(*param1);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QUuid_ToString(const QUuid* self) {
|
|
|
|
QString _ret = self->toString();
|
2024-08-29 07:01:51 +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-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QUuid_ToStringWithMode(const QUuid* self, uintptr_t mode) {
|
|
|
|
QString _ret = self->toString(static_cast<QUuid::StringFormat>(mode));
|
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
|
|
|
QByteArray* QUuid_ToByteArray(const QUuid* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QByteArray(self->toByteArray());
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QByteArray* QUuid_ToByteArrayWithMode(const QUuid* self, uintptr_t mode) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QByteArray(self->toByteArray(static_cast<QUuid::StringFormat>(mode)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QByteArray* QUuid_ToRfc4122(const QUuid* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QByteArray(self->toRfc4122());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QUuid* QUuid_FromRfc4122(QByteArray* param1) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QUuid(QUuid::fromRfc4122(*param1));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QUuid_IsNull(const QUuid* self) {
|
|
|
|
return self->isNull();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QUuid_OperatorEqual(const QUuid* self, QUuid* orig) {
|
|
|
|
return self->operator==(*orig);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QUuid_OperatorNotEqual(const QUuid* self, QUuid* orig) {
|
|
|
|
return self->operator!=(*orig);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QUuid_OperatorLesser(const QUuid* self, QUuid* other) {
|
|
|
|
return self->operator<(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QUuid_OperatorGreater(const QUuid* self, QUuid* other) {
|
|
|
|
return self->operator>(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QUuid* QUuid_CreateUuid() {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QUuid(QUuid::createUuid());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QUuid* QUuid_CreateUuidV3(QUuid* ns, QByteArray* baseData) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QUuid(QUuid::createUuidV3(*ns, *baseData));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QUuid* QUuid_CreateUuidV5(QUuid* ns, QByteArray* baseData) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QUuid(QUuid::createUuidV5(*ns, *baseData));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QUuid* QUuid_CreateUuidV32(QUuid* ns, struct miqt_string* baseData) {
|
|
|
|
QString baseData_QString = QString::fromUtf8(&baseData->data, baseData->len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QUuid(QUuid::createUuidV3(*ns, baseData_QString));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QUuid* QUuid_CreateUuidV52(QUuid* ns, struct miqt_string* baseData) {
|
|
|
|
QString baseData_QString = QString::fromUtf8(&baseData->data, baseData->len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QUuid(QUuid::createUuidV5(*ns, baseData_QString));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
uintptr_t QUuid_Variant(const QUuid* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QUuid::Variant _ret = self->variant();
|
|
|
|
return static_cast<uintptr_t>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
uintptr_t QUuid_Version(const QUuid* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QUuid::Version _ret = self->version();
|
|
|
|
return static_cast<uintptr_t>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QUuid_Delete(QUuid* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|