2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qregexp.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
2024-09-14 22:29:05 +00:00
|
|
|
"runtime"
|
2024-08-25 04:08:24 +00:00
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
type QRegExp__PatternSyntax int
|
|
|
|
|
|
|
|
const (
|
2024-09-20 07:13:26 +00:00
|
|
|
QRegExp__RegExp QRegExp__PatternSyntax = 0
|
|
|
|
QRegExp__Wildcard QRegExp__PatternSyntax = 1
|
|
|
|
QRegExp__FixedString QRegExp__PatternSyntax = 2
|
|
|
|
QRegExp__RegExp2 QRegExp__PatternSyntax = 3
|
|
|
|
QRegExp__WildcardUnix QRegExp__PatternSyntax = 4
|
|
|
|
QRegExp__W3CXmlSchema11 QRegExp__PatternSyntax = 5
|
2024-09-04 06:54:22 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type QRegExp__CaretMode int
|
|
|
|
|
|
|
|
const (
|
2024-09-20 07:13:26 +00:00
|
|
|
QRegExp__CaretAtZero QRegExp__CaretMode = 0
|
|
|
|
QRegExp__CaretAtOffset QRegExp__CaretMode = 1
|
|
|
|
QRegExp__CaretWontMatch QRegExp__CaretMode = 2
|
2024-09-04 06:54:22 +00:00
|
|
|
)
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QRegExp struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QRegExp
|
|
|
|
isSubclass bool
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRegExp) cPointer() *C.QRegExp {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QRegExp) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQRegExp constructs the type using only CGO pointers.
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQRegExp(h *C.QRegExp) *QRegExp {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QRegExp{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQRegExp constructs the type using only unsafe pointers.
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQRegExp(h unsafe.Pointer) *QRegExp {
|
2024-11-19 06:29:06 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
return &QRegExp{h: (*C.QRegExp)(h)}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQRegExp constructs a new QRegExp object.
|
|
|
|
func NewQRegExp() *QRegExp {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QRegExp *C.QRegExp = nil
|
|
|
|
|
|
|
|
C.QRegExp_new(&outptr_QRegExp)
|
|
|
|
ret := newQRegExp(outptr_QRegExp)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQRegExp2 constructs a new QRegExp object.
|
2024-08-29 07:01:51 +00:00
|
|
|
func NewQRegExp2(pattern string) *QRegExp {
|
2024-10-18 23:53:33 +00:00
|
|
|
pattern_ms := C.struct_miqt_string{}
|
|
|
|
pattern_ms.data = C.CString(pattern)
|
|
|
|
pattern_ms.len = C.size_t(len(pattern))
|
|
|
|
defer C.free(unsafe.Pointer(pattern_ms.data))
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QRegExp *C.QRegExp = nil
|
|
|
|
|
|
|
|
C.QRegExp_new2(pattern_ms, &outptr_QRegExp)
|
|
|
|
ret := newQRegExp(outptr_QRegExp)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQRegExp3 constructs a new QRegExp object.
|
|
|
|
func NewQRegExp3(rx *QRegExp) *QRegExp {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QRegExp *C.QRegExp = nil
|
|
|
|
|
|
|
|
C.QRegExp_new3(rx.cPointer(), &outptr_QRegExp)
|
|
|
|
ret := newQRegExp(outptr_QRegExp)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQRegExp4 constructs a new QRegExp object.
|
2024-09-04 06:54:22 +00:00
|
|
|
func NewQRegExp4(pattern string, cs CaseSensitivity) *QRegExp {
|
2024-10-18 23:53:33 +00:00
|
|
|
pattern_ms := C.struct_miqt_string{}
|
|
|
|
pattern_ms.data = C.CString(pattern)
|
|
|
|
pattern_ms.len = C.size_t(len(pattern))
|
|
|
|
defer C.free(unsafe.Pointer(pattern_ms.data))
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QRegExp *C.QRegExp = nil
|
|
|
|
|
|
|
|
C.QRegExp_new4(pattern_ms, (C.int)(cs), &outptr_QRegExp)
|
|
|
|
ret := newQRegExp(outptr_QRegExp)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQRegExp5 constructs a new QRegExp object.
|
2024-09-04 06:54:22 +00:00
|
|
|
func NewQRegExp5(pattern string, cs CaseSensitivity, syntax QRegExp__PatternSyntax) *QRegExp {
|
2024-10-18 23:53:33 +00:00
|
|
|
pattern_ms := C.struct_miqt_string{}
|
|
|
|
pattern_ms.data = C.CString(pattern)
|
|
|
|
pattern_ms.len = C.size_t(len(pattern))
|
|
|
|
defer C.free(unsafe.Pointer(pattern_ms.data))
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QRegExp *C.QRegExp = nil
|
|
|
|
|
|
|
|
C.QRegExp_new5(pattern_ms, (C.int)(cs), (C.int)(syntax), &outptr_QRegExp)
|
|
|
|
ret := newQRegExp(outptr_QRegExp)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRegExp) OperatorAssign(rx *QRegExp) {
|
|
|
|
C.QRegExp_OperatorAssign(this.h, rx.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRegExp) Swap(other *QRegExp) {
|
|
|
|
C.QRegExp_Swap(this.h, other.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRegExp) OperatorEqual(rx *QRegExp) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QRegExp_OperatorEqual(this.h, rx.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRegExp) OperatorNotEqual(rx *QRegExp) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QRegExp_OperatorNotEqual(this.h, rx.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRegExp) IsEmpty() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QRegExp_IsEmpty(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRegExp) IsValid() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QRegExp_IsValid(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRegExp) Pattern() string {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QRegExp_Pattern(this.h)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRegExp) SetPattern(pattern string) {
|
2024-10-18 23:53:33 +00:00
|
|
|
pattern_ms := C.struct_miqt_string{}
|
|
|
|
pattern_ms.data = C.CString(pattern)
|
|
|
|
pattern_ms.len = C.size_t(len(pattern))
|
|
|
|
defer C.free(unsafe.Pointer(pattern_ms.data))
|
|
|
|
C.QRegExp_SetPattern(this.h, pattern_ms)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QRegExp) CaseSensitivity() CaseSensitivity {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (CaseSensitivity)(C.QRegExp_CaseSensitivity(this.h))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QRegExp) SetCaseSensitivity(cs CaseSensitivity) {
|
2024-09-18 00:12:02 +00:00
|
|
|
C.QRegExp_SetCaseSensitivity(this.h, (C.int)(cs))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QRegExp) PatternSyntax() QRegExp__PatternSyntax {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (QRegExp__PatternSyntax)(C.QRegExp_PatternSyntax(this.h))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QRegExp) SetPatternSyntax(syntax QRegExp__PatternSyntax) {
|
2024-09-18 00:12:02 +00:00
|
|
|
C.QRegExp_SetPatternSyntax(this.h, (C.int)(syntax))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QRegExp) IsMinimal() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QRegExp_IsMinimal(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRegExp) SetMinimal(minimal bool) {
|
|
|
|
C.QRegExp_SetMinimal(this.h, (C.bool)(minimal))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRegExp) ExactMatch(str string) bool {
|
2024-10-18 23:53:33 +00:00
|
|
|
str_ms := C.struct_miqt_string{}
|
|
|
|
str_ms.data = C.CString(str)
|
|
|
|
str_ms.len = C.size_t(len(str))
|
|
|
|
defer C.free(unsafe.Pointer(str_ms.data))
|
|
|
|
return (bool)(C.QRegExp_ExactMatch(this.h, str_ms))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
func (this *QRegExp) IndexIn(str string) int {
|
2024-10-18 23:53:33 +00:00
|
|
|
str_ms := C.struct_miqt_string{}
|
|
|
|
str_ms.data = C.CString(str)
|
|
|
|
str_ms.len = C.size_t(len(str))
|
|
|
|
defer C.free(unsafe.Pointer(str_ms.data))
|
|
|
|
return (int)(C.QRegExp_IndexIn(this.h, str_ms))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRegExp) LastIndexIn(str string) int {
|
2024-10-18 23:53:33 +00:00
|
|
|
str_ms := C.struct_miqt_string{}
|
|
|
|
str_ms.data = C.CString(str)
|
|
|
|
str_ms.len = C.size_t(len(str))
|
|
|
|
defer C.free(unsafe.Pointer(str_ms.data))
|
|
|
|
return (int)(C.QRegExp_LastIndexIn(this.h, str_ms))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QRegExp) MatchedLength() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QRegExp_MatchedLength(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRegExp) CaptureCount() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QRegExp_CaptureCount(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRegExp) CapturedTexts() []string {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QRegExp_CapturedTexts(this.h)
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := make([]string, int(_ma.len))
|
2024-10-18 23:53:33 +00:00
|
|
|
_outCast := (*[0xffff]C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya
|
2024-09-14 22:29:05 +00:00
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _lv_ms C.struct_miqt_string = _outCast[i]
|
|
|
|
_lv_ret := C.GoStringN(_lv_ms.data, C.int(int64(_lv_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_lv_ms.data))
|
2024-09-17 07:30:27 +00:00
|
|
|
_ret[i] = _lv_ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRegExp) CapturedTexts2() []string {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QRegExp_CapturedTexts2(this.h)
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := make([]string, int(_ma.len))
|
2024-10-18 23:53:33 +00:00
|
|
|
_outCast := (*[0xffff]C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya
|
2024-09-14 22:29:05 +00:00
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _lv_ms C.struct_miqt_string = _outCast[i]
|
|
|
|
_lv_ret := C.GoStringN(_lv_ms.data, C.int(int64(_lv_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_lv_ms.data))
|
2024-09-17 07:30:27 +00:00
|
|
|
_ret[i] = _lv_ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRegExp) Cap() string {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QRegExp_Cap(this.h)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRegExp) Cap2() string {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QRegExp_Cap2(this.h)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRegExp) Pos() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QRegExp_Pos(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRegExp) Pos2() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QRegExp_Pos2(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRegExp) ErrorString() string {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QRegExp_ErrorString(this.h)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRegExp) ErrorString2() string {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QRegExp_ErrorString2(this.h)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QRegExp_Escape(str string) string {
|
2024-10-18 23:53:33 +00:00
|
|
|
str_ms := C.struct_miqt_string{}
|
|
|
|
str_ms.data = C.CString(str)
|
|
|
|
str_ms.len = C.size_t(len(str))
|
|
|
|
defer C.free(unsafe.Pointer(str_ms.data))
|
|
|
|
var _ms C.struct_miqt_string = C.QRegExp_Escape(str_ms)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
func (this *QRegExp) IndexIn2(str string, offset int) int {
|
2024-10-18 23:53:33 +00:00
|
|
|
str_ms := C.struct_miqt_string{}
|
|
|
|
str_ms.data = C.CString(str)
|
|
|
|
str_ms.len = C.size_t(len(str))
|
|
|
|
defer C.free(unsafe.Pointer(str_ms.data))
|
|
|
|
return (int)(C.QRegExp_IndexIn2(this.h, str_ms, (C.int)(offset)))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QRegExp) IndexIn3(str string, offset int, caretMode QRegExp__CaretMode) int {
|
2024-10-18 23:53:33 +00:00
|
|
|
str_ms := C.struct_miqt_string{}
|
|
|
|
str_ms.data = C.CString(str)
|
|
|
|
str_ms.len = C.size_t(len(str))
|
|
|
|
defer C.free(unsafe.Pointer(str_ms.data))
|
|
|
|
return (int)(C.QRegExp_IndexIn3(this.h, str_ms, (C.int)(offset), (C.int)(caretMode)))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRegExp) LastIndexIn2(str string, offset int) int {
|
2024-10-18 23:53:33 +00:00
|
|
|
str_ms := C.struct_miqt_string{}
|
|
|
|
str_ms.data = C.CString(str)
|
|
|
|
str_ms.len = C.size_t(len(str))
|
|
|
|
defer C.free(unsafe.Pointer(str_ms.data))
|
|
|
|
return (int)(C.QRegExp_LastIndexIn2(this.h, str_ms, (C.int)(offset)))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QRegExp) LastIndexIn3(str string, offset int, caretMode QRegExp__CaretMode) int {
|
2024-10-18 23:53:33 +00:00
|
|
|
str_ms := C.struct_miqt_string{}
|
|
|
|
str_ms.data = C.CString(str)
|
|
|
|
str_ms.len = C.size_t(len(str))
|
|
|
|
defer C.free(unsafe.Pointer(str_ms.data))
|
|
|
|
return (int)(C.QRegExp_LastIndexIn3(this.h, str_ms, (C.int)(offset), (C.int)(caretMode)))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QRegExp) Cap1(nth int) string {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QRegExp_Cap1(this.h, (C.int)(nth))
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRegExp) Cap1WithNth(nth int) string {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QRegExp_Cap1WithNth(this.h, (C.int)(nth))
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRegExp) Pos1(nth int) int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QRegExp_Pos1(this.h, (C.int)(nth)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QRegExp) Pos1WithNth(nth int) int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QRegExp_Pos1WithNth(this.h, (C.int)(nth)))
|
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 *QRegExp) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QRegExp_Delete(this.h, C.bool(this.isSubclass))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
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 *QRegExp) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QRegExp) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|