miqt/qt6/gen_qstringconverter.go

223 lines
6.1 KiB
Go
Raw Permalink Normal View History

2024-10-20 05:21:03 +00:00
package qt6
/*
#include "gen_qstringconverter.h"
#include <stdlib.h>
*/
import "C"
import (
"runtime"
"unsafe"
)
type QStringEncoder struct {
2024-11-19 06:29:06 +00:00
h *C.QStringEncoder
isSubclass bool
2024-10-20 05:21:03 +00:00
*QStringConverter
}
func (this *QStringEncoder) cPointer() *C.QStringEncoder {
if this == nil {
return nil
}
return this.h
}
func (this *QStringEncoder) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQStringEncoder constructs the type using only CGO pointers.
2024-12-07 04:15:57 +00:00
func newQStringEncoder(h *C.QStringEncoder) *QStringEncoder {
2024-10-20 05:21:03 +00:00
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
var outptr_QStringConverter *C.QStringConverter = nil
C.QStringEncoder_virtbase(h, &outptr_QStringConverter)
2024-11-19 06:29:06 +00:00
return &QStringEncoder{h: h,
2024-12-07 04:15:57 +00:00
QStringConverter: newQStringConverter(outptr_QStringConverter)}
2024-10-20 05:21:03 +00:00
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQStringEncoder constructs the type using only unsafe pointers.
2024-12-07 04:15:57 +00:00
func UnsafeNewQStringEncoder(h unsafe.Pointer) *QStringEncoder {
return newQStringEncoder((*C.QStringEncoder)(h))
2024-10-20 05:21:03 +00:00
}
// NewQStringEncoder constructs a new QStringEncoder object.
func NewQStringEncoder() *QStringEncoder {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQStringEncoder(C.QStringEncoder_new())
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQStringEncoder2 constructs a new QStringEncoder object.
func NewQStringEncoder2(encoding QStringConverter__Encoding) *QStringEncoder {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQStringEncoder(C.QStringEncoder_new2((C.int)(encoding)))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQStringEncoder3 constructs a new QStringEncoder object.
func NewQStringEncoder3(name string) *QStringEncoder {
name_Cstring := C.CString(name)
defer C.free(unsafe.Pointer(name_Cstring))
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQStringEncoder(C.QStringEncoder_new3(name_Cstring))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQStringEncoder4 constructs a new QStringEncoder object.
func NewQStringEncoder4(encoding QStringConverter__Encoding, flags QStringConverterBase__Flag) *QStringEncoder {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQStringEncoder(C.QStringEncoder_new4((C.int)(encoding), (C.int)(flags)))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQStringEncoder5 constructs a new QStringEncoder object.
func NewQStringEncoder5(name string, flags QStringConverterBase__Flag) *QStringEncoder {
name_Cstring := C.CString(name)
defer C.free(unsafe.Pointer(name_Cstring))
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQStringEncoder(C.QStringEncoder_new5(name_Cstring, (C.int)(flags)))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
func (this *QStringEncoder) RequiredSpace(inputLength int64) int64 {
return (int64)(C.QStringEncoder_RequiredSpace(this.h, (C.ptrdiff_t)(inputLength)))
}
// Delete this object from C++ memory.
func (this *QStringEncoder) Delete() {
2024-11-19 06:29:06 +00:00
C.QStringEncoder_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 *QStringEncoder) GoGC() {
runtime.SetFinalizer(this, func(this *QStringEncoder) {
this.Delete()
runtime.KeepAlive(this.h)
})
}
type QStringDecoder struct {
2024-11-19 06:29:06 +00:00
h *C.QStringDecoder
isSubclass bool
2024-10-20 05:21:03 +00:00
*QStringConverter
}
func (this *QStringDecoder) cPointer() *C.QStringDecoder {
if this == nil {
return nil
}
return this.h
}
func (this *QStringDecoder) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQStringDecoder constructs the type using only CGO pointers.
2024-12-07 04:15:57 +00:00
func newQStringDecoder(h *C.QStringDecoder) *QStringDecoder {
2024-10-20 05:21:03 +00:00
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
var outptr_QStringConverter *C.QStringConverter = nil
C.QStringDecoder_virtbase(h, &outptr_QStringConverter)
2024-11-19 06:29:06 +00:00
return &QStringDecoder{h: h,
2024-12-07 04:15:57 +00:00
QStringConverter: newQStringConverter(outptr_QStringConverter)}
2024-10-20 05:21:03 +00:00
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQStringDecoder constructs the type using only unsafe pointers.
2024-12-07 04:15:57 +00:00
func UnsafeNewQStringDecoder(h unsafe.Pointer) *QStringDecoder {
return newQStringDecoder((*C.QStringDecoder)(h))
2024-10-20 05:21:03 +00:00
}
// NewQStringDecoder constructs a new QStringDecoder object.
func NewQStringDecoder(encoding QStringConverter__Encoding) *QStringDecoder {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQStringDecoder(C.QStringDecoder_new((C.int)(encoding)))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQStringDecoder2 constructs a new QStringDecoder object.
func NewQStringDecoder2() *QStringDecoder {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQStringDecoder(C.QStringDecoder_new2())
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQStringDecoder3 constructs a new QStringDecoder object.
func NewQStringDecoder3(name string) *QStringDecoder {
name_Cstring := C.CString(name)
defer C.free(unsafe.Pointer(name_Cstring))
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQStringDecoder(C.QStringDecoder_new3(name_Cstring))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQStringDecoder4 constructs a new QStringDecoder object.
func NewQStringDecoder4(encoding QStringConverter__Encoding, flags QStringConverterBase__Flag) *QStringDecoder {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQStringDecoder(C.QStringDecoder_new4((C.int)(encoding), (C.int)(flags)))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQStringDecoder5 constructs a new QStringDecoder object.
func NewQStringDecoder5(name string, f QStringConverterBase__Flag) *QStringDecoder {
name_Cstring := C.CString(name)
defer C.free(unsafe.Pointer(name_Cstring))
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQStringDecoder(C.QStringDecoder_new5(name_Cstring, (C.int)(f)))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
func (this *QStringDecoder) RequiredSpace(inputLength int64) int64 {
return (int64)(C.QStringDecoder_RequiredSpace(this.h, (C.ptrdiff_t)(inputLength)))
}
func (this *QStringDecoder) AppendToBuffer(out *QChar, ba QByteArrayView) *QChar {
return newQChar(C.QStringDecoder_AppendToBuffer(this.h, out.cPointer(), ba.cPointer()))
2024-10-20 05:21:03 +00:00
}
func QStringDecoder_DecoderForHtml(data QByteArrayView) *QStringDecoder {
2024-12-07 04:15:57 +00:00
_goptr := newQStringDecoder(C.QStringDecoder_DecoderForHtml(data.cPointer()))
2024-10-20 05:21:03 +00:00
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
// Delete this object from C++ memory.
func (this *QStringDecoder) Delete() {
2024-11-19 06:29:06 +00:00
C.QStringDecoder_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 *QStringDecoder) GoGC() {
runtime.SetFinalizer(this, func(this *QStringDecoder) {
this.Delete()
runtime.KeepAlive(this.h)
})
}