2024-08-25 04:08:24 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <QCborError>
|
|
|
|
#include <QCborStreamReader>
|
|
|
|
#include <QIODevice>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "qcborstreamreader.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qcborstreamreader.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
extern void miqt_exec_callback(void* cb, int argc, void* argv);
|
|
|
|
}
|
|
|
|
|
|
|
|
QCborStreamReader* QCborStreamReader_new() {
|
|
|
|
return new QCborStreamReader();
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
QCborStreamReader* QCborStreamReader_new2(const char* data, size_t lenVal) {
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QCborStreamReader(data, static_cast<qsizetype>(lenVal));
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
QCborStreamReader* QCborStreamReader_new3(const unsigned char* data, size_t lenVal) {
|
|
|
|
return new QCborStreamReader(static_cast<const quint8*>(data), static_cast<qsizetype>(lenVal));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QCborStreamReader* QCborStreamReader_new4(QByteArray* data) {
|
|
|
|
return new QCborStreamReader(*data);
|
|
|
|
}
|
|
|
|
|
|
|
|
QCborStreamReader* QCborStreamReader_new5(QIODevice* device) {
|
|
|
|
return new QCborStreamReader(device);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QCborStreamReader_SetDevice(QCborStreamReader* self, QIODevice* device) {
|
|
|
|
self->setDevice(device);
|
|
|
|
}
|
|
|
|
|
|
|
|
QIODevice* QCborStreamReader_Device(QCborStreamReader* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QCborStreamReader*>(self)->device();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QCborStreamReader_AddData(QCborStreamReader* self, QByteArray* data) {
|
|
|
|
self->addData(*data);
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QCborStreamReader_AddData2(QCborStreamReader* self, const char* data, size_t lenVal) {
|
2024-08-25 04:08:24 +00:00
|
|
|
self->addData(data, static_cast<qsizetype>(lenVal));
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QCborStreamReader_AddData3(QCborStreamReader* self, const unsigned char* data, size_t lenVal) {
|
|
|
|
self->addData(static_cast<const quint8*>(data), static_cast<qsizetype>(lenVal));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QCborStreamReader_Reparse(QCborStreamReader* self) {
|
|
|
|
self->reparse();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QCborStreamReader_Clear(QCborStreamReader* self) {
|
|
|
|
self->clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QCborStreamReader_Reset(QCborStreamReader* self) {
|
|
|
|
self->reset();
|
|
|
|
}
|
|
|
|
|
|
|
|
QCborError* QCborStreamReader_LastError(QCborStreamReader* self) {
|
|
|
|
QCborError ret = self->lastError();
|
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QCborError*>(new QCborError(ret));
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
long long QCborStreamReader_CurrentOffset(QCborStreamReader* self) {
|
|
|
|
return const_cast<const QCborStreamReader*>(self)->currentOffset();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QCborStreamReader_IsValid(QCborStreamReader* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QCborStreamReader*>(self)->isValid();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int QCborStreamReader_ContainerDepth(QCborStreamReader* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QCborStreamReader*>(self)->containerDepth();
|
|
|
|
}
|
|
|
|
|
|
|
|
uintptr_t QCborStreamReader_ParentContainerType(QCborStreamReader* self) {
|
|
|
|
QCborStreamReader::Type ret = const_cast<const QCborStreamReader*>(self)->parentContainerType();
|
|
|
|
return static_cast<uintptr_t>(ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QCborStreamReader_HasNext(QCborStreamReader* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QCborStreamReader*>(self)->hasNext();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QCborStreamReader_Next(QCborStreamReader* self) {
|
|
|
|
return self->next();
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
uintptr_t QCborStreamReader_Type(QCborStreamReader* self) {
|
|
|
|
QCborStreamReader::Type ret = const_cast<const QCborStreamReader*>(self)->type();
|
|
|
|
return static_cast<uintptr_t>(ret);
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
bool QCborStreamReader_IsUnsignedInteger(QCborStreamReader* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QCborStreamReader*>(self)->isUnsignedInteger();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QCborStreamReader_IsNegativeInteger(QCborStreamReader* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QCborStreamReader*>(self)->isNegativeInteger();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QCborStreamReader_IsInteger(QCborStreamReader* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QCborStreamReader*>(self)->isInteger();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QCborStreamReader_IsByteArray(QCborStreamReader* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QCborStreamReader*>(self)->isByteArray();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QCborStreamReader_IsString(QCborStreamReader* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QCborStreamReader*>(self)->isString();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QCborStreamReader_IsArray(QCborStreamReader* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QCborStreamReader*>(self)->isArray();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QCborStreamReader_IsMap(QCborStreamReader* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QCborStreamReader*>(self)->isMap();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QCborStreamReader_IsTag(QCborStreamReader* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QCborStreamReader*>(self)->isTag();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QCborStreamReader_IsSimpleType(QCborStreamReader* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QCborStreamReader*>(self)->isSimpleType();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QCborStreamReader_IsFloat16(QCborStreamReader* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QCborStreamReader*>(self)->isFloat16();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QCborStreamReader_IsFloat(QCborStreamReader* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QCborStreamReader*>(self)->isFloat();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QCborStreamReader_IsDouble(QCborStreamReader* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QCborStreamReader*>(self)->isDouble();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QCborStreamReader_IsInvalid(QCborStreamReader* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QCborStreamReader*>(self)->isInvalid();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QCborStreamReader_IsFalse(QCborStreamReader* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QCborStreamReader*>(self)->isFalse();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QCborStreamReader_IsTrue(QCborStreamReader* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QCborStreamReader*>(self)->isTrue();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QCborStreamReader_IsBool(QCborStreamReader* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QCborStreamReader*>(self)->isBool();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QCborStreamReader_IsNull(QCborStreamReader* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QCborStreamReader*>(self)->isNull();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QCborStreamReader_IsUndefined(QCborStreamReader* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QCborStreamReader*>(self)->isUndefined();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QCborStreamReader_IsLengthKnown(QCborStreamReader* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QCborStreamReader*>(self)->isLengthKnown();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
unsigned long long QCborStreamReader_Length(QCborStreamReader* self) {
|
|
|
|
return const_cast<const QCborStreamReader*>(self)->length();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QCborStreamReader_IsContainer(QCborStreamReader* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QCborStreamReader*>(self)->isContainer();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QCborStreamReader_EnterContainer(QCborStreamReader* self) {
|
|
|
|
return self->enterContainer();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QCborStreamReader_LeaveContainer(QCborStreamReader* self) {
|
|
|
|
return self->leaveContainer();
|
|
|
|
}
|
|
|
|
|
|
|
|
size_t QCborStreamReader_CurrentStringChunkSize(QCborStreamReader* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QCborStreamReader*>(self)->currentStringChunkSize();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QCborStreamReader_ToBool(QCborStreamReader* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QCborStreamReader*>(self)->toBool();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
unsigned long long QCborStreamReader_ToUnsignedInteger(QCborStreamReader* self) {
|
|
|
|
return const_cast<const QCborStreamReader*>(self)->toUnsignedInteger();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
float QCborStreamReader_ToFloat(QCborStreamReader* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QCborStreamReader*>(self)->toFloat();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
double QCborStreamReader_ToDouble(QCborStreamReader* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QCborStreamReader*>(self)->toDouble();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
long long QCborStreamReader_ToInteger(QCborStreamReader* self) {
|
|
|
|
return const_cast<const QCborStreamReader*>(self)->toInteger();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QCborStreamReader_Next1(QCborStreamReader* self, int maxRecursion) {
|
|
|
|
return self->next(static_cast<int>(maxRecursion));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QCborStreamReader_Delete(QCborStreamReader* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|