2024-10-20 05:21:03 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <QByteArrayMatcher>
|
|
|
|
#include <QByteArrayView>
|
|
|
|
#include <QStaticByteArrayMatcherBase>
|
|
|
|
#include <qbytearraymatcher.h>
|
|
|
|
#include "gen_qbytearraymatcher.h"
|
|
|
|
#include "_cgo_export.h"
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QByteArrayMatcher* QByteArrayMatcher_new() {
|
|
|
|
return new QByteArrayMatcher();
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QByteArrayMatcher* QByteArrayMatcher_new2(struct miqt_string pattern) {
|
2024-10-20 05:21:03 +00:00
|
|
|
QByteArray pattern_QByteArray(pattern.data, pattern.len);
|
2024-12-07 04:15:57 +00:00
|
|
|
return new QByteArrayMatcher(pattern_QByteArray);
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QByteArrayMatcher* QByteArrayMatcher_new3(QByteArrayView* pattern) {
|
|
|
|
return new QByteArrayMatcher(*pattern);
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QByteArrayMatcher* QByteArrayMatcher_new4(const char* pattern) {
|
|
|
|
return new QByteArrayMatcher(pattern);
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QByteArrayMatcher* QByteArrayMatcher_new5(QByteArrayMatcher* other) {
|
|
|
|
return new QByteArrayMatcher(*other);
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QByteArrayMatcher* QByteArrayMatcher_new6(const char* pattern, ptrdiff_t length) {
|
|
|
|
return new QByteArrayMatcher(pattern, (qsizetype)(length));
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QByteArrayMatcher_OperatorAssign(QByteArrayMatcher* self, QByteArrayMatcher* other) {
|
|
|
|
self->operator=(*other);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QByteArrayMatcher_SetPattern(QByteArrayMatcher* self, struct miqt_string pattern) {
|
|
|
|
QByteArray pattern_QByteArray(pattern.data, pattern.len);
|
|
|
|
self->setPattern(pattern_QByteArray);
|
|
|
|
}
|
|
|
|
|
|
|
|
ptrdiff_t QByteArrayMatcher_IndexIn(const QByteArrayMatcher* self, const char* str, ptrdiff_t lenVal) {
|
|
|
|
qsizetype _ret = self->indexIn(str, (qsizetype)(lenVal));
|
|
|
|
return static_cast<ptrdiff_t>(_ret);
|
|
|
|
}
|
|
|
|
|
|
|
|
ptrdiff_t QByteArrayMatcher_IndexInWithData(const QByteArrayMatcher* self, QByteArrayView* data) {
|
|
|
|
qsizetype _ret = self->indexIn(*data);
|
|
|
|
return static_cast<ptrdiff_t>(_ret);
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
ptrdiff_t QByteArrayMatcher_IndexIn3(const QByteArrayMatcher* self, const char* str, ptrdiff_t lenVal, ptrdiff_t from) {
|
|
|
|
qsizetype _ret = self->indexIn(str, (qsizetype)(lenVal), (qsizetype)(from));
|
|
|
|
return static_cast<ptrdiff_t>(_ret);
|
|
|
|
}
|
|
|
|
|
|
|
|
ptrdiff_t QByteArrayMatcher_IndexIn2(const QByteArrayMatcher* self, QByteArrayView* data, ptrdiff_t from) {
|
|
|
|
qsizetype _ret = self->indexIn(*data, (qsizetype)(from));
|
|
|
|
return static_cast<ptrdiff_t>(_ret);
|
|
|
|
}
|
|
|
|
|
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-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|