miqt/qt6/gen_qbytearraymatcher.go

188 lines
5.4 KiB
Go
Raw Permalink Normal View History

2024-10-20 05:21:03 +00:00
package qt6
/*
#include "gen_qbytearraymatcher.h"
#include <stdlib.h>
*/
import "C"
import (
"runtime"
"unsafe"
)
type QByteArrayMatcher struct {
2024-11-19 06:29:06 +00:00
h *C.QByteArrayMatcher
isSubclass bool
2024-10-20 05:21:03 +00:00
}
func (this *QByteArrayMatcher) cPointer() *C.QByteArrayMatcher {
if this == nil {
return nil
}
return this.h
}
func (this *QByteArrayMatcher) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQByteArrayMatcher constructs the type using only CGO pointers.
2024-10-20 05:21:03 +00:00
func newQByteArrayMatcher(h *C.QByteArrayMatcher) *QByteArrayMatcher {
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
2024-10-20 05:21:03 +00:00
return &QByteArrayMatcher{h: h}
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQByteArrayMatcher constructs the type using only unsafe pointers.
2024-10-20 05:21:03 +00:00
func UnsafeNewQByteArrayMatcher(h unsafe.Pointer) *QByteArrayMatcher {
2024-12-07 04:15:57 +00:00
return newQByteArrayMatcher((*C.QByteArrayMatcher)(h))
2024-10-20 05:21:03 +00:00
}
// NewQByteArrayMatcher constructs a new QByteArrayMatcher object.
func NewQByteArrayMatcher() *QByteArrayMatcher {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQByteArrayMatcher(C.QByteArrayMatcher_new())
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQByteArrayMatcher2 constructs a new QByteArrayMatcher object.
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))
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQByteArrayMatcher(C.QByteArrayMatcher_new2(pattern_alias))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQByteArrayMatcher3 constructs a new QByteArrayMatcher object.
func NewQByteArrayMatcher3(pattern QByteArrayView) *QByteArrayMatcher {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQByteArrayMatcher(C.QByteArrayMatcher_new3(pattern.cPointer()))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQByteArrayMatcher4 constructs a new QByteArrayMatcher object.
func NewQByteArrayMatcher4(pattern string) *QByteArrayMatcher {
pattern_Cstring := C.CString(pattern)
defer C.free(unsafe.Pointer(pattern_Cstring))
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQByteArrayMatcher(C.QByteArrayMatcher_new4(pattern_Cstring))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQByteArrayMatcher5 constructs a new QByteArrayMatcher object.
func NewQByteArrayMatcher5(other *QByteArrayMatcher) *QByteArrayMatcher {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQByteArrayMatcher(C.QByteArrayMatcher_new5(other.cPointer()))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQByteArrayMatcher6 constructs a new QByteArrayMatcher object.
func NewQByteArrayMatcher6(pattern string, length int64) *QByteArrayMatcher {
pattern_Cstring := C.CString(pattern)
defer C.free(unsafe.Pointer(pattern_Cstring))
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQByteArrayMatcher(C.QByteArrayMatcher_new6(pattern_Cstring, (C.ptrdiff_t)(length)))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
func (this *QByteArrayMatcher) OperatorAssign(other *QByteArrayMatcher) {
C.QByteArrayMatcher_OperatorAssign(this.h, other.cPointer())
}
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)
}
func (this *QByteArrayMatcher) IndexIn(str string, lenVal int64) int64 {
str_Cstring := C.CString(str)
defer C.free(unsafe.Pointer(str_Cstring))
return (int64)(C.QByteArrayMatcher_IndexIn(this.h, str_Cstring, (C.ptrdiff_t)(lenVal)))
}
func (this *QByteArrayMatcher) IndexInWithData(data QByteArrayView) int64 {
return (int64)(C.QByteArrayMatcher_IndexInWithData(this.h, data.cPointer()))
}
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
}
func (this *QByteArrayMatcher) IndexIn3(str string, lenVal int64, from int64) int64 {
str_Cstring := C.CString(str)
defer C.free(unsafe.Pointer(str_Cstring))
return (int64)(C.QByteArrayMatcher_IndexIn3(this.h, str_Cstring, (C.ptrdiff_t)(lenVal), (C.ptrdiff_t)(from)))
}
func (this *QByteArrayMatcher) IndexIn2(data QByteArrayView, from int64) int64 {
return (int64)(C.QByteArrayMatcher_IndexIn2(this.h, data.cPointer(), (C.ptrdiff_t)(from)))
}
// Delete this object from C++ memory.
func (this *QByteArrayMatcher) Delete() {
2024-11-19 06:29:06 +00:00
C.QByteArrayMatcher_Delete(this.h, C.bool(this.isSubclass))
2024-10-20 05:21:03 +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)
})
}
type QStaticByteArrayMatcherBase struct {
2024-11-19 06:29:06 +00:00
h *C.QStaticByteArrayMatcherBase
isSubclass bool
2024-10-20 05:21:03 +00:00
}
func (this *QStaticByteArrayMatcherBase) cPointer() *C.QStaticByteArrayMatcherBase {
if this == nil {
return nil
}
return this.h
}
func (this *QStaticByteArrayMatcherBase) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQStaticByteArrayMatcherBase constructs the type using only CGO pointers.
2024-10-20 05:21:03 +00:00
func newQStaticByteArrayMatcherBase(h *C.QStaticByteArrayMatcherBase) *QStaticByteArrayMatcherBase {
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
2024-10-20 05:21:03 +00:00
return &QStaticByteArrayMatcherBase{h: h}
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQStaticByteArrayMatcherBase constructs the type using only unsafe pointers.
2024-10-20 05:21:03 +00:00
func UnsafeNewQStaticByteArrayMatcherBase(h unsafe.Pointer) *QStaticByteArrayMatcherBase {
2024-12-07 04:15:57 +00:00
return newQStaticByteArrayMatcherBase((*C.QStaticByteArrayMatcherBase)(h))
2024-10-20 05:21:03 +00:00
}