2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qbytearraymatcher.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QByteArrayMatcher struct {
|
|
|
|
h *C.QByteArrayMatcher
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QByteArrayMatcher) cPointer() *C.QByteArrayMatcher {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QByteArrayMatcher) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQByteArrayMatcher(h *C.QByteArrayMatcher) *QByteArrayMatcher {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QByteArrayMatcher{h: h}
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQByteArrayMatcher(h unsafe.Pointer) *QByteArrayMatcher {
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQByteArrayMatcher((*C.QByteArrayMatcher)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQByteArrayMatcher constructs a new QByteArrayMatcher object.
|
|
|
|
func NewQByteArrayMatcher() *QByteArrayMatcher {
|
|
|
|
ret := C.QByteArrayMatcher_new()
|
|
|
|
return newQByteArrayMatcher(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQByteArrayMatcher2 constructs a new QByteArrayMatcher object.
|
2024-10-18 23:53:33 +00:00
|
|
|
func NewQByteArrayMatcher2(pattern []byte) *QByteArrayMatcher {
|
|
|
|
pattern_alias := C.struct_miqt_string{}
|
|
|
|
pattern_alias.data = (*C.char)(unsafe.Pointer(&pattern[0]))
|
|
|
|
pattern_alias.len = C.size_t(len(pattern))
|
|
|
|
ret := C.QByteArrayMatcher_new2(pattern_alias)
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQByteArrayMatcher(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQByteArrayMatcher3 constructs a new QByteArrayMatcher object.
|
|
|
|
func NewQByteArrayMatcher3(pattern string, length int) *QByteArrayMatcher {
|
|
|
|
pattern_Cstring := C.CString(pattern)
|
|
|
|
defer C.free(unsafe.Pointer(pattern_Cstring))
|
|
|
|
ret := C.QByteArrayMatcher_new3(pattern_Cstring, (C.int)(length))
|
|
|
|
return newQByteArrayMatcher(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQByteArrayMatcher4 constructs a new QByteArrayMatcher object.
|
|
|
|
func NewQByteArrayMatcher4(other *QByteArrayMatcher) *QByteArrayMatcher {
|
|
|
|
ret := C.QByteArrayMatcher_new4(other.cPointer())
|
|
|
|
return newQByteArrayMatcher(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QByteArrayMatcher) OperatorAssign(other *QByteArrayMatcher) {
|
|
|
|
C.QByteArrayMatcher_OperatorAssign(this.h, other.cPointer())
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
func (this *QByteArrayMatcher) SetPattern(pattern []byte) {
|
|
|
|
pattern_alias := C.struct_miqt_string{}
|
|
|
|
pattern_alias.data = (*C.char)(unsafe.Pointer(&pattern[0]))
|
|
|
|
pattern_alias.len = C.size_t(len(pattern))
|
|
|
|
C.QByteArrayMatcher_SetPattern(this.h, pattern_alias)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
func (this *QByteArrayMatcher) IndexIn(ba []byte) int {
|
|
|
|
ba_alias := C.struct_miqt_string{}
|
|
|
|
ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0]))
|
|
|
|
ba_alias.len = C.size_t(len(ba))
|
|
|
|
return (int)(C.QByteArrayMatcher_IndexIn(this.h, ba_alias))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QByteArrayMatcher) IndexIn2(str string, lenVal int) int {
|
|
|
|
str_Cstring := C.CString(str)
|
|
|
|
defer C.free(unsafe.Pointer(str_Cstring))
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QByteArrayMatcher_IndexIn2(this.h, str_Cstring, (C.int)(lenVal)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
func (this *QByteArrayMatcher) Pattern() []byte {
|
|
|
|
var _bytearray C.struct_miqt_string = C.QByteArrayMatcher_Pattern(this.h)
|
|
|
|
_ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len)))
|
|
|
|
C.free(unsafe.Pointer(_bytearray.data))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
func (this *QByteArrayMatcher) IndexIn22(ba []byte, from int) int {
|
|
|
|
ba_alias := C.struct_miqt_string{}
|
|
|
|
ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0]))
|
|
|
|
ba_alias.len = C.size_t(len(ba))
|
|
|
|
return (int)(C.QByteArrayMatcher_IndexIn22(this.h, ba_alias, (C.int)(from)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QByteArrayMatcher) IndexIn3(str string, lenVal int, from int) int {
|
|
|
|
str_Cstring := C.CString(str)
|
|
|
|
defer C.free(unsafe.Pointer(str_Cstring))
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QByteArrayMatcher_IndexIn3(this.h, str_Cstring, (C.int)(lenVal), (C.int)(from)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QByteArrayMatcher) Delete() {
|
|
|
|
C.QByteArrayMatcher_Delete(this.h)
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// GoGC adds a Go Finalizer to this pointer, so that it will be deleted
|
|
|
|
// from C++ memory once it is unreachable from Go memory.
|
|
|
|
func (this *QByteArrayMatcher) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QByteArrayMatcher) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QStaticByteArrayMatcherBase struct {
|
|
|
|
h *C.QStaticByteArrayMatcherBase
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QStaticByteArrayMatcherBase) cPointer() *C.QStaticByteArrayMatcherBase {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QStaticByteArrayMatcherBase) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQStaticByteArrayMatcherBase(h *C.QStaticByteArrayMatcherBase) *QStaticByteArrayMatcherBase {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QStaticByteArrayMatcherBase{h: h}
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQStaticByteArrayMatcherBase(h unsafe.Pointer) *QStaticByteArrayMatcherBase {
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQStaticByteArrayMatcherBase((*C.QStaticByteArrayMatcherBase)(h))
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QStaticByteArrayMatcherBase) Delete() {
|
|
|
|
C.QStaticByteArrayMatcherBase_Delete(this.h)
|
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
|
|
|
|
// GoGC adds a Go Finalizer to this pointer, so that it will be deleted
|
|
|
|
// from C++ memory once it is unreachable from Go memory.
|
|
|
|
func (this *QStaticByteArrayMatcherBase) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QStaticByteArrayMatcherBase) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|