2024-08-25 04:08:24 +00:00
|
|
|
#include <QBitArray>
|
|
|
|
#include <QBitRef>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "qbitarray.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qbitarray.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
extern void miqt_exec_callback(void* cb, int argc, void* argv);
|
|
|
|
}
|
|
|
|
|
|
|
|
QBitArray* QBitArray_new() {
|
|
|
|
return new QBitArray();
|
|
|
|
}
|
|
|
|
|
|
|
|
QBitArray* QBitArray_new2(int size) {
|
|
|
|
return new QBitArray(static_cast<int>(size));
|
|
|
|
}
|
|
|
|
|
|
|
|
QBitArray* QBitArray_new3(QBitArray* other) {
|
|
|
|
return new QBitArray(*other);
|
|
|
|
}
|
|
|
|
|
|
|
|
QBitArray* QBitArray_new4(int size, bool val) {
|
|
|
|
return new QBitArray(static_cast<int>(size), val);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QBitArray_OperatorAssign(QBitArray* self, QBitArray* other) {
|
|
|
|
self->operator=(*other);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QBitArray_Swap(QBitArray* self, QBitArray* other) {
|
|
|
|
self->swap(*other);
|
|
|
|
}
|
|
|
|
|
|
|
|
int QBitArray_Size(QBitArray* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QBitArray*>(self)->size();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int QBitArray_Count(QBitArray* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QBitArray*>(self)->count();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int QBitArray_CountWithOn(QBitArray* self, bool on) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QBitArray*>(self)->count(on);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QBitArray_IsEmpty(QBitArray* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QBitArray*>(self)->isEmpty();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QBitArray_IsNull(QBitArray* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QBitArray*>(self)->isNull();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QBitArray_Resize(QBitArray* self, int size) {
|
|
|
|
self->resize(static_cast<int>(size));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QBitArray_Detach(QBitArray* self) {
|
|
|
|
self->detach();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QBitArray_IsDetached(QBitArray* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QBitArray*>(self)->isDetached();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QBitArray_Clear(QBitArray* self) {
|
|
|
|
self->clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QBitArray_TestBit(QBitArray* self, int i) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QBitArray*>(self)->testBit(static_cast<int>(i));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QBitArray_SetBit(QBitArray* self, int i) {
|
|
|
|
self->setBit(static_cast<int>(i));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QBitArray_SetBit2(QBitArray* self, int i, bool val) {
|
|
|
|
self->setBit(static_cast<int>(i), val);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QBitArray_ClearBit(QBitArray* self, int i) {
|
|
|
|
self->clearBit(static_cast<int>(i));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QBitArray_ToggleBit(QBitArray* self, int i) {
|
|
|
|
return self->toggleBit(static_cast<int>(i));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QBitArray_At(QBitArray* self, int i) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QBitArray*>(self)->at(static_cast<int>(i));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QBitRef* QBitArray_OperatorSubscript(QBitArray* self, int i) {
|
|
|
|
QBitRef ret = self->operator[](static_cast<int>(i));
|
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QBitRef*>(new QBitRef(ret));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QBitArray_OperatorSubscriptWithInt(QBitArray* self, int i) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QBitArray*>(self)->operator[](static_cast<int>(i));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QBitRef* QBitArray_OperatorSubscriptWithUint(QBitArray* self, unsigned int i) {
|
|
|
|
QBitRef ret = self->operator[](static_cast<uint>(i));
|
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QBitRef*>(new QBitRef(ret));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QBitArray_OperatorSubscript2(QBitArray* self, unsigned int i) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QBitArray*>(self)->operator[](static_cast<uint>(i));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QBitArray_OperatorBitwiseAndAssign(QBitArray* self, QBitArray* param1) {
|
|
|
|
self->operator&=(*param1);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QBitArray_OperatorBitwiseOrAssign(QBitArray* self, QBitArray* param1) {
|
|
|
|
self->operator|=(*param1);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QBitArray_OperatorBitwiseNotAssign(QBitArray* self, QBitArray* param1) {
|
|
|
|
self->operator^=(*param1);
|
|
|
|
}
|
|
|
|
|
|
|
|
QBitArray* QBitArray_OperatorBitwiseXor(QBitArray* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QBitArray ret = const_cast<const QBitArray*>(self)->operator~();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QBitArray*>(new QBitArray(ret));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QBitArray_OperatorEqual(QBitArray* self, QBitArray* other) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QBitArray*>(self)->operator==(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QBitArray_OperatorNotEqual(QBitArray* self, QBitArray* other) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QBitArray*>(self)->operator!=(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QBitArray_Fill(QBitArray* self, bool val) {
|
|
|
|
return self->fill(val);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QBitArray_Fill2(QBitArray* self, bool val, int first, int last) {
|
|
|
|
self->fill(val, static_cast<int>(first), static_cast<int>(last));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QBitArray_Truncate(QBitArray* self, int pos) {
|
|
|
|
self->truncate(static_cast<int>(pos));
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
const char* QBitArray_Bits(QBitArray* self) {
|
|
|
|
return (const char*) const_cast<const QBitArray*>(self)->bits();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
QBitArray* QBitArray_FromBits(const char* data, size_t lenVal) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QBitArray ret = QBitArray::fromBits(data, static_cast<qsizetype>(lenVal));
|
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QBitArray*>(new QBitArray(ret));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QBitArray_Fill22(QBitArray* self, bool val, int size) {
|
|
|
|
return self->fill(val, static_cast<int>(size));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QBitArray_Delete(QBitArray* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|
|
|
|
QBitRef* QBitRef_new(QBitRef* param1) {
|
|
|
|
return new QBitRef(*param1);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QBitRef_OperatorNot(QBitRef* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QBitRef*>(self)->operator!();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QBitRef_OperatorAssign(QBitRef* self, QBitRef* val) {
|
|
|
|
self->operator=(*val);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QBitRef_OperatorAssignWithVal(QBitRef* self, bool val) {
|
|
|
|
self->operator=(val);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QBitRef_Delete(QBitRef* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|