miqt/qt/gen_qcborstreamreader.cpp

225 lines
6.8 KiB
C++
Raw Normal View History

#include <QByteArray>
#include <QCborError>
#include <QCborStreamReader>
#include <QIODevice>
2024-08-29 07:01:51 +00:00
#include "qcborstreamreader.h"
2024-08-29 07:01:51 +00:00
#include "gen_qcborstreamreader.h"
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) {
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));
}
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();
}
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) {
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));
}
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();
}
bool QCborStreamReader_IsValid(QCborStreamReader* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QCborStreamReader*>(self)->isValid();
}
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);
}
bool QCborStreamReader_HasNext(QCborStreamReader* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QCborStreamReader*>(self)->hasNext();
}
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);
}
bool QCborStreamReader_IsUnsignedInteger(QCborStreamReader* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QCborStreamReader*>(self)->isUnsignedInteger();
}
bool QCborStreamReader_IsNegativeInteger(QCborStreamReader* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QCborStreamReader*>(self)->isNegativeInteger();
}
bool QCborStreamReader_IsInteger(QCborStreamReader* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QCborStreamReader*>(self)->isInteger();
}
bool QCborStreamReader_IsByteArray(QCborStreamReader* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QCborStreamReader*>(self)->isByteArray();
}
bool QCborStreamReader_IsString(QCborStreamReader* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QCborStreamReader*>(self)->isString();
}
bool QCborStreamReader_IsArray(QCborStreamReader* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QCborStreamReader*>(self)->isArray();
}
bool QCborStreamReader_IsMap(QCborStreamReader* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QCborStreamReader*>(self)->isMap();
}
bool QCborStreamReader_IsTag(QCborStreamReader* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QCborStreamReader*>(self)->isTag();
}
bool QCborStreamReader_IsSimpleType(QCborStreamReader* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QCborStreamReader*>(self)->isSimpleType();
}
bool QCborStreamReader_IsFloat16(QCborStreamReader* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QCborStreamReader*>(self)->isFloat16();
}
bool QCborStreamReader_IsFloat(QCborStreamReader* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QCborStreamReader*>(self)->isFloat();
}
bool QCborStreamReader_IsDouble(QCborStreamReader* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QCborStreamReader*>(self)->isDouble();
}
bool QCborStreamReader_IsInvalid(QCborStreamReader* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QCborStreamReader*>(self)->isInvalid();
}
bool QCborStreamReader_IsFalse(QCborStreamReader* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QCborStreamReader*>(self)->isFalse();
}
bool QCborStreamReader_IsTrue(QCborStreamReader* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QCborStreamReader*>(self)->isTrue();
}
bool QCborStreamReader_IsBool(QCborStreamReader* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QCborStreamReader*>(self)->isBool();
}
bool QCborStreamReader_IsNull(QCborStreamReader* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QCborStreamReader*>(self)->isNull();
}
bool QCborStreamReader_IsUndefined(QCborStreamReader* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QCborStreamReader*>(self)->isUndefined();
}
bool QCborStreamReader_IsLengthKnown(QCborStreamReader* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QCborStreamReader*>(self)->isLengthKnown();
}
2024-08-29 07:01:51 +00:00
unsigned long long QCborStreamReader_Length(QCborStreamReader* self) {
return const_cast<const QCborStreamReader*>(self)->length();
}
bool QCborStreamReader_IsContainer(QCborStreamReader* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QCborStreamReader*>(self)->isContainer();
}
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();
}
bool QCborStreamReader_ToBool(QCborStreamReader* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QCborStreamReader*>(self)->toBool();
}
2024-08-29 07:01:51 +00:00
unsigned long long QCborStreamReader_ToUnsignedInteger(QCborStreamReader* self) {
return const_cast<const QCborStreamReader*>(self)->toUnsignedInteger();
}
float QCborStreamReader_ToFloat(QCborStreamReader* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QCborStreamReader*>(self)->toFloat();
}
double QCborStreamReader_ToDouble(QCborStreamReader* self) {
2024-08-29 07:01:51 +00:00
return const_cast<const QCborStreamReader*>(self)->toDouble();
}
2024-08-29 07:01:51 +00:00
long long QCborStreamReader_ToInteger(QCborStreamReader* self) {
return const_cast<const QCborStreamReader*>(self)->toInteger();
}
bool QCborStreamReader_Next1(QCborStreamReader* self, int maxRecursion) {
return self->next(static_cast<int>(maxRecursion));
}
void QCborStreamReader_Delete(QCborStreamReader* self) {
delete self;
}