2024-08-25 04:08:24 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <QCborArray>
|
|
|
|
#include <QCborMap>
|
|
|
|
#include <QCborParserError>
|
|
|
|
#include <QCborStreamReader>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QCborStreamWriter>
|
2024-08-25 04:08:24 +00:00
|
|
|
#include <QCborValue>
|
|
|
|
#include <QCborValueRef>
|
|
|
|
#include <QDateTime>
|
|
|
|
#include <QJsonValue>
|
|
|
|
#include <QRegularExpression>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
2024-08-25 04:08:24 +00:00
|
|
|
#include <QUrl>
|
|
|
|
#include <QUuid>
|
|
|
|
#include <QVariant>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qcborvalue.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qcborvalue.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QCborParserError_ErrorString(const QCborParserError* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->errorString();
|
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();
|
2024-10-18 23:53:33 +00:00
|
|
|
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-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCborParserError_Delete(QCborParserError* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QCborParserError*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCborValue_new(QCborValue** outptr_QCborValue) {
|
|
|
|
QCborValue* ret = new QCborValue();
|
|
|
|
*outptr_QCborValue = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCborValue_new2(int t_, QCborValue** outptr_QCborValue) {
|
|
|
|
QCborValue* ret = new QCborValue(static_cast<QCborValue::Type>(t_));
|
|
|
|
*outptr_QCborValue = ret;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCborValue_new3(bool b_, QCborValue** outptr_QCborValue) {
|
|
|
|
QCborValue* ret = new QCborValue(b_);
|
|
|
|
*outptr_QCborValue = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCborValue_new4(int i, QCborValue** outptr_QCborValue) {
|
|
|
|
QCborValue* ret = new QCborValue(static_cast<int>(i));
|
|
|
|
*outptr_QCborValue = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCborValue_new5(unsigned int u, QCborValue** outptr_QCborValue) {
|
|
|
|
QCborValue* ret = new QCborValue(static_cast<unsigned int>(u));
|
|
|
|
*outptr_QCborValue = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCborValue_new6(long long i, QCborValue** outptr_QCborValue) {
|
|
|
|
QCborValue* ret = new QCborValue(static_cast<qint64>(i));
|
|
|
|
*outptr_QCborValue = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCborValue_new7(double v, QCborValue** outptr_QCborValue) {
|
|
|
|
QCborValue* ret = new QCborValue(static_cast<double>(v));
|
|
|
|
*outptr_QCborValue = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCborValue_new8(uint8_t st, QCborValue** outptr_QCborValue) {
|
|
|
|
QCborValue* ret = new QCborValue(static_cast<QCborSimpleType>(st));
|
|
|
|
*outptr_QCborValue = ret;
|
2024-09-16 07:04:28 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCborValue_new9(struct miqt_string ba, QCborValue** outptr_QCborValue) {
|
2024-10-18 23:53:33 +00:00
|
|
|
QByteArray ba_QByteArray(ba.data, ba.len);
|
2024-11-19 06:29:06 +00:00
|
|
|
QCborValue* ret = new QCborValue(ba_QByteArray);
|
|
|
|
*outptr_QCborValue = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCborValue_new10(struct miqt_string s, QCborValue** outptr_QCborValue) {
|
2024-10-18 23:53:33 +00:00
|
|
|
QString s_QString = QString::fromUtf8(s.data, s.len);
|
2024-11-19 06:29:06 +00:00
|
|
|
QCborValue* ret = new QCborValue(s_QString);
|
|
|
|
*outptr_QCborValue = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCborValue_new11(const char* s, QCborValue** outptr_QCborValue) {
|
|
|
|
QCborValue* ret = new QCborValue(s);
|
|
|
|
*outptr_QCborValue = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCborValue_new12(QCborArray* a, QCborValue** outptr_QCborValue) {
|
|
|
|
QCborValue* ret = new QCborValue(*a);
|
|
|
|
*outptr_QCborValue = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCborValue_new13(QCborMap* m, QCborValue** outptr_QCborValue) {
|
|
|
|
QCborValue* ret = new QCborValue(*m);
|
|
|
|
*outptr_QCborValue = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCborValue_new14(uint64_t tag, QCborValue** outptr_QCborValue) {
|
|
|
|
QCborValue* ret = new QCborValue(static_cast<QCborTag>(tag));
|
|
|
|
*outptr_QCborValue = ret;
|
2024-09-16 07:04:28 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCborValue_new15(int t_, QCborValue** outptr_QCborValue) {
|
|
|
|
QCborValue* ret = new QCborValue(static_cast<QCborKnownTags>(t_));
|
|
|
|
*outptr_QCborValue = ret;
|
2024-09-16 07:04:28 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCborValue_new16(QDateTime* dt, QCborValue** outptr_QCborValue) {
|
|
|
|
QCborValue* ret = new QCborValue(*dt);
|
|
|
|
*outptr_QCborValue = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCborValue_new17(QUrl* url, QCborValue** outptr_QCborValue) {
|
|
|
|
QCborValue* ret = new QCborValue(*url);
|
|
|
|
*outptr_QCborValue = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCborValue_new18(QRegularExpression* rx, QCborValue** outptr_QCborValue) {
|
|
|
|
QCborValue* ret = new QCborValue(*rx);
|
|
|
|
*outptr_QCborValue = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCborValue_new19(QUuid* uuid, QCborValue** outptr_QCborValue) {
|
|
|
|
QCborValue* ret = new QCborValue(*uuid);
|
|
|
|
*outptr_QCborValue = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCborValue_new20(QCborValue* other, QCborValue** outptr_QCborValue) {
|
|
|
|
QCborValue* ret = new QCborValue(*other);
|
|
|
|
*outptr_QCborValue = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCborValue_new21(uint64_t tag, QCborValue* taggedValue, QCborValue** outptr_QCborValue) {
|
|
|
|
QCborValue* ret = new QCborValue(static_cast<QCborTag>(tag), *taggedValue);
|
|
|
|
*outptr_QCborValue = ret;
|
2024-09-16 07:04:28 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCborValue_new22(int t_, QCborValue* tv, QCborValue** outptr_QCborValue) {
|
|
|
|
QCborValue* ret = new QCborValue(static_cast<QCborKnownTags>(t_), *tv);
|
|
|
|
*outptr_QCborValue = ret;
|
2024-09-16 07:04:28 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QCborValue_OperatorAssign(QCborValue* self, QCborValue* other) {
|
|
|
|
self->operator=(*other);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QCborValue_Swap(QCborValue* self, QCborValue* other) {
|
|
|
|
self->swap(*other);
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
int QCborValue_Type(const QCborValue* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QCborValue::Type _ret = self->type();
|
2024-09-18 00:12:02 +00:00
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValue_IsInteger(const QCborValue* self) {
|
|
|
|
return self->isInteger();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValue_IsByteArray(const QCborValue* self) {
|
|
|
|
return self->isByteArray();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValue_IsString(const QCborValue* self) {
|
|
|
|
return self->isString();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValue_IsArray(const QCborValue* self) {
|
|
|
|
return self->isArray();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValue_IsMap(const QCborValue* self) {
|
|
|
|
return self->isMap();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValue_IsTag(const QCborValue* self) {
|
|
|
|
return self->isTag();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValue_IsFalse(const QCborValue* self) {
|
|
|
|
return self->isFalse();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValue_IsTrue(const QCborValue* self) {
|
|
|
|
return self->isTrue();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValue_IsBool(const QCborValue* self) {
|
|
|
|
return self->isBool();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValue_IsNull(const QCborValue* self) {
|
|
|
|
return self->isNull();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValue_IsUndefined(const QCborValue* self) {
|
|
|
|
return self->isUndefined();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValue_IsDouble(const QCborValue* self) {
|
|
|
|
return self->isDouble();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValue_IsDateTime(const QCborValue* self) {
|
|
|
|
return self->isDateTime();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValue_IsUrl(const QCborValue* self) {
|
|
|
|
return self->isUrl();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValue_IsRegularExpression(const QCborValue* self) {
|
|
|
|
return self->isRegularExpression();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValue_IsUuid(const QCborValue* self) {
|
|
|
|
return self->isUuid();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValue_IsInvalid(const QCborValue* self) {
|
|
|
|
return self->isInvalid();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValue_IsContainer(const QCborValue* self) {
|
|
|
|
return self->isContainer();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValue_IsSimpleType(const QCborValue* self) {
|
|
|
|
return self->isSimpleType();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
bool QCborValue_IsSimpleTypeWithSt(const QCborValue* self, uint8_t st) {
|
|
|
|
return self->isSimpleType(static_cast<QCborSimpleType>(st));
|
2024-09-16 07:04:28 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
uint8_t QCborValue_ToSimpleType(const QCborValue* self) {
|
|
|
|
QCborSimpleType _ret = self->toSimpleType();
|
|
|
|
return static_cast<uint8_t>(_ret);
|
2024-09-16 07:04:28 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
long long QCborValue_ToInteger(const QCborValue* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qint64 _ret = self->toInteger();
|
|
|
|
return static_cast<long long>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValue_ToBool(const QCborValue* self) {
|
|
|
|
return self->toBool();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QCborValue_ToDouble(const QCborValue* self) {
|
|
|
|
return self->toDouble();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
uint64_t QCborValue_Tag(const QCborValue* self) {
|
|
|
|
QCborTag _ret = self->tag();
|
|
|
|
return static_cast<uint64_t>(_ret);
|
2024-09-16 07:04:28 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QCborValue* QCborValue_TaggedValue(const QCborValue* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QCborValue(self->taggedValue());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QCborValue_ToByteArray(const QCborValue* self) {
|
|
|
|
QByteArray _qb = self->toByteArray();
|
|
|
|
struct miqt_string _ms;
|
|
|
|
_ms.len = _qb.length();
|
|
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
|
|
memcpy(_ms.data, _qb.data(), _ms.len);
|
|
|
|
return _ms;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QCborValue_ToString(const QCborValue* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->toString();
|
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();
|
2024-10-18 23:53:33 +00:00
|
|
|
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-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QDateTime* QCborValue_ToDateTime(const QCborValue* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QDateTime(self->toDateTime());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QUrl* QCborValue_ToUrl(const QCborValue* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QUrl(self->toUrl());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QRegularExpression* QCborValue_ToRegularExpression(const QCborValue* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QRegularExpression(self->toRegularExpression());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QUuid* QCborValue_ToUuid(const QCborValue* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QUuid(self->toUuid());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QCborArray* QCborValue_ToArray(const QCborValue* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QCborArray(self->toArray());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QCborArray* QCborValue_ToArrayWithDefaultValue(const QCborValue* self, QCborArray* defaultValue) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QCborArray(self->toArray(*defaultValue));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QCborMap* QCborValue_ToMap(const QCborValue* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QCborMap(self->toMap());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QCborMap* QCborValue_ToMapWithDefaultValue(const QCborValue* self, QCborMap* defaultValue) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QCborMap(self->toMap(*defaultValue));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QCborValue* QCborValue_OperatorSubscript(const QCborValue* self, struct miqt_string key) {
|
|
|
|
QString key_QString = QString::fromUtf8(key.data, key.len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QCborValue(self->operator[](key_QString));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QCborValue* QCborValue_OperatorSubscript2(const QCborValue* self, long long key) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QCborValue(self->operator[](static_cast<qint64>(key)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
QCborValueRef* QCborValue_OperatorSubscript3(QCborValue* self, long long key) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QCborValueRef(self->operator[](static_cast<qint64>(key)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QCborValueRef* QCborValue_OperatorSubscript5(QCborValue* self, struct miqt_string key) {
|
|
|
|
QString key_QString = QString::fromUtf8(key.data, key.len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QCborValueRef(self->operator[](key_QString));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QCborValue_Compare(const QCborValue* self, QCborValue* other) {
|
|
|
|
return self->compare(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValue_OperatorEqual(const QCborValue* self, QCborValue* other) {
|
|
|
|
return self->operator==(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValue_OperatorNotEqual(const QCborValue* self, QCborValue* other) {
|
|
|
|
return self->operator!=(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValue_OperatorLesser(const QCborValue* self, QCborValue* other) {
|
|
|
|
return self->operator<(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QCborValue* QCborValue_FromVariant(QVariant* variant) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QCborValue(QCborValue::fromVariant(*variant));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QVariant* QCborValue_ToVariant(const QCborValue* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVariant(self->toVariant());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QCborValue* QCborValue_FromJsonValue(QJsonValue* v) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QCborValue(QCborValue::fromJsonValue(*v));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QJsonValue* QCborValue_ToJsonValue(const QCborValue* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QJsonValue(self->toJsonValue());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QCborValue* QCborValue_FromCbor(QCborStreamReader* reader) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QCborValue(QCborValue::fromCbor(*reader));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QCborValue* QCborValue_FromCborWithBa(struct miqt_string ba) {
|
|
|
|
QByteArray ba_QByteArray(ba.data, ba.len);
|
|
|
|
return new QCborValue(QCborValue::fromCbor(ba_QByteArray));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-11 05:43:04 +00:00
|
|
|
QCborValue* QCborValue_FromCbor2(const char* data, ptrdiff_t lenVal) {
|
|
|
|
return new QCborValue(QCborValue::fromCbor(data, (qsizetype)(lenVal)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-11 05:43:04 +00:00
|
|
|
QCborValue* QCborValue_FromCbor3(const unsigned char* data, ptrdiff_t lenVal) {
|
|
|
|
return new QCborValue(QCborValue::fromCbor(static_cast<const quint8*>(data), (qsizetype)(lenVal)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QCborValue_ToCbor(QCborValue* self) {
|
|
|
|
QByteArray _qb = self->toCbor();
|
|
|
|
struct miqt_string _ms;
|
|
|
|
_ms.len = _qb.length();
|
|
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
|
|
memcpy(_ms.data, _qb.data(), _ms.len);
|
|
|
|
return _ms;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QCborValue_ToCborWithWriter(QCborValue* self, QCborStreamWriter* writer) {
|
|
|
|
self->toCbor(*writer);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QCborValue_ToDiagnosticNotation(const QCborValue* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->toDiagnosticNotation();
|
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();
|
2024-10-18 23:53:33 +00:00
|
|
|
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-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
uint8_t QCborValue_ToSimpleType1(const QCborValue* self, uint8_t defaultValue) {
|
|
|
|
QCborSimpleType _ret = self->toSimpleType(static_cast<QCborSimpleType>(defaultValue));
|
|
|
|
return static_cast<uint8_t>(_ret);
|
2024-09-16 07:04:28 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
long long QCborValue_ToInteger1(const QCborValue* self, long long defaultValue) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qint64 _ret = self->toInteger(static_cast<qint64>(defaultValue));
|
|
|
|
return static_cast<long long>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValue_ToBool1(const QCborValue* self, bool defaultValue) {
|
|
|
|
return self->toBool(defaultValue);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QCborValue_ToDouble1(const QCborValue* self, double defaultValue) {
|
|
|
|
return self->toDouble(static_cast<double>(defaultValue));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
uint64_t QCborValue_Tag1(const QCborValue* self, uint64_t defaultValue) {
|
|
|
|
QCborTag _ret = self->tag(static_cast<QCborTag>(defaultValue));
|
|
|
|
return static_cast<uint64_t>(_ret);
|
2024-09-16 07:04:28 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QCborValue* QCborValue_TaggedValue1(const QCborValue* self, QCborValue* defaultValue) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QCborValue(self->taggedValue(*defaultValue));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QCborValue_ToByteArray1(const QCborValue* self, struct miqt_string defaultValue) {
|
|
|
|
QByteArray defaultValue_QByteArray(defaultValue.data, defaultValue.len);
|
|
|
|
QByteArray _qb = self->toByteArray(defaultValue_QByteArray);
|
|
|
|
struct miqt_string _ms;
|
|
|
|
_ms.len = _qb.length();
|
|
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
|
|
memcpy(_ms.data, _qb.data(), _ms.len);
|
|
|
|
return _ms;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QCborValue_ToString1(const QCborValue* self, struct miqt_string defaultValue) {
|
|
|
|
QString defaultValue_QString = QString::fromUtf8(defaultValue.data, defaultValue.len);
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->toString(defaultValue_QString);
|
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();
|
2024-10-18 23:53:33 +00:00
|
|
|
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-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QDateTime* QCborValue_ToDateTime1(const QCborValue* self, QDateTime* defaultValue) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QDateTime(self->toDateTime(*defaultValue));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QUrl* QCborValue_ToUrl1(const QCborValue* self, QUrl* defaultValue) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QUrl(self->toUrl(*defaultValue));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QRegularExpression* QCborValue_ToRegularExpression1(const QCborValue* self, QRegularExpression* defaultValue) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QRegularExpression(self->toRegularExpression(*defaultValue));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QUuid* QCborValue_ToUuid1(const QCborValue* self, QUuid* defaultValue) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QUuid(self->toUuid(*defaultValue));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QCborValue* QCborValue_FromCbor22(struct miqt_string ba, QCborParserError* error) {
|
|
|
|
QByteArray ba_QByteArray(ba.data, ba.len);
|
|
|
|
return new QCborValue(QCborValue::fromCbor(ba_QByteArray, error));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-11 05:43:04 +00:00
|
|
|
QCborValue* QCborValue_FromCbor32(const char* data, ptrdiff_t lenVal, QCborParserError* error) {
|
|
|
|
return new QCborValue(QCborValue::fromCbor(data, (qsizetype)(lenVal), error));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-11 05:43:04 +00:00
|
|
|
QCborValue* QCborValue_FromCbor33(const unsigned char* data, ptrdiff_t lenVal, QCborParserError* error) {
|
|
|
|
return new QCborValue(QCborValue::fromCbor(static_cast<const quint8*>(data), (qsizetype)(lenVal), error));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QCborValue_ToCbor1(QCborValue* self, int opt) {
|
|
|
|
QByteArray _qb = self->toCbor(static_cast<QCborValue::EncodingOptions>(opt));
|
|
|
|
struct miqt_string _ms;
|
|
|
|
_ms.len = _qb.length();
|
|
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
|
|
memcpy(_ms.data, _qb.data(), _ms.len);
|
|
|
|
return _ms;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QCborValue_ToCbor2(QCborValue* self, QCborStreamWriter* writer, int opt) {
|
|
|
|
self->toCbor(*writer, static_cast<QCborValue::EncodingOptions>(opt));
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QCborValue_ToDiagnosticNotation1(const QCborValue* self, int opts) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->toDiagnosticNotation(static_cast<QCborValue::DiagnosticNotationOptions>(opts));
|
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();
|
2024-10-18 23:53:33 +00:00
|
|
|
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-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCborValue_Delete(QCborValue* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QCborValue*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCborValueRef_new(QCborValueRef* param1, QCborValueRef** outptr_QCborValueRef) {
|
|
|
|
QCborValueRef* ret = new QCborValueRef(*param1);
|
|
|
|
*outptr_QCborValueRef = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QCborValueRef_OperatorAssign(QCborValueRef* self, QCborValue* other) {
|
|
|
|
self->operator=(*other);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QCborValueRef_OperatorAssignWithOther(QCborValueRef* self, QCborValueRef* other) {
|
|
|
|
self->operator=(*other);
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
int QCborValueRef_Type(const QCborValueRef* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QCborValue::Type _ret = self->type();
|
2024-09-18 00:12:02 +00:00
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValueRef_IsInteger(const QCborValueRef* self) {
|
|
|
|
return self->isInteger();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValueRef_IsByteArray(const QCborValueRef* self) {
|
|
|
|
return self->isByteArray();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValueRef_IsString(const QCborValueRef* self) {
|
|
|
|
return self->isString();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValueRef_IsArray(const QCborValueRef* self) {
|
|
|
|
return self->isArray();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValueRef_IsMap(const QCborValueRef* self) {
|
|
|
|
return self->isMap();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValueRef_IsTag(const QCborValueRef* self) {
|
|
|
|
return self->isTag();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValueRef_IsFalse(const QCborValueRef* self) {
|
|
|
|
return self->isFalse();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValueRef_IsTrue(const QCborValueRef* self) {
|
|
|
|
return self->isTrue();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValueRef_IsBool(const QCborValueRef* self) {
|
|
|
|
return self->isBool();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValueRef_IsNull(const QCborValueRef* self) {
|
|
|
|
return self->isNull();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValueRef_IsUndefined(const QCborValueRef* self) {
|
|
|
|
return self->isUndefined();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValueRef_IsDouble(const QCborValueRef* self) {
|
|
|
|
return self->isDouble();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValueRef_IsDateTime(const QCborValueRef* self) {
|
|
|
|
return self->isDateTime();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValueRef_IsUrl(const QCborValueRef* self) {
|
|
|
|
return self->isUrl();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValueRef_IsRegularExpression(const QCborValueRef* self) {
|
|
|
|
return self->isRegularExpression();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValueRef_IsUuid(const QCborValueRef* self) {
|
|
|
|
return self->isUuid();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValueRef_IsInvalid(const QCborValueRef* self) {
|
|
|
|
return self->isInvalid();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValueRef_IsContainer(const QCborValueRef* self) {
|
|
|
|
return self->isContainer();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValueRef_IsSimpleType(const QCborValueRef* self) {
|
|
|
|
return self->isSimpleType();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
bool QCborValueRef_IsSimpleTypeWithSt(const QCborValueRef* self, uint8_t st) {
|
|
|
|
return self->isSimpleType(static_cast<QCborSimpleType>(st));
|
2024-09-16 07:04:28 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
uint64_t QCborValueRef_Tag(const QCborValueRef* self) {
|
|
|
|
QCborTag _ret = self->tag();
|
|
|
|
return static_cast<uint64_t>(_ret);
|
2024-09-16 07:04:28 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QCborValue* QCborValueRef_TaggedValue(const QCborValueRef* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QCborValue(self->taggedValue());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
long long QCborValueRef_ToInteger(const QCborValueRef* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qint64 _ret = self->toInteger();
|
|
|
|
return static_cast<long long>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValueRef_ToBool(const QCborValueRef* self) {
|
|
|
|
return self->toBool();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QCborValueRef_ToDouble(const QCborValueRef* self) {
|
|
|
|
return self->toDouble();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QCborValueRef_ToByteArray(const QCborValueRef* self) {
|
|
|
|
QByteArray _qb = self->toByteArray();
|
|
|
|
struct miqt_string _ms;
|
|
|
|
_ms.len = _qb.length();
|
|
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
|
|
memcpy(_ms.data, _qb.data(), _ms.len);
|
|
|
|
return _ms;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QCborValueRef_ToString(const QCborValueRef* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->toString();
|
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();
|
2024-10-18 23:53:33 +00:00
|
|
|
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-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QDateTime* QCborValueRef_ToDateTime(const QCborValueRef* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QDateTime(self->toDateTime());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QUrl* QCborValueRef_ToUrl(const QCborValueRef* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QUrl(self->toUrl());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QRegularExpression* QCborValueRef_ToRegularExpression(const QCborValueRef* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QRegularExpression(self->toRegularExpression());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QUuid* QCborValueRef_ToUuid(const QCborValueRef* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QUuid(self->toUuid());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QCborArray* QCborValueRef_ToArray(const QCborValueRef* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QCborArray(self->toArray());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QCborArray* QCborValueRef_ToArrayWithQCborArray(const QCborValueRef* self, QCborArray* a) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QCborArray(self->toArray(*a));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QCborMap* QCborValueRef_ToMap(const QCborValueRef* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QCborMap(self->toMap());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QCborMap* QCborValueRef_ToMapWithQCborMap(const QCborValueRef* self, QCborMap* m) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QCborMap(self->toMap(*m));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QCborValue* QCborValueRef_OperatorSubscript(const QCborValueRef* self, struct miqt_string key) {
|
|
|
|
QString key_QString = QString::fromUtf8(key.data, key.len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QCborValue(self->operator[](key_QString));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QCborValue* QCborValueRef_OperatorSubscript2(const QCborValueRef* self, long long key) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QCborValue(self->operator[](static_cast<qint64>(key)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
QCborValueRef* QCborValueRef_OperatorSubscript3(QCborValueRef* self, long long key) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QCborValueRef(self->operator[](static_cast<qint64>(key)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QCborValueRef* QCborValueRef_OperatorSubscript5(QCborValueRef* self, struct miqt_string key) {
|
|
|
|
QString key_QString = QString::fromUtf8(key.data, key.len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QCborValueRef(self->operator[](key_QString));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QCborValueRef_Compare(const QCborValueRef* self, QCborValue* other) {
|
|
|
|
return self->compare(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValueRef_OperatorEqual(const QCborValueRef* self, QCborValue* other) {
|
|
|
|
return self->operator==(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValueRef_OperatorNotEqual(const QCborValueRef* self, QCborValue* other) {
|
|
|
|
return self->operator!=(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValueRef_OperatorLesser(const QCborValueRef* self, QCborValue* other) {
|
|
|
|
return self->operator<(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QVariant* QCborValueRef_ToVariant(const QCborValueRef* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVariant(self->toVariant());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QJsonValue* QCborValueRef_ToJsonValue(const QCborValueRef* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QJsonValue(self->toJsonValue());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QCborValueRef_ToCbor(QCborValueRef* self) {
|
|
|
|
QByteArray _qb = self->toCbor();
|
|
|
|
struct miqt_string _ms;
|
|
|
|
_ms.len = _qb.length();
|
|
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
|
|
memcpy(_ms.data, _qb.data(), _ms.len);
|
|
|
|
return _ms;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QCborValueRef_ToCborWithWriter(QCborValueRef* self, QCborStreamWriter* writer) {
|
|
|
|
self->toCbor(*writer);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QCborValueRef_ToDiagnosticNotation(QCborValueRef* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->toDiagnosticNotation();
|
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();
|
2024-10-18 23:53:33 +00:00
|
|
|
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-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
uint64_t QCborValueRef_Tag1(const QCborValueRef* self, uint64_t defaultValue) {
|
|
|
|
QCborTag _ret = self->tag(static_cast<QCborTag>(defaultValue));
|
|
|
|
return static_cast<uint64_t>(_ret);
|
2024-09-16 07:04:28 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QCborValue* QCborValueRef_TaggedValue1(const QCborValueRef* self, QCborValue* defaultValue) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QCborValue(self->taggedValue(*defaultValue));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
long long QCborValueRef_ToInteger1(const QCborValueRef* self, long long defaultValue) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qint64 _ret = self->toInteger(static_cast<qint64>(defaultValue));
|
|
|
|
return static_cast<long long>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborValueRef_ToBool1(const QCborValueRef* self, bool defaultValue) {
|
|
|
|
return self->toBool(defaultValue);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QCborValueRef_ToDouble1(const QCborValueRef* self, double defaultValue) {
|
|
|
|
return self->toDouble(static_cast<double>(defaultValue));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QCborValueRef_ToByteArray1(const QCborValueRef* self, struct miqt_string defaultValue) {
|
|
|
|
QByteArray defaultValue_QByteArray(defaultValue.data, defaultValue.len);
|
|
|
|
QByteArray _qb = self->toByteArray(defaultValue_QByteArray);
|
|
|
|
struct miqt_string _ms;
|
|
|
|
_ms.len = _qb.length();
|
|
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
|
|
memcpy(_ms.data, _qb.data(), _ms.len);
|
|
|
|
return _ms;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QCborValueRef_ToString1(const QCborValueRef* self, struct miqt_string defaultValue) {
|
|
|
|
QString defaultValue_QString = QString::fromUtf8(defaultValue.data, defaultValue.len);
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->toString(defaultValue_QString);
|
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();
|
2024-10-18 23:53:33 +00:00
|
|
|
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-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QDateTime* QCborValueRef_ToDateTime1(const QCborValueRef* self, QDateTime* defaultValue) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QDateTime(self->toDateTime(*defaultValue));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QUrl* QCborValueRef_ToUrl1(const QCborValueRef* self, QUrl* defaultValue) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QUrl(self->toUrl(*defaultValue));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QRegularExpression* QCborValueRef_ToRegularExpression1(const QCborValueRef* self, QRegularExpression* defaultValue) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QRegularExpression(self->toRegularExpression(*defaultValue));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QUuid* QCborValueRef_ToUuid1(const QCborValueRef* self, QUuid* defaultValue) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QUuid(self->toUuid(*defaultValue));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QCborValueRef_ToCbor1(QCborValueRef* self, int opt) {
|
|
|
|
QByteArray _qb = self->toCbor(static_cast<QCborValue::EncodingOptions>(opt));
|
|
|
|
struct miqt_string _ms;
|
|
|
|
_ms.len = _qb.length();
|
|
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
|
|
memcpy(_ms.data, _qb.data(), _ms.len);
|
|
|
|
return _ms;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QCborValueRef_ToCbor2(QCborValueRef* self, QCborStreamWriter* writer, int opt) {
|
|
|
|
self->toCbor(*writer, static_cast<QCborValue::EncodingOptions>(opt));
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QCborValueRef_ToDiagnosticNotation1(QCborValueRef* self, int opt) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->toDiagnosticNotation(static_cast<QCborValue::DiagnosticNotationOptions>(opt));
|
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();
|
2024-10-18 23:53:33 +00:00
|
|
|
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-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCborValueRef_Delete(QCborValueRef* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QCborValueRef*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|