2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qtextcodec.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
type QTextCodec__ConversionFlag int
|
|
|
|
|
|
|
|
const (
|
2024-09-20 07:13:26 +00:00
|
|
|
QTextCodec__DefaultConversion QTextCodec__ConversionFlag = 0
|
|
|
|
QTextCodec__ConvertInvalidToNull QTextCodec__ConversionFlag = 2147483648
|
|
|
|
QTextCodec__IgnoreHeader QTextCodec__ConversionFlag = 1
|
|
|
|
QTextCodec__FreeFunction QTextCodec__ConversionFlag = 2
|
2024-09-04 06:54:22 +00:00
|
|
|
)
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QTextCodec struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QTextCodec
|
|
|
|
isSubclass bool
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextCodec) cPointer() *C.QTextCodec {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QTextCodec) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQTextCodec constructs the type using only CGO pointers.
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQTextCodec(h *C.QTextCodec) *QTextCodec {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QTextCodec{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQTextCodec constructs the type using only unsafe pointers.
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQTextCodec(h unsafe.Pointer) *QTextCodec {
|
2024-11-19 06:29:06 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
return &QTextCodec{h: (*C.QTextCodec)(h)}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
func QTextCodec_CodecForName(name []byte) *QTextCodec {
|
|
|
|
name_alias := C.struct_miqt_string{}
|
|
|
|
name_alias.data = (*C.char)(unsafe.Pointer(&name[0]))
|
|
|
|
name_alias.len = C.size_t(len(name))
|
|
|
|
return UnsafeNewQTextCodec(unsafe.Pointer(C.QTextCodec_CodecForName(name_alias)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QTextCodec_CodecForNameWithName(name string) *QTextCodec {
|
|
|
|
name_Cstring := C.CString(name)
|
|
|
|
defer C.free(unsafe.Pointer(name_Cstring))
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQTextCodec(unsafe.Pointer(C.QTextCodec_CodecForNameWithName(name_Cstring)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QTextCodec_CodecForMib(mib int) *QTextCodec {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQTextCodec(unsafe.Pointer(C.QTextCodec_CodecForMib((C.int)(mib))))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
func QTextCodec_AvailableCodecs() [][]byte {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QTextCodec_AvailableCodecs()
|
2024-10-18 23:53:33 +00:00
|
|
|
_ret := make([][]byte, int(_ma.len))
|
|
|
|
_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_bytearray C.struct_miqt_string = _outCast[i]
|
|
|
|
_lv_ret := C.GoBytes(unsafe.Pointer(_lv_bytearray.data), C.int(int64(_lv_bytearray.len)))
|
|
|
|
C.free(unsafe.Pointer(_lv_bytearray.data))
|
|
|
|
_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 QTextCodec_AvailableMibs() []int {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QTextCodec_AvailableMibs()
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := make([]int, int(_ma.len))
|
2024-09-17 07:30:27 +00:00
|
|
|
_outCast := (*[0xffff]C.int)(unsafe.Pointer(_ma.data)) // hey ya
|
2024-09-14 22:29:05 +00:00
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
|
|
|
_ret[i] = (int)(_outCast[i])
|
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 QTextCodec_CodecForLocale() *QTextCodec {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQTextCodec(unsafe.Pointer(C.QTextCodec_CodecForLocale()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QTextCodec_SetCodecForLocale(c *QTextCodec) {
|
|
|
|
C.QTextCodec_SetCodecForLocale(c.cPointer())
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
func QTextCodec_CodecForHtml(ba []byte) *QTextCodec {
|
|
|
|
ba_alias := C.struct_miqt_string{}
|
|
|
|
ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0]))
|
|
|
|
ba_alias.len = C.size_t(len(ba))
|
|
|
|
return UnsafeNewQTextCodec(unsafe.Pointer(C.QTextCodec_CodecForHtml(ba_alias)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
func QTextCodec_CodecForHtml2(ba []byte, defaultCodec *QTextCodec) *QTextCodec {
|
|
|
|
ba_alias := C.struct_miqt_string{}
|
|
|
|
ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0]))
|
|
|
|
ba_alias.len = C.size_t(len(ba))
|
|
|
|
return UnsafeNewQTextCodec(unsafe.Pointer(C.QTextCodec_CodecForHtml2(ba_alias, defaultCodec.cPointer())))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
func QTextCodec_CodecForUtfText(ba []byte) *QTextCodec {
|
|
|
|
ba_alias := C.struct_miqt_string{}
|
|
|
|
ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0]))
|
|
|
|
ba_alias.len = C.size_t(len(ba))
|
|
|
|
return UnsafeNewQTextCodec(unsafe.Pointer(C.QTextCodec_CodecForUtfText(ba_alias)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
func QTextCodec_CodecForUtfText2(ba []byte, defaultCodec *QTextCodec) *QTextCodec {
|
|
|
|
ba_alias := C.struct_miqt_string{}
|
|
|
|
ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0]))
|
|
|
|
ba_alias.len = C.size_t(len(ba))
|
|
|
|
return UnsafeNewQTextCodec(unsafe.Pointer(C.QTextCodec_CodecForUtfText2(ba_alias, defaultCodec.cPointer())))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextCodec) CanEncode(param1 QChar) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QTextCodec_CanEncode(this.h, param1.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextCodec) CanEncodeWithQString(param1 string) bool {
|
2024-10-18 23:53:33 +00:00
|
|
|
param1_ms := C.struct_miqt_string{}
|
|
|
|
param1_ms.data = C.CString(param1)
|
|
|
|
param1_ms.len = C.size_t(len(param1))
|
|
|
|
defer C.free(unsafe.Pointer(param1_ms.data))
|
|
|
|
return (bool)(C.QTextCodec_CanEncodeWithQString(this.h, param1_ms))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextCodec) ToUnicode(param1 []byte) string {
|
|
|
|
param1_alias := C.struct_miqt_string{}
|
|
|
|
param1_alias.data = (*C.char)(unsafe.Pointer(¶m1[0]))
|
|
|
|
param1_alias.len = C.size_t(len(param1))
|
|
|
|
var _ms C.struct_miqt_string = C.QTextCodec_ToUnicode(this.h, param1_alias)
|
|
|
|
_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 *QTextCodec) ToUnicodeWithChars(chars string) string {
|
|
|
|
chars_Cstring := C.CString(chars)
|
|
|
|
defer C.free(unsafe.Pointer(chars_Cstring))
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QTextCodec_ToUnicodeWithChars(this.h, chars_Cstring)
|
|
|
|
_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-10-18 23:53:33 +00:00
|
|
|
func (this *QTextCodec) FromUnicode(uc string) []byte {
|
|
|
|
uc_ms := C.struct_miqt_string{}
|
|
|
|
uc_ms.data = C.CString(uc)
|
|
|
|
uc_ms.len = C.size_t(len(uc))
|
|
|
|
defer C.free(unsafe.Pointer(uc_ms.data))
|
|
|
|
var _bytearray C.struct_miqt_string = C.QTextCodec_FromUnicode(this.h, uc_ms)
|
|
|
|
_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-08-29 07:01:51 +00:00
|
|
|
func (this *QTextCodec) ToUnicode2(in string, length int) string {
|
|
|
|
in_Cstring := C.CString(in)
|
|
|
|
defer C.free(unsafe.Pointer(in_Cstring))
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QTextCodec_ToUnicode2(this.h, in_Cstring, (C.int)(length))
|
|
|
|
_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-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
func (this *QTextCodec) FromUnicode2(in *QChar, length int) []byte {
|
|
|
|
var _bytearray C.struct_miqt_string = C.QTextCodec_FromUnicode2(this.h, in.cPointer(), (C.int)(length))
|
|
|
|
_ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len)))
|
|
|
|
C.free(unsafe.Pointer(_bytearray.data))
|
|
|
|
return _ret
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextCodec) MakeDecoder() *QTextDecoder {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQTextDecoder(unsafe.Pointer(C.QTextCodec_MakeDecoder(this.h)))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextCodec) MakeEncoder() *QTextEncoder {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQTextEncoder(unsafe.Pointer(C.QTextCodec_MakeEncoder(this.h)))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
func (this *QTextCodec) Name() []byte {
|
|
|
|
var _bytearray C.struct_miqt_string = C.QTextCodec_Name(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 *QTextCodec) Aliases() [][]byte {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QTextCodec_Aliases(this.h)
|
2024-10-18 23:53:33 +00:00
|
|
|
_ret := make([][]byte, int(_ma.len))
|
|
|
|
_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_bytearray C.struct_miqt_string = _outCast[i]
|
|
|
|
_lv_ret := C.GoBytes(unsafe.Pointer(_lv_bytearray.data), C.int(int64(_lv_bytearray.len)))
|
|
|
|
C.free(unsafe.Pointer(_lv_bytearray.data))
|
|
|
|
_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 *QTextCodec) MibEnum() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QTextCodec_MibEnum(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
func (this *QTextCodec) ToUnicode3(in string, length int, state *QTextCodec__ConverterState) string {
|
|
|
|
in_Cstring := C.CString(in)
|
|
|
|
defer C.free(unsafe.Pointer(in_Cstring))
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QTextCodec_ToUnicode3(this.h, in_Cstring, (C.int)(length), state.cPointer())
|
|
|
|
_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-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
func (this *QTextCodec) FromUnicode3(in *QChar, length int, state *QTextCodec__ConverterState) []byte {
|
|
|
|
var _bytearray C.struct_miqt_string = C.QTextCodec_FromUnicode3(this.h, in.cPointer(), (C.int)(length), state.cPointer())
|
|
|
|
_ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len)))
|
|
|
|
C.free(unsafe.Pointer(_bytearray.data))
|
|
|
|
return _ret
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 06:40:03 +00:00
|
|
|
func (this *QTextCodec) MakeDecoder1(flags QTextCodec__ConversionFlag) *QTextDecoder {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQTextDecoder(unsafe.Pointer(C.QTextCodec_MakeDecoder1(this.h, (C.int)(flags))))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 06:40:03 +00:00
|
|
|
func (this *QTextCodec) MakeEncoder1(flags QTextCodec__ConversionFlag) *QTextEncoder {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQTextEncoder(unsafe.Pointer(C.QTextCodec_MakeEncoder1(this.h, (C.int)(flags))))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QTextEncoder struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QTextEncoder
|
|
|
|
isSubclass bool
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextEncoder) cPointer() *C.QTextEncoder {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QTextEncoder) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQTextEncoder constructs the type using only CGO pointers.
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQTextEncoder(h *C.QTextEncoder) *QTextEncoder {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QTextEncoder{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQTextEncoder constructs the type using only unsafe pointers.
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQTextEncoder(h unsafe.Pointer) *QTextEncoder {
|
2024-11-19 06:29:06 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
return &QTextEncoder{h: (*C.QTextEncoder)(h)}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQTextEncoder constructs a new QTextEncoder object.
|
|
|
|
func NewQTextEncoder(codec *QTextCodec) *QTextEncoder {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QTextEncoder *C.QTextEncoder = nil
|
|
|
|
|
|
|
|
C.QTextEncoder_new(codec.cPointer(), &outptr_QTextEncoder)
|
|
|
|
ret := newQTextEncoder(outptr_QTextEncoder)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
// NewQTextEncoder2 constructs a new QTextEncoder object.
|
2024-09-20 06:40:03 +00:00
|
|
|
func NewQTextEncoder2(codec *QTextCodec, flags QTextCodec__ConversionFlag) *QTextEncoder {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QTextEncoder *C.QTextEncoder = nil
|
|
|
|
|
|
|
|
C.QTextEncoder_new2(codec.cPointer(), (C.int)(flags), &outptr_QTextEncoder)
|
|
|
|
ret := newQTextEncoder(outptr_QTextEncoder)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
func (this *QTextEncoder) FromUnicode(str string) []byte {
|
|
|
|
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 _bytearray C.struct_miqt_string = C.QTextEncoder_FromUnicode(this.h, str_ms)
|
|
|
|
_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 *QTextEncoder) FromUnicode2(uc *QChar, lenVal int) []byte {
|
|
|
|
var _bytearray C.struct_miqt_string = C.QTextEncoder_FromUnicode2(this.h, uc.cPointer(), (C.int)(lenVal))
|
|
|
|
_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
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextEncoder) HasFailure() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QTextEncoder_HasFailure(this.h))
|
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 *QTextEncoder) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QTextEncoder_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 *QTextEncoder) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QTextEncoder) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QTextDecoder struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QTextDecoder
|
|
|
|
isSubclass bool
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextDecoder) cPointer() *C.QTextDecoder {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QTextDecoder) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQTextDecoder constructs the type using only CGO pointers.
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQTextDecoder(h *C.QTextDecoder) *QTextDecoder {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QTextDecoder{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQTextDecoder constructs the type using only unsafe pointers.
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQTextDecoder(h unsafe.Pointer) *QTextDecoder {
|
2024-11-19 06:29:06 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
return &QTextDecoder{h: (*C.QTextDecoder)(h)}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQTextDecoder constructs a new QTextDecoder object.
|
|
|
|
func NewQTextDecoder(codec *QTextCodec) *QTextDecoder {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QTextDecoder *C.QTextDecoder = nil
|
|
|
|
|
|
|
|
C.QTextDecoder_new(codec.cPointer(), &outptr_QTextDecoder)
|
|
|
|
ret := newQTextDecoder(outptr_QTextDecoder)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
// NewQTextDecoder2 constructs a new QTextDecoder object.
|
2024-09-20 06:40:03 +00:00
|
|
|
func NewQTextDecoder2(codec *QTextCodec, flags QTextCodec__ConversionFlag) *QTextDecoder {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QTextDecoder *C.QTextDecoder = nil
|
|
|
|
|
|
|
|
C.QTextDecoder_new2(codec.cPointer(), (C.int)(flags), &outptr_QTextDecoder)
|
|
|
|
ret := newQTextDecoder(outptr_QTextDecoder)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QTextDecoder) ToUnicode(chars string, lenVal int) string {
|
|
|
|
chars_Cstring := C.CString(chars)
|
|
|
|
defer C.free(unsafe.Pointer(chars_Cstring))
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QTextDecoder_ToUnicode(this.h, chars_Cstring, (C.int)(lenVal))
|
|
|
|
_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-10-18 23:53:33 +00:00
|
|
|
func (this *QTextDecoder) ToUnicodeWithBa(ba []byte) string {
|
|
|
|
ba_alias := C.struct_miqt_string{}
|
|
|
|
ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0]))
|
|
|
|
ba_alias.len = C.size_t(len(ba))
|
|
|
|
var _ms C.struct_miqt_string = C.QTextDecoder_ToUnicodeWithBa(this.h, ba_alias)
|
|
|
|
_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 *QTextDecoder) HasFailure() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QTextDecoder_HasFailure(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextDecoder) NeedsMoreData() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QTextDecoder_NeedsMoreData(this.h))
|
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 *QTextDecoder) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QTextDecoder_Delete(this.h, C.bool(this.isSubclass))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-08-29 07:01:51 +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 *QTextDecoder) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QTextDecoder) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
type QTextCodec__ConverterState struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QTextCodec__ConverterState
|
|
|
|
isSubclass bool
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTextCodec__ConverterState) cPointer() *C.QTextCodec__ConverterState {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QTextCodec__ConverterState) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQTextCodec__ConverterState constructs the type using only CGO pointers.
|
2024-08-29 07:01:51 +00:00
|
|
|
func newQTextCodec__ConverterState(h *C.QTextCodec__ConverterState) *QTextCodec__ConverterState {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-29 07:01:51 +00:00
|
|
|
return &QTextCodec__ConverterState{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQTextCodec__ConverterState constructs the type using only unsafe pointers.
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQTextCodec__ConverterState(h unsafe.Pointer) *QTextCodec__ConverterState {
|
2024-11-19 06:29:06 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
return &QTextCodec__ConverterState{h: (*C.QTextCodec__ConverterState)(h)}
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQTextCodec__ConverterState constructs a new QTextCodec::ConverterState object.
|
|
|
|
func NewQTextCodec__ConverterState() *QTextCodec__ConverterState {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QTextCodec__ConverterState *C.QTextCodec__ConverterState = nil
|
|
|
|
|
|
|
|
C.QTextCodec__ConverterState_new(&outptr_QTextCodec__ConverterState)
|
|
|
|
ret := newQTextCodec__ConverterState(outptr_QTextCodec__ConverterState)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQTextCodec__ConverterState2 constructs a new QTextCodec::ConverterState object.
|
2024-09-20 06:40:03 +00:00
|
|
|
func NewQTextCodec__ConverterState2(f QTextCodec__ConversionFlag) *QTextCodec__ConverterState {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QTextCodec__ConverterState *C.QTextCodec__ConverterState = nil
|
|
|
|
|
|
|
|
C.QTextCodec__ConverterState_new2((C.int)(f), &outptr_QTextCodec__ConverterState)
|
|
|
|
ret := newQTextCodec__ConverterState(outptr_QTextCodec__ConverterState)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-29 07:01:51 +00:00
|
|
|
func (this *QTextCodec__ConverterState) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QTextCodec__ConverterState_Delete(this.h, C.bool(this.isSubclass))
|
2024-08-29 07:01:51 +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 *QTextCodec__ConverterState) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QTextCodec__ConverterState) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|