2024-08-25 04:08:24 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <QByteArrayMatcher>
|
|
|
|
#include <QStaticByteArrayMatcherBase>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qbytearraymatcher.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qbytearraymatcher.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
|
|
|
QByteArrayMatcher* QByteArrayMatcher_new() {
|
|
|
|
return new QByteArrayMatcher();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QByteArrayMatcher* QByteArrayMatcher_new2(struct miqt_string pattern) {
|
2024-10-18 23:53:33 +00:00
|
|
|
QByteArray pattern_QByteArray(pattern.data, pattern.len);
|
2024-12-07 04:15:57 +00:00
|
|
|
return new QByteArrayMatcher(pattern_QByteArray);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QByteArrayMatcher* QByteArrayMatcher_new3(const char* pattern, int length) {
|
|
|
|
return new QByteArrayMatcher(pattern, static_cast<int>(length));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QByteArrayMatcher* QByteArrayMatcher_new4(QByteArrayMatcher* other) {
|
|
|
|
return new QByteArrayMatcher(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QByteArrayMatcher_OperatorAssign(QByteArrayMatcher* self, QByteArrayMatcher* other) {
|
|
|
|
self->operator=(*other);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
void QByteArrayMatcher_SetPattern(QByteArrayMatcher* self, struct miqt_string pattern) {
|
|
|
|
QByteArray pattern_QByteArray(pattern.data, pattern.len);
|
|
|
|
self->setPattern(pattern_QByteArray);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
int QByteArrayMatcher_IndexIn(const QByteArrayMatcher* self, struct miqt_string ba) {
|
|
|
|
QByteArray ba_QByteArray(ba.data, ba.len);
|
|
|
|
return self->indexIn(ba_QByteArray);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QByteArrayMatcher_IndexIn2(const QByteArrayMatcher* self, const char* str, int lenVal) {
|
|
|
|
return self->indexIn(str, static_cast<int>(lenVal));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QByteArrayMatcher_Pattern(const QByteArrayMatcher* self) {
|
|
|
|
QByteArray _qb = self->pattern();
|
|
|
|
struct miqt_string _ms;
|
|
|
|
_ms.len = _qb.length();
|
|
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
|
|
memcpy(_ms.data, _qb.data(), _ms.len);
|
|
|
|
return _ms;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
int QByteArrayMatcher_IndexIn22(const QByteArrayMatcher* self, struct miqt_string ba, int from) {
|
|
|
|
QByteArray ba_QByteArray(ba.data, ba.len);
|
|
|
|
return self->indexIn(ba_QByteArray, static_cast<int>(from));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QByteArrayMatcher_IndexIn3(const QByteArrayMatcher* self, const char* str, int lenVal, int from) {
|
|
|
|
return self->indexIn(str, static_cast<int>(lenVal), static_cast<int>(from));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QByteArrayMatcher_Delete(QByteArrayMatcher* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QByteArrayMatcher*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QStaticByteArrayMatcherBase_Delete(QStaticByteArrayMatcherBase* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QStaticByteArrayMatcherBase*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|