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"
|
|
|
|
#include "gen_qcborstreamreader.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QIODevice* QCborStreamReader_Device(const QCborStreamReader* self) {
|
|
|
|
return 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) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QCborError _ret = self->lastError();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
2024-09-14 22:29:05 +00:00
|
|
|
return static_cast<QCborError*>(new QCborError(_ret));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
long long QCborStreamReader_CurrentOffset(const QCborStreamReader* self) {
|
|
|
|
return self->currentOffset();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborStreamReader_IsValid(const QCborStreamReader* self) {
|
|
|
|
return self->isValid();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QCborStreamReader_ContainerDepth(const QCborStreamReader* self) {
|
|
|
|
return self->containerDepth();
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
uintptr_t QCborStreamReader_ParentContainerType(const QCborStreamReader* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QCborStreamReader::Type _ret = self->parentContainerType();
|
|
|
|
return static_cast<uintptr_t>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborStreamReader_HasNext(const QCborStreamReader* self) {
|
|
|
|
return self->hasNext();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QCborStreamReader_Next(QCborStreamReader* self) {
|
|
|
|
return self->next();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
uintptr_t QCborStreamReader_Type(const QCborStreamReader* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QCborStreamReader::Type _ret = self->type();
|
|
|
|
return static_cast<uintptr_t>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborStreamReader_IsUnsignedInteger(const QCborStreamReader* self) {
|
|
|
|
return self->isUnsignedInteger();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborStreamReader_IsNegativeInteger(const QCborStreamReader* self) {
|
|
|
|
return self->isNegativeInteger();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborStreamReader_IsInteger(const QCborStreamReader* self) {
|
|
|
|
return self->isInteger();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborStreamReader_IsByteArray(const QCborStreamReader* self) {
|
|
|
|
return self->isByteArray();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborStreamReader_IsString(const QCborStreamReader* self) {
|
|
|
|
return self->isString();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborStreamReader_IsArray(const QCborStreamReader* self) {
|
|
|
|
return self->isArray();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborStreamReader_IsMap(const QCborStreamReader* self) {
|
|
|
|
return self->isMap();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborStreamReader_IsTag(const QCborStreamReader* self) {
|
|
|
|
return self->isTag();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborStreamReader_IsSimpleType(const QCborStreamReader* self) {
|
|
|
|
return self->isSimpleType();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborStreamReader_IsFloat16(const QCborStreamReader* self) {
|
|
|
|
return self->isFloat16();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborStreamReader_IsFloat(const QCborStreamReader* self) {
|
|
|
|
return self->isFloat();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborStreamReader_IsDouble(const QCborStreamReader* self) {
|
|
|
|
return self->isDouble();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborStreamReader_IsInvalid(const QCborStreamReader* self) {
|
|
|
|
return self->isInvalid();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborStreamReader_IsFalse(const QCborStreamReader* self) {
|
|
|
|
return self->isFalse();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborStreamReader_IsTrue(const QCborStreamReader* self) {
|
|
|
|
return self->isTrue();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborStreamReader_IsBool(const QCborStreamReader* self) {
|
|
|
|
return self->isBool();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborStreamReader_IsNull(const QCborStreamReader* self) {
|
|
|
|
return self->isNull();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborStreamReader_IsUndefined(const QCborStreamReader* self) {
|
|
|
|
return self->isUndefined();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborStreamReader_IsLengthKnown(const QCborStreamReader* self) {
|
|
|
|
return self->isLengthKnown();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
unsigned long long QCborStreamReader_Length(const QCborStreamReader* self) {
|
|
|
|
return self->length();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborStreamReader_IsContainer(const QCborStreamReader* self) {
|
|
|
|
return 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();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
size_t QCborStreamReader_CurrentStringChunkSize(const QCborStreamReader* self) {
|
|
|
|
return self->currentStringChunkSize();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCborStreamReader_ToBool(const QCborStreamReader* self) {
|
|
|
|
return self->toBool();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
unsigned long long QCborStreamReader_ToUnsignedInteger(const QCborStreamReader* self) {
|
|
|
|
return self->toUnsignedInteger();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
float QCborStreamReader_ToFloat(const QCborStreamReader* self) {
|
|
|
|
return self->toFloat();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QCborStreamReader_ToDouble(const QCborStreamReader* self) {
|
|
|
|
return self->toDouble();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
long long QCborStreamReader_ToInteger(const QCborStreamReader* self) {
|
|
|
|
return 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;
|
|
|
|
}
|
|
|
|
|