2024-08-25 04:08:24 +00:00
|
|
|
#include <QBitArray>
|
|
|
|
#include <QBitRef>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qbitarray.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qbitarray.h"
|
2024-12-11 06:55:47 +00:00
|
|
|
|
|
|
|
#ifndef _Bool
|
|
|
|
#define _Bool bool
|
|
|
|
#endif
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QBitArray* QBitArray_new() {
|
|
|
|
return new QBitArray();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QBitArray* QBitArray_new2(int size) {
|
|
|
|
return new QBitArray(static_cast<int>(size));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QBitArray* QBitArray_new3(QBitArray* other) {
|
|
|
|
return new QBitArray(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QBitArray* QBitArray_new4(int size, bool val) {
|
|
|
|
return new QBitArray(static_cast<int>(size), val);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QBitArray_OperatorAssign(QBitArray* self, QBitArray* other) {
|
|
|
|
self->operator=(*other);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QBitArray_Swap(QBitArray* self, QBitArray* other) {
|
|
|
|
self->swap(*other);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QBitArray_Size(const QBitArray* self) {
|
|
|
|
return self->size();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QBitArray_Count(const QBitArray* self) {
|
|
|
|
return self->count();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QBitArray_CountWithOn(const QBitArray* self, bool on) {
|
|
|
|
return self->count(on);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QBitArray_IsEmpty(const QBitArray* self) {
|
|
|
|
return self->isEmpty();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QBitArray_IsNull(const QBitArray* self) {
|
|
|
|
return 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();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QBitArray_IsDetached(const QBitArray* self) {
|
|
|
|
return self->isDetached();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QBitArray_Clear(QBitArray* self) {
|
|
|
|
self->clear();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QBitArray_TestBit(const QBitArray* self, int i) {
|
|
|
|
return 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));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QBitArray_At(const QBitArray* self, int i) {
|
|
|
|
return self->at(static_cast<int>(i));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QBitRef* QBitArray_OperatorSubscript(QBitArray* self, int i) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QBitRef(self->operator[](static_cast<int>(i)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QBitArray_OperatorSubscriptWithInt(const QBitArray* self, int i) {
|
|
|
|
return self->operator[](static_cast<int>(i));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QBitRef* QBitArray_OperatorSubscriptWithUint(QBitArray* self, unsigned int i) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QBitRef(self->operator[](static_cast<uint>(i)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QBitArray_OperatorSubscript2(const QBitArray* self, unsigned int i) {
|
|
|
|
return 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);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QBitArray_OperatorEqual(const QBitArray* self, QBitArray* other) {
|
2024-11-22 06:06:01 +00:00
|
|
|
return (*self == *other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QBitArray_OperatorNotEqual(const QBitArray* self, QBitArray* other) {
|
2024-11-22 06:06:01 +00:00
|
|
|
return (*self != *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-09-11 05:41:09 +00:00
|
|
|
const char* QBitArray_Bits(const QBitArray* self) {
|
|
|
|
return (const char*) self->bits();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-11 05:43:04 +00:00
|
|
|
QBitArray* QBitArray_FromBits(const char* data, ptrdiff_t lenVal) {
|
|
|
|
return new QBitArray(QBitArray::fromBits(data, (qsizetype)(lenVal)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QBitArray_Fill22(QBitArray* self, bool val, int size) {
|
|
|
|
return self->fill(val, static_cast<int>(size));
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QBitArray_Delete(QBitArray* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QBitArray*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QBitRef* QBitRef_new(QBitRef* param1) {
|
|
|
|
return new QBitRef(*param1);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QBitRef_OperatorNot(const QBitRef* self) {
|
|
|
|
return 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);
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QBitRef_Delete(QBitRef* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QBitRef*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|