2024-08-29 07:01:51 +00:00
|
|
|
#include <QChar>
|
2024-08-25 04:08:24 +00:00
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
2024-08-25 04:08:24 +00:00
|
|
|
#include <QTextBoundaryFinder>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qtextboundaryfinder.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qtextboundaryfinder.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QTextBoundaryFinder_new(QTextBoundaryFinder** outptr_QTextBoundaryFinder) {
|
|
|
|
QTextBoundaryFinder* ret = new QTextBoundaryFinder();
|
|
|
|
*outptr_QTextBoundaryFinder = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QTextBoundaryFinder_new2(QTextBoundaryFinder* other, QTextBoundaryFinder** outptr_QTextBoundaryFinder) {
|
|
|
|
QTextBoundaryFinder* ret = new QTextBoundaryFinder(*other);
|
|
|
|
*outptr_QTextBoundaryFinder = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QTextBoundaryFinder_new3(int typeVal, struct miqt_string stringVal, QTextBoundaryFinder** outptr_QTextBoundaryFinder) {
|
2024-10-18 23:53:33 +00:00
|
|
|
QString stringVal_QString = QString::fromUtf8(stringVal.data, stringVal.len);
|
2024-11-19 06:29:06 +00:00
|
|
|
QTextBoundaryFinder* ret = new QTextBoundaryFinder(static_cast<QTextBoundaryFinder::BoundaryType>(typeVal), stringVal_QString);
|
|
|
|
*outptr_QTextBoundaryFinder = ret;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QTextBoundaryFinder_new4(int typeVal, QChar* chars, int length, QTextBoundaryFinder** outptr_QTextBoundaryFinder) {
|
|
|
|
QTextBoundaryFinder* ret = new QTextBoundaryFinder(static_cast<QTextBoundaryFinder::BoundaryType>(typeVal), chars, static_cast<int>(length));
|
|
|
|
*outptr_QTextBoundaryFinder = ret;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QTextBoundaryFinder_new5(int typeVal, QChar* chars, int length, unsigned char* buffer, QTextBoundaryFinder** outptr_QTextBoundaryFinder) {
|
|
|
|
QTextBoundaryFinder* ret = new QTextBoundaryFinder(static_cast<QTextBoundaryFinder::BoundaryType>(typeVal), chars, static_cast<int>(length), static_cast<unsigned char*>(buffer));
|
|
|
|
*outptr_QTextBoundaryFinder = ret;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QTextBoundaryFinder_new6(int typeVal, QChar* chars, int length, unsigned char* buffer, int bufferSize, QTextBoundaryFinder** outptr_QTextBoundaryFinder) {
|
|
|
|
QTextBoundaryFinder* ret = new QTextBoundaryFinder(static_cast<QTextBoundaryFinder::BoundaryType>(typeVal), chars, static_cast<int>(length), static_cast<unsigned char*>(buffer), static_cast<int>(bufferSize));
|
|
|
|
*outptr_QTextBoundaryFinder = ret;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QTextBoundaryFinder_OperatorAssign(QTextBoundaryFinder* self, QTextBoundaryFinder* other) {
|
|
|
|
self->operator=(*other);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QTextBoundaryFinder_IsValid(const QTextBoundaryFinder* self) {
|
|
|
|
return self->isValid();
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
int QTextBoundaryFinder_Type(const QTextBoundaryFinder* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QTextBoundaryFinder::BoundaryType _ret = self->type();
|
2024-09-18 00:12:02 +00:00
|
|
|
return static_cast<int>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QTextBoundaryFinder_String(const QTextBoundaryFinder* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->string();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string _ms;
|
|
|
|
_ms.len = _b.length();
|
|
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
|
|
memcpy(_ms.data, _b.data(), _ms.len);
|
|
|
|
return _ms;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QTextBoundaryFinder_ToStart(QTextBoundaryFinder* self) {
|
|
|
|
self->toStart();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QTextBoundaryFinder_ToEnd(QTextBoundaryFinder* self) {
|
|
|
|
self->toEnd();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QTextBoundaryFinder_Position(const QTextBoundaryFinder* self) {
|
|
|
|
return self->position();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QTextBoundaryFinder_SetPosition(QTextBoundaryFinder* self, int position) {
|
|
|
|
self->setPosition(static_cast<int>(position));
|
|
|
|
}
|
|
|
|
|
|
|
|
int QTextBoundaryFinder_ToNextBoundary(QTextBoundaryFinder* self) {
|
|
|
|
return self->toNextBoundary();
|
|
|
|
}
|
|
|
|
|
|
|
|
int QTextBoundaryFinder_ToPreviousBoundary(QTextBoundaryFinder* self) {
|
|
|
|
return self->toPreviousBoundary();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QTextBoundaryFinder_IsAtBoundary(const QTextBoundaryFinder* self) {
|
|
|
|
return self->isAtBoundary();
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QTextBoundaryFinder_BoundaryReasons(const QTextBoundaryFinder* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QTextBoundaryFinder::BoundaryReasons _ret = self->boundaryReasons();
|
|
|
|
return static_cast<int>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QTextBoundaryFinder_Delete(QTextBoundaryFinder* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QTextBoundaryFinder*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|