miqt/qt/cbor/gen_qcborvalue.go

1124 lines
36 KiB
Go
Raw Normal View History

package cbor
/*
#include "gen_qcborvalue.h"
#include <stdlib.h>
*/
import "C"
import (
"github.com/mappu/miqt/qt"
"runtime"
"unsafe"
)
2024-09-04 18:54:22 +12:00
type QCborValue__EncodingOption int
const (
2024-09-20 19:13:26 +12:00
QCborValue__SortKeysInMaps QCborValue__EncodingOption = 1
QCborValue__UseFloat QCborValue__EncodingOption = 2
QCborValue__UseFloat16 QCborValue__EncodingOption = 6
QCborValue__UseIntegers QCborValue__EncodingOption = 8
QCborValue__NoTransformation QCborValue__EncodingOption = 0
2024-09-04 18:54:22 +12:00
)
type QCborValue__DiagnosticNotationOption int
const (
2024-09-20 19:13:26 +12:00
QCborValue__Compact QCborValue__DiagnosticNotationOption = 0
QCborValue__LineWrapped QCborValue__DiagnosticNotationOption = 1
QCborValue__ExtendedFormat QCborValue__DiagnosticNotationOption = 2
2024-09-04 18:54:22 +12:00
)
type QCborValue__Type int
const (
2024-09-20 19:13:26 +12:00
QCborValue__Integer QCborValue__Type = 0
QCborValue__ByteArray QCborValue__Type = 64
QCborValue__String QCborValue__Type = 96
QCborValue__Array QCborValue__Type = 128
QCborValue__Map QCborValue__Type = 160
QCborValue__Tag QCborValue__Type = 192
QCborValue__SimpleType QCborValue__Type = 256
QCborValue__False QCborValue__Type = 276
QCborValue__True QCborValue__Type = 277
QCborValue__Null QCborValue__Type = 278
QCborValue__Undefined QCborValue__Type = 279
QCborValue__Double QCborValue__Type = 514
QCborValue__DateTime QCborValue__Type = 65536
QCborValue__Url QCborValue__Type = 65568
QCborValue__RegularExpression QCborValue__Type = 65571
QCborValue__Uuid QCborValue__Type = 65573
QCborValue__Invalid QCborValue__Type = -1
2024-09-04 18:54:22 +12:00
)
type QCborParserError struct {
h *C.QCborParserError
}
func (this *QCborParserError) cPointer() *C.QCborParserError {
if this == nil {
return nil
}
return this.h
}
func (this *QCborParserError) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 19:29:06 +13:00
// newQCborParserError constructs the type using only CGO pointers.
func newQCborParserError(h *C.QCborParserError) *QCborParserError {
2024-09-01 14:23:55 +12:00
if h == nil {
return nil
}
2024-12-07 17:15:57 +13:00
return &QCborParserError{h: h}
}
2024-11-19 19:29:06 +13:00
// UnsafeNewQCborParserError constructs the type using only unsafe pointers.
func UnsafeNewQCborParserError(h unsafe.Pointer) *QCborParserError {
2024-12-07 17:15:57 +13:00
return newQCborParserError((*C.QCborParserError)(h))
}
func (this *QCborParserError) ErrorString() string {
2025-02-01 13:45:16 +13:00
var _ms C.struct_miqt_string = C.QCborParserError_errorString(this.h)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
// Delete this object from C++ memory.
func (this *QCborParserError) Delete() {
2025-02-01 13:45:16 +13:00
C.QCborParserError_delete(this.h)
}
// 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 *QCborParserError) GoGC() {
runtime.SetFinalizer(this, func(this *QCborParserError) {
this.Delete()
runtime.KeepAlive(this.h)
})
}
type QCborValue struct {
h *C.QCborValue
}
func (this *QCborValue) cPointer() *C.QCborValue {
if this == nil {
return nil
}
return this.h
}
func (this *QCborValue) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 19:29:06 +13:00
// newQCborValue constructs the type using only CGO pointers.
func newQCborValue(h *C.QCborValue) *QCborValue {
2024-09-01 14:23:55 +12:00
if h == nil {
return nil
}
2024-12-07 17:15:57 +13:00
return &QCborValue{h: h}
}
2024-11-19 19:29:06 +13:00
// UnsafeNewQCborValue constructs the type using only unsafe pointers.
func UnsafeNewQCborValue(h unsafe.Pointer) *QCborValue {
2024-12-07 17:15:57 +13:00
return newQCborValue((*C.QCborValue)(h))
}
// NewQCborValue constructs a new QCborValue object.
func NewQCborValue() *QCborValue {
2024-11-19 19:29:06 +13:00
return newQCborValue(C.QCborValue_new())
}
// NewQCborValue2 constructs a new QCborValue object.
2024-09-04 18:54:22 +12:00
func NewQCborValue2(t_ QCborValue__Type) *QCborValue {
2024-11-19 19:29:06 +13:00
return newQCborValue(C.QCborValue_new2((C.int)(t_)))
}
// NewQCborValue3 constructs a new QCborValue object.
2024-08-29 19:01:51 +12:00
func NewQCborValue3(b_ bool) *QCborValue {
2024-11-19 19:29:06 +13:00
return newQCborValue(C.QCborValue_new3((C.bool)(b_)))
}
// NewQCborValue4 constructs a new QCborValue object.
2024-08-29 19:01:51 +12:00
func NewQCborValue4(i int) *QCborValue {
2024-11-19 19:29:06 +13:00
return newQCborValue(C.QCborValue_new4((C.int)(i)))
}
// NewQCborValue5 constructs a new QCborValue object.
2024-08-29 19:01:51 +12:00
func NewQCborValue5(u uint) *QCborValue {
2024-11-19 19:29:06 +13:00
return newQCborValue(C.QCborValue_new5((C.uint)(u)))
}
// NewQCborValue6 constructs a new QCborValue object.
2024-08-29 19:01:51 +12:00
func NewQCborValue6(i int64) *QCborValue {
2024-11-19 19:29:06 +13:00
return newQCborValue(C.QCborValue_new6((C.longlong)(i)))
}
// NewQCborValue7 constructs a new QCborValue object.
2024-08-29 19:01:51 +12:00
func NewQCborValue7(v float64) *QCborValue {
2024-11-19 19:29:06 +13:00
return newQCborValue(C.QCborValue_new7((C.double)(v)))
}
// NewQCborValue8 constructs a new QCborValue object.
func NewQCborValue8(st QCborSimpleType) *QCborValue {
2024-11-19 19:29:06 +13:00
return newQCborValue(C.QCborValue_new8((C.uint8_t)(st)))
}
// NewQCborValue9 constructs a new QCborValue object.
func NewQCborValue9(ba []byte) *QCborValue {
ba_alias := C.struct_miqt_string{}
if len(ba) > 0 {
ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0]))
} else {
ba_alias.data = (*C.char)(unsafe.Pointer(nil))
}
ba_alias.len = C.size_t(len(ba))
2024-11-19 19:29:06 +13:00
return newQCborValue(C.QCborValue_new9(ba_alias))
}
// NewQCborValue10 constructs a new QCborValue object.
2024-08-29 19:01:51 +12:00
func NewQCborValue10(s string) *QCborValue {
s_ms := C.struct_miqt_string{}
s_ms.data = C.CString(s)
s_ms.len = C.size_t(len(s))
defer C.free(unsafe.Pointer(s_ms.data))
2024-11-19 19:29:06 +13:00
return newQCborValue(C.QCborValue_new10(s_ms))
}
// NewQCborValue11 constructs a new QCborValue object.
func NewQCborValue11(s string) *QCborValue {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
2024-11-19 19:29:06 +13:00
return newQCborValue(C.QCborValue_new11(s_Cstring))
}
// NewQCborValue12 constructs a new QCborValue object.
func NewQCborValue12(a *QCborArray) *QCborValue {
2024-11-19 19:29:06 +13:00
return newQCborValue(C.QCborValue_new12(a.cPointer()))
}
// NewQCborValue13 constructs a new QCborValue object.
func NewQCborValue13(m *QCborMap) *QCborValue {
2024-11-19 19:29:06 +13:00
return newQCborValue(C.QCborValue_new13(m.cPointer()))
}
// NewQCborValue14 constructs a new QCborValue object.
func NewQCborValue14(tag QCborTag) *QCborValue {
2024-11-19 19:29:06 +13:00
return newQCborValue(C.QCborValue_new14((C.uint64_t)(tag)))
}
// NewQCborValue15 constructs a new QCborValue object.
func NewQCborValue15(t_ QCborKnownTags) *QCborValue {
2024-11-19 19:29:06 +13:00
return newQCborValue(C.QCborValue_new15((C.int)(t_)))
}
// NewQCborValue16 constructs a new QCborValue object.
func NewQCborValue16(dt *qt.QDateTime) *QCborValue {
2024-11-19 19:29:06 +13:00
return newQCborValue(C.QCborValue_new16((*C.QDateTime)(dt.UnsafePointer())))
2024-08-29 19:01:51 +12:00
}
// NewQCborValue17 constructs a new QCborValue object.
func NewQCborValue17(url *qt.QUrl) *QCborValue {
2024-11-19 19:29:06 +13:00
return newQCborValue(C.QCborValue_new17((*C.QUrl)(url.UnsafePointer())))
}
// NewQCborValue18 constructs a new QCborValue object.
func NewQCborValue18(rx *qt.QRegularExpression) *QCborValue {
2024-11-19 19:29:06 +13:00
return newQCborValue(C.QCborValue_new18((*C.QRegularExpression)(rx.UnsafePointer())))
}
// NewQCborValue19 constructs a new QCborValue object.
func NewQCborValue19(uuid *qt.QUuid) *QCborValue {
2024-11-19 19:29:06 +13:00
return newQCborValue(C.QCborValue_new19((*C.QUuid)(uuid.UnsafePointer())))
}
// NewQCborValue20 constructs a new QCborValue object.
func NewQCborValue20(other *QCborValue) *QCborValue {
2024-11-19 19:29:06 +13:00
return newQCborValue(C.QCborValue_new20(other.cPointer()))
}
// NewQCborValue21 constructs a new QCborValue object.
func NewQCborValue21(tag QCborTag, taggedValue *QCborValue) *QCborValue {
2024-11-19 19:29:06 +13:00
return newQCborValue(C.QCborValue_new21((C.uint64_t)(tag), taggedValue.cPointer()))
}
// NewQCborValue22 constructs a new QCborValue object.
func NewQCborValue22(t_ QCborKnownTags, tv *QCborValue) *QCborValue {
2024-11-19 19:29:06 +13:00
return newQCborValue(C.QCborValue_new22((C.int)(t_), tv.cPointer()))
}
func (this *QCborValue) OperatorAssign(other *QCborValue) {
2025-02-01 13:45:16 +13:00
C.QCborValue_operatorAssign(this.h, other.cPointer())
}
func (this *QCborValue) Swap(other *QCborValue) {
2025-02-01 13:45:16 +13:00
C.QCborValue_swap(this.h, other.cPointer())
}
2024-09-04 18:54:22 +12:00
func (this *QCborValue) Type() QCborValue__Type {
2025-02-01 13:45:16 +13:00
return (QCborValue__Type)(C.QCborValue_type(this.h))
2024-08-29 19:01:51 +12:00
}
func (this *QCborValue) IsInteger() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValue_isInteger(this.h))
}
func (this *QCborValue) IsByteArray() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValue_isByteArray(this.h))
}
func (this *QCborValue) IsString() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValue_isString(this.h))
}
func (this *QCborValue) IsArray() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValue_isArray(this.h))
}
func (this *QCborValue) IsMap() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValue_isMap(this.h))
}
func (this *QCborValue) IsTag() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValue_isTag(this.h))
}
func (this *QCborValue) IsFalse() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValue_isFalse(this.h))
}
func (this *QCborValue) IsTrue() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValue_isTrue(this.h))
}
func (this *QCborValue) IsBool() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValue_isBool(this.h))
}
func (this *QCborValue) IsNull() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValue_isNull(this.h))
}
func (this *QCborValue) IsUndefined() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValue_isUndefined(this.h))
}
func (this *QCborValue) IsDouble() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValue_isDouble(this.h))
}
func (this *QCborValue) IsDateTime() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValue_isDateTime(this.h))
}
func (this *QCborValue) IsUrl() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValue_isUrl(this.h))
}
func (this *QCborValue) IsRegularExpression() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValue_isRegularExpression(this.h))
}
func (this *QCborValue) IsUuid() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValue_isUuid(this.h))
}
func (this *QCborValue) IsInvalid() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValue_isInvalid(this.h))
}
func (this *QCborValue) IsContainer() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValue_isContainer(this.h))
}
func (this *QCborValue) IsSimpleType() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValue_isSimpleType(this.h))
}
func (this *QCborValue) IsSimpleTypeWithSt(st QCborSimpleType) bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValue_isSimpleTypeWithSt(this.h, (C.uint8_t)(st)))
}
func (this *QCborValue) ToSimpleType() QCborSimpleType {
2025-02-01 13:45:16 +13:00
return (QCborSimpleType)(C.QCborValue_toSimpleType(this.h))
}
func (this *QCborValue) ToInteger() int64 {
2025-02-01 13:45:16 +13:00
return (int64)(C.QCborValue_toInteger(this.h))
}
func (this *QCborValue) ToBool() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValue_toBool(this.h))
}
func (this *QCborValue) ToDouble() float64 {
2025-02-01 13:45:16 +13:00
return (float64)(C.QCborValue_toDouble(this.h))
}
func (this *QCborValue) Tag() QCborTag {
2025-02-01 13:45:16 +13:00
return (QCborTag)(C.QCborValue_tag(this.h))
}
func (this *QCborValue) TaggedValue() *QCborValue {
2025-02-01 13:45:16 +13:00
_goptr := newQCborValue(C.QCborValue_taggedValue(this.h))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValue) ToByteArray() []byte {
2025-02-01 13:45:16 +13:00
var _bytearray C.struct_miqt_string = C.QCborValue_toByteArray(this.h)
_ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len)))
C.free(unsafe.Pointer(_bytearray.data))
return _ret
}
func (this *QCborValue) ToString() string {
2025-02-01 13:45:16 +13:00
var _ms C.struct_miqt_string = C.QCborValue_toString(this.h)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QCborValue) ToDateTime() *qt.QDateTime {
2025-02-01 13:45:16 +13:00
_goptr := qt.UnsafeNewQDateTime(unsafe.Pointer(C.QCborValue_toDateTime(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValue) ToUrl() *qt.QUrl {
2025-02-01 13:45:16 +13:00
_goptr := qt.UnsafeNewQUrl(unsafe.Pointer(C.QCborValue_toUrl(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValue) ToRegularExpression() *qt.QRegularExpression {
2025-02-01 13:45:16 +13:00
_goptr := qt.UnsafeNewQRegularExpression(unsafe.Pointer(C.QCborValue_toRegularExpression(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValue) ToUuid() *qt.QUuid {
2025-02-01 13:45:16 +13:00
_goptr := qt.UnsafeNewQUuid(unsafe.Pointer(C.QCborValue_toUuid(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValue) ToArray() *QCborArray {
2025-02-01 13:45:16 +13:00
_goptr := newQCborArray(C.QCborValue_toArray(this.h))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValue) ToArrayWithDefaultValue(defaultValue *QCborArray) *QCborArray {
2025-02-01 13:45:16 +13:00
_goptr := newQCborArray(C.QCborValue_toArrayWithDefaultValue(this.h, defaultValue.cPointer()))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValue) ToMap() *QCborMap {
2025-02-01 13:45:16 +13:00
_goptr := newQCborMap(C.QCborValue_toMap(this.h))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValue) ToMapWithDefaultValue(defaultValue *QCborMap) *QCborMap {
2025-02-01 13:45:16 +13:00
_goptr := newQCborMap(C.QCborValue_toMapWithDefaultValue(this.h, defaultValue.cPointer()))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValue) OperatorSubscript(key string) *QCborValue {
key_ms := C.struct_miqt_string{}
key_ms.data = C.CString(key)
key_ms.len = C.size_t(len(key))
defer C.free(unsafe.Pointer(key_ms.data))
2025-02-01 13:45:16 +13:00
_goptr := newQCborValue(C.QCborValue_operatorSubscript(this.h, key_ms))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
2024-08-29 19:01:51 +12:00
func (this *QCborValue) OperatorSubscript2(key int64) *QCborValue {
2025-02-01 13:45:16 +13:00
_goptr := newQCborValue(C.QCborValue_operatorSubscript2(this.h, (C.longlong)(key)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
2024-08-29 19:01:51 +12:00
func (this *QCborValue) OperatorSubscript3(key int64) *QCborValueRef {
2025-02-01 13:45:16 +13:00
_goptr := newQCborValueRef(C.QCborValue_operatorSubscript3(this.h, (C.longlong)(key)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
2024-08-29 19:01:51 +12:00
func (this *QCborValue) OperatorSubscript5(key string) *QCborValueRef {
key_ms := C.struct_miqt_string{}
key_ms.data = C.CString(key)
key_ms.len = C.size_t(len(key))
defer C.free(unsafe.Pointer(key_ms.data))
2025-02-01 13:45:16 +13:00
_goptr := newQCborValueRef(C.QCborValue_operatorSubscript5(this.h, key_ms))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValue) Compare(other *QCborValue) int {
2025-02-01 13:45:16 +13:00
return (int)(C.QCborValue_compare(this.h, other.cPointer()))
}
func (this *QCborValue) OperatorEqual(other *QCborValue) bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValue_operatorEqual(this.h, other.cPointer()))
}
func (this *QCborValue) OperatorNotEqual(other *QCborValue) bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValue_operatorNotEqual(this.h, other.cPointer()))
}
func (this *QCborValue) OperatorLesser(other *QCborValue) bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValue_operatorLesser(this.h, other.cPointer()))
}
func QCborValue_FromVariant(variant *qt.QVariant) *QCborValue {
2025-02-01 13:45:16 +13:00
_goptr := newQCborValue(C.QCborValue_fromVariant((*C.QVariant)(variant.UnsafePointer())))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValue) ToVariant() *qt.QVariant {
2025-02-01 13:45:16 +13:00
_goptr := qt.UnsafeNewQVariant(unsafe.Pointer(C.QCborValue_toVariant(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func QCborValue_FromJsonValue(v *qt.QJsonValue) *QCborValue {
2025-02-01 13:45:16 +13:00
_goptr := newQCborValue(C.QCborValue_fromJsonValue((*C.QJsonValue)(v.UnsafePointer())))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValue) ToJsonValue() *qt.QJsonValue {
2025-02-01 13:45:16 +13:00
_goptr := qt.UnsafeNewQJsonValue(unsafe.Pointer(C.QCborValue_toJsonValue(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func QCborValue_FromCbor(reader *QCborStreamReader) *QCborValue {
2025-02-01 13:45:16 +13:00
_goptr := newQCborValue(C.QCborValue_fromCbor(reader.cPointer()))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func QCborValue_FromCborWithBa(ba []byte) *QCborValue {
ba_alias := C.struct_miqt_string{}
if len(ba) > 0 {
ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0]))
} else {
ba_alias.data = (*C.char)(unsafe.Pointer(nil))
}
ba_alias.len = C.size_t(len(ba))
2025-02-01 13:45:16 +13:00
_goptr := newQCborValue(C.QCborValue_fromCborWithBa(ba_alias))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func QCborValue_FromCbor2(data string, lenVal int64) *QCborValue {
data_Cstring := C.CString(data)
defer C.free(unsafe.Pointer(data_Cstring))
2025-02-01 13:45:16 +13:00
_goptr := newQCborValue(C.QCborValue_fromCbor2(data_Cstring, (C.ptrdiff_t)(lenVal)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func QCborValue_FromCbor3(data *byte, lenVal int64) *QCborValue {
2025-02-01 13:45:16 +13:00
_goptr := newQCborValue(C.QCborValue_fromCbor3((*C.uchar)(unsafe.Pointer(data)), (C.ptrdiff_t)(lenVal)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValue) ToCbor() []byte {
2025-02-01 13:45:16 +13:00
var _bytearray C.struct_miqt_string = C.QCborValue_toCbor(this.h)
_ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len)))
C.free(unsafe.Pointer(_bytearray.data))
return _ret
2024-08-29 19:01:51 +12:00
}
func (this *QCborValue) ToCborWithWriter(writer *QCborStreamWriter) {
2025-02-01 13:45:16 +13:00
C.QCborValue_toCborWithWriter(this.h, writer.cPointer())
2024-08-29 19:01:51 +12:00
}
func (this *QCborValue) ToDiagnosticNotation() string {
2025-02-01 13:45:16 +13:00
var _ms C.struct_miqt_string = C.QCborValue_toDiagnosticNotation(this.h)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
2024-08-29 19:01:51 +12:00
}
func (this *QCborValue) ToSimpleType1(defaultValue QCborSimpleType) QCborSimpleType {
2025-02-01 13:45:16 +13:00
return (QCborSimpleType)(C.QCborValue_toSimpleType1(this.h, (C.uint8_t)(defaultValue)))
}
func (this *QCborValue) ToInteger1(defaultValue int64) int64 {
2025-02-01 13:45:16 +13:00
return (int64)(C.QCborValue_toInteger1(this.h, (C.longlong)(defaultValue)))
}
func (this *QCborValue) ToBool1(defaultValue bool) bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValue_toBool1(this.h, (C.bool)(defaultValue)))
}
func (this *QCborValue) ToDouble1(defaultValue float64) float64 {
2025-02-01 13:45:16 +13:00
return (float64)(C.QCborValue_toDouble1(this.h, (C.double)(defaultValue)))
}
func (this *QCborValue) Tag1(defaultValue QCborTag) QCborTag {
2025-02-01 13:45:16 +13:00
return (QCborTag)(C.QCborValue_tag1(this.h, (C.uint64_t)(defaultValue)))
}
func (this *QCborValue) TaggedValue1(defaultValue *QCborValue) *QCborValue {
2025-02-01 13:45:16 +13:00
_goptr := newQCborValue(C.QCborValue_taggedValue1(this.h, defaultValue.cPointer()))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValue) ToByteArray1(defaultValue []byte) []byte {
defaultValue_alias := C.struct_miqt_string{}
if len(defaultValue) > 0 {
defaultValue_alias.data = (*C.char)(unsafe.Pointer(&defaultValue[0]))
} else {
defaultValue_alias.data = (*C.char)(unsafe.Pointer(nil))
}
defaultValue_alias.len = C.size_t(len(defaultValue))
2025-02-01 13:45:16 +13:00
var _bytearray C.struct_miqt_string = C.QCborValue_toByteArray1(this.h, defaultValue_alias)
_ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len)))
C.free(unsafe.Pointer(_bytearray.data))
return _ret
}
func (this *QCborValue) ToString1(defaultValue string) string {
defaultValue_ms := C.struct_miqt_string{}
defaultValue_ms.data = C.CString(defaultValue)
defaultValue_ms.len = C.size_t(len(defaultValue))
defer C.free(unsafe.Pointer(defaultValue_ms.data))
2025-02-01 13:45:16 +13:00
var _ms C.struct_miqt_string = C.QCborValue_toString1(this.h, defaultValue_ms)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QCborValue) ToDateTime1(defaultValue *qt.QDateTime) *qt.QDateTime {
2025-02-01 13:45:16 +13:00
_goptr := qt.UnsafeNewQDateTime(unsafe.Pointer(C.QCborValue_toDateTime1(this.h, (*C.QDateTime)(defaultValue.UnsafePointer()))))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValue) ToUrl1(defaultValue *qt.QUrl) *qt.QUrl {
2025-02-01 13:45:16 +13:00
_goptr := qt.UnsafeNewQUrl(unsafe.Pointer(C.QCborValue_toUrl1(this.h, (*C.QUrl)(defaultValue.UnsafePointer()))))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValue) ToRegularExpression1(defaultValue *qt.QRegularExpression) *qt.QRegularExpression {
2025-02-01 13:45:16 +13:00
_goptr := qt.UnsafeNewQRegularExpression(unsafe.Pointer(C.QCborValue_toRegularExpression1(this.h, (*C.QRegularExpression)(defaultValue.UnsafePointer()))))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValue) ToUuid1(defaultValue *qt.QUuid) *qt.QUuid {
2025-02-01 13:45:16 +13:00
_goptr := qt.UnsafeNewQUuid(unsafe.Pointer(C.QCborValue_toUuid1(this.h, (*C.QUuid)(defaultValue.UnsafePointer()))))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func QCborValue_FromCbor22(ba []byte, error *QCborParserError) *QCborValue {
ba_alias := C.struct_miqt_string{}
if len(ba) > 0 {
ba_alias.data = (*C.char)(unsafe.Pointer(&ba[0]))
} else {
ba_alias.data = (*C.char)(unsafe.Pointer(nil))
}
ba_alias.len = C.size_t(len(ba))
2025-02-01 13:45:16 +13:00
_goptr := newQCborValue(C.QCborValue_fromCbor22(ba_alias, error.cPointer()))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func QCborValue_FromCbor32(data string, lenVal int64, error *QCborParserError) *QCborValue {
data_Cstring := C.CString(data)
defer C.free(unsafe.Pointer(data_Cstring))
2025-02-01 13:45:16 +13:00
_goptr := newQCborValue(C.QCborValue_fromCbor32(data_Cstring, (C.ptrdiff_t)(lenVal), error.cPointer()))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func QCborValue_FromCbor33(data *byte, lenVal int64, error *QCborParserError) *QCborValue {
2025-02-01 13:45:16 +13:00
_goptr := newQCborValue(C.QCborValue_fromCbor33((*C.uchar)(unsafe.Pointer(data)), (C.ptrdiff_t)(lenVal), error.cPointer()))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValue) ToCbor1(opt QCborValue__EncodingOption) []byte {
2025-02-01 13:45:16 +13:00
var _bytearray C.struct_miqt_string = C.QCborValue_toCbor1(this.h, (C.int)(opt))
_ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len)))
C.free(unsafe.Pointer(_bytearray.data))
return _ret
2024-08-29 19:01:51 +12:00
}
func (this *QCborValue) ToCbor2(writer *QCborStreamWriter, opt QCborValue__EncodingOption) {
2025-02-01 13:45:16 +13:00
C.QCborValue_toCbor2(this.h, writer.cPointer(), (C.int)(opt))
2024-08-29 19:01:51 +12:00
}
func (this *QCborValue) ToDiagnosticNotation1(opts QCborValue__DiagnosticNotationOption) string {
2025-02-01 13:45:16 +13:00
var _ms C.struct_miqt_string = C.QCborValue_toDiagnosticNotation1(this.h, (C.int)(opts))
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
2024-08-29 19:01:51 +12:00
}
// Delete this object from C++ memory.
func (this *QCborValue) Delete() {
2025-02-01 13:45:16 +13:00
C.QCborValue_delete(this.h)
}
// 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 *QCborValue) GoGC() {
runtime.SetFinalizer(this, func(this *QCborValue) {
this.Delete()
runtime.KeepAlive(this.h)
})
}
type QCborValueRef struct {
h *C.QCborValueRef
}
func (this *QCborValueRef) cPointer() *C.QCborValueRef {
if this == nil {
return nil
}
return this.h
}
func (this *QCborValueRef) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 19:29:06 +13:00
// newQCborValueRef constructs the type using only CGO pointers.
func newQCborValueRef(h *C.QCborValueRef) *QCborValueRef {
2024-09-01 14:23:55 +12:00
if h == nil {
return nil
}
2024-12-07 17:15:57 +13:00
return &QCborValueRef{h: h}
}
2024-11-19 19:29:06 +13:00
// UnsafeNewQCborValueRef constructs the type using only unsafe pointers.
func UnsafeNewQCborValueRef(h unsafe.Pointer) *QCborValueRef {
2024-12-07 17:15:57 +13:00
return newQCborValueRef((*C.QCborValueRef)(h))
}
// NewQCborValueRef constructs a new QCborValueRef object.
func NewQCborValueRef(param1 *QCborValueRef) *QCborValueRef {
2024-11-19 19:29:06 +13:00
return newQCborValueRef(C.QCborValueRef_new(param1.cPointer()))
}
2025-01-04 12:19:04 +13:00
func (this *QCborValueRef) ToQCborValue() *QCborValue {
_goptr := newQCborValue(C.QCborValueRef_ToQCborValue(this.h))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValueRef) OperatorAssign(other *QCborValue) {
2025-02-01 13:45:16 +13:00
C.QCborValueRef_operatorAssign(this.h, other.cPointer())
}
func (this *QCborValueRef) OperatorAssignWithOther(other *QCborValueRef) {
2025-02-01 13:45:16 +13:00
C.QCborValueRef_operatorAssignWithOther(this.h, other.cPointer())
}
2024-09-04 18:54:22 +12:00
func (this *QCborValueRef) Type() QCborValue__Type {
2025-02-01 13:45:16 +13:00
return (QCborValue__Type)(C.QCborValueRef_type(this.h))
2024-08-29 19:01:51 +12:00
}
func (this *QCborValueRef) IsInteger() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValueRef_isInteger(this.h))
}
func (this *QCborValueRef) IsByteArray() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValueRef_isByteArray(this.h))
}
func (this *QCborValueRef) IsString() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValueRef_isString(this.h))
}
func (this *QCborValueRef) IsArray() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValueRef_isArray(this.h))
}
func (this *QCborValueRef) IsMap() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValueRef_isMap(this.h))
}
func (this *QCborValueRef) IsTag() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValueRef_isTag(this.h))
}
func (this *QCborValueRef) IsFalse() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValueRef_isFalse(this.h))
}
func (this *QCborValueRef) IsTrue() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValueRef_isTrue(this.h))
}
func (this *QCborValueRef) IsBool() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValueRef_isBool(this.h))
}
func (this *QCborValueRef) IsNull() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValueRef_isNull(this.h))
}
func (this *QCborValueRef) IsUndefined() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValueRef_isUndefined(this.h))
}
func (this *QCborValueRef) IsDouble() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValueRef_isDouble(this.h))
}
func (this *QCborValueRef) IsDateTime() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValueRef_isDateTime(this.h))
}
func (this *QCborValueRef) IsUrl() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValueRef_isUrl(this.h))
}
func (this *QCborValueRef) IsRegularExpression() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValueRef_isRegularExpression(this.h))
}
func (this *QCborValueRef) IsUuid() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValueRef_isUuid(this.h))
}
func (this *QCborValueRef) IsInvalid() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValueRef_isInvalid(this.h))
}
func (this *QCborValueRef) IsContainer() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValueRef_isContainer(this.h))
}
func (this *QCborValueRef) IsSimpleType() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValueRef_isSimpleType(this.h))
}
func (this *QCborValueRef) IsSimpleTypeWithSt(st QCborSimpleType) bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValueRef_isSimpleTypeWithSt(this.h, (C.uint8_t)(st)))
}
func (this *QCborValueRef) Tag() QCborTag {
2025-02-01 13:45:16 +13:00
return (QCborTag)(C.QCborValueRef_tag(this.h))
}
func (this *QCborValueRef) TaggedValue() *QCborValue {
2025-02-01 13:45:16 +13:00
_goptr := newQCborValue(C.QCborValueRef_taggedValue(this.h))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValueRef) ToInteger() int64 {
2025-02-01 13:45:16 +13:00
return (int64)(C.QCborValueRef_toInteger(this.h))
}
func (this *QCborValueRef) ToBool() bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValueRef_toBool(this.h))
}
func (this *QCborValueRef) ToDouble() float64 {
2025-02-01 13:45:16 +13:00
return (float64)(C.QCborValueRef_toDouble(this.h))
}
func (this *QCborValueRef) ToByteArray() []byte {
2025-02-01 13:45:16 +13:00
var _bytearray C.struct_miqt_string = C.QCborValueRef_toByteArray(this.h)
_ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len)))
C.free(unsafe.Pointer(_bytearray.data))
return _ret
}
func (this *QCborValueRef) ToString() string {
2025-02-01 13:45:16 +13:00
var _ms C.struct_miqt_string = C.QCborValueRef_toString(this.h)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QCborValueRef) ToDateTime() *qt.QDateTime {
2025-02-01 13:45:16 +13:00
_goptr := qt.UnsafeNewQDateTime(unsafe.Pointer(C.QCborValueRef_toDateTime(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValueRef) ToUrl() *qt.QUrl {
2025-02-01 13:45:16 +13:00
_goptr := qt.UnsafeNewQUrl(unsafe.Pointer(C.QCborValueRef_toUrl(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValueRef) ToRegularExpression() *qt.QRegularExpression {
2025-02-01 13:45:16 +13:00
_goptr := qt.UnsafeNewQRegularExpression(unsafe.Pointer(C.QCborValueRef_toRegularExpression(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValueRef) ToUuid() *qt.QUuid {
2025-02-01 13:45:16 +13:00
_goptr := qt.UnsafeNewQUuid(unsafe.Pointer(C.QCborValueRef_toUuid(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValueRef) ToArray() *QCborArray {
2025-02-01 13:45:16 +13:00
_goptr := newQCborArray(C.QCborValueRef_toArray(this.h))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValueRef) ToArrayWithQCborArray(a *QCborArray) *QCborArray {
2025-02-01 13:45:16 +13:00
_goptr := newQCborArray(C.QCborValueRef_toArrayWithQCborArray(this.h, a.cPointer()))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValueRef) ToMap() *QCborMap {
2025-02-01 13:45:16 +13:00
_goptr := newQCborMap(C.QCborValueRef_toMap(this.h))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValueRef) ToMapWithQCborMap(m *QCborMap) *QCborMap {
2025-02-01 13:45:16 +13:00
_goptr := newQCborMap(C.QCborValueRef_toMapWithQCborMap(this.h, m.cPointer()))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValueRef) OperatorSubscript(key string) *QCborValue {
key_ms := C.struct_miqt_string{}
key_ms.data = C.CString(key)
key_ms.len = C.size_t(len(key))
defer C.free(unsafe.Pointer(key_ms.data))
2025-02-01 13:45:16 +13:00
_goptr := newQCborValue(C.QCborValueRef_operatorSubscript(this.h, key_ms))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
2024-08-29 19:01:51 +12:00
func (this *QCborValueRef) OperatorSubscript2(key int64) *QCborValue {
2025-02-01 13:45:16 +13:00
_goptr := newQCborValue(C.QCborValueRef_operatorSubscript2(this.h, (C.longlong)(key)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
2024-08-29 19:01:51 +12:00
func (this *QCborValueRef) OperatorSubscript3(key int64) *QCborValueRef {
2025-02-01 13:45:16 +13:00
_goptr := newQCborValueRef(C.QCborValueRef_operatorSubscript3(this.h, (C.longlong)(key)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
2024-08-29 19:01:51 +12:00
func (this *QCborValueRef) OperatorSubscript5(key string) *QCborValueRef {
key_ms := C.struct_miqt_string{}
key_ms.data = C.CString(key)
key_ms.len = C.size_t(len(key))
defer C.free(unsafe.Pointer(key_ms.data))
2025-02-01 13:45:16 +13:00
_goptr := newQCborValueRef(C.QCborValueRef_operatorSubscript5(this.h, key_ms))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValueRef) Compare(other *QCborValue) int {
2025-02-01 13:45:16 +13:00
return (int)(C.QCborValueRef_compare(this.h, other.cPointer()))
}
func (this *QCborValueRef) OperatorEqual(other *QCborValue) bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValueRef_operatorEqual(this.h, other.cPointer()))
}
func (this *QCborValueRef) OperatorNotEqual(other *QCborValue) bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValueRef_operatorNotEqual(this.h, other.cPointer()))
}
func (this *QCborValueRef) OperatorLesser(other *QCborValue) bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValueRef_operatorLesser(this.h, other.cPointer()))
}
func (this *QCborValueRef) ToVariant() *qt.QVariant {
2025-02-01 13:45:16 +13:00
_goptr := qt.UnsafeNewQVariant(unsafe.Pointer(C.QCborValueRef_toVariant(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValueRef) ToJsonValue() *qt.QJsonValue {
2025-02-01 13:45:16 +13:00
_goptr := qt.UnsafeNewQJsonValue(unsafe.Pointer(C.QCborValueRef_toJsonValue(this.h)))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValueRef) ToCbor() []byte {
2025-02-01 13:45:16 +13:00
var _bytearray C.struct_miqt_string = C.QCborValueRef_toCbor(this.h)
_ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len)))
C.free(unsafe.Pointer(_bytearray.data))
return _ret
2024-08-29 19:01:51 +12:00
}
func (this *QCborValueRef) ToCborWithWriter(writer *QCborStreamWriter) {
2025-02-01 13:45:16 +13:00
C.QCborValueRef_toCborWithWriter(this.h, writer.cPointer())
2024-08-29 19:01:51 +12:00
}
func (this *QCborValueRef) ToDiagnosticNotation() string {
2025-02-01 13:45:16 +13:00
var _ms C.struct_miqt_string = C.QCborValueRef_toDiagnosticNotation(this.h)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
2024-08-29 19:01:51 +12:00
}
func (this *QCborValueRef) Tag1(defaultValue QCborTag) QCborTag {
2025-02-01 13:45:16 +13:00
return (QCborTag)(C.QCborValueRef_tag1(this.h, (C.uint64_t)(defaultValue)))
}
func (this *QCborValueRef) TaggedValue1(defaultValue *QCborValue) *QCborValue {
2025-02-01 13:45:16 +13:00
_goptr := newQCborValue(C.QCborValueRef_taggedValue1(this.h, defaultValue.cPointer()))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValueRef) ToInteger1(defaultValue int64) int64 {
2025-02-01 13:45:16 +13:00
return (int64)(C.QCborValueRef_toInteger1(this.h, (C.longlong)(defaultValue)))
}
func (this *QCborValueRef) ToBool1(defaultValue bool) bool {
2025-02-01 13:45:16 +13:00
return (bool)(C.QCborValueRef_toBool1(this.h, (C.bool)(defaultValue)))
}
func (this *QCborValueRef) ToDouble1(defaultValue float64) float64 {
2025-02-01 13:45:16 +13:00
return (float64)(C.QCborValueRef_toDouble1(this.h, (C.double)(defaultValue)))
}
func (this *QCborValueRef) ToByteArray1(defaultValue []byte) []byte {
defaultValue_alias := C.struct_miqt_string{}
if len(defaultValue) > 0 {
defaultValue_alias.data = (*C.char)(unsafe.Pointer(&defaultValue[0]))
} else {
defaultValue_alias.data = (*C.char)(unsafe.Pointer(nil))
}
defaultValue_alias.len = C.size_t(len(defaultValue))
2025-02-01 13:45:16 +13:00
var _bytearray C.struct_miqt_string = C.QCborValueRef_toByteArray1(this.h, defaultValue_alias)
_ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len)))
C.free(unsafe.Pointer(_bytearray.data))
return _ret
}
func (this *QCborValueRef) ToString1(defaultValue string) string {
defaultValue_ms := C.struct_miqt_string{}
defaultValue_ms.data = C.CString(defaultValue)
defaultValue_ms.len = C.size_t(len(defaultValue))
defer C.free(unsafe.Pointer(defaultValue_ms.data))
2025-02-01 13:45:16 +13:00
var _ms C.struct_miqt_string = C.QCborValueRef_toString1(this.h, defaultValue_ms)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QCborValueRef) ToDateTime1(defaultValue *qt.QDateTime) *qt.QDateTime {
2025-02-01 13:45:16 +13:00
_goptr := qt.UnsafeNewQDateTime(unsafe.Pointer(C.QCborValueRef_toDateTime1(this.h, (*C.QDateTime)(defaultValue.UnsafePointer()))))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValueRef) ToUrl1(defaultValue *qt.QUrl) *qt.QUrl {
2025-02-01 13:45:16 +13:00
_goptr := qt.UnsafeNewQUrl(unsafe.Pointer(C.QCborValueRef_toUrl1(this.h, (*C.QUrl)(defaultValue.UnsafePointer()))))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValueRef) ToRegularExpression1(defaultValue *qt.QRegularExpression) *qt.QRegularExpression {
2025-02-01 13:45:16 +13:00
_goptr := qt.UnsafeNewQRegularExpression(unsafe.Pointer(C.QCborValueRef_toRegularExpression1(this.h, (*C.QRegularExpression)(defaultValue.UnsafePointer()))))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValueRef) ToUuid1(defaultValue *qt.QUuid) *qt.QUuid {
2025-02-01 13:45:16 +13:00
_goptr := qt.UnsafeNewQUuid(unsafe.Pointer(C.QCborValueRef_toUuid1(this.h, (*C.QUuid)(defaultValue.UnsafePointer()))))
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QCborValueRef) ToCbor1(opt QCborValue__EncodingOption) []byte {
2025-02-01 13:45:16 +13:00
var _bytearray C.struct_miqt_string = C.QCborValueRef_toCbor1(this.h, (C.int)(opt))
_ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len)))
C.free(unsafe.Pointer(_bytearray.data))
return _ret
2024-08-29 19:01:51 +12:00
}
func (this *QCborValueRef) ToCbor2(writer *QCborStreamWriter, opt QCborValue__EncodingOption) {
2025-02-01 13:45:16 +13:00
C.QCborValueRef_toCbor2(this.h, writer.cPointer(), (C.int)(opt))
2024-08-29 19:01:51 +12:00
}
func (this *QCborValueRef) ToDiagnosticNotation1(opt QCborValue__DiagnosticNotationOption) string {
2025-02-01 13:45:16 +13:00
var _ms C.struct_miqt_string = C.QCborValueRef_toDiagnosticNotation1(this.h, (C.int)(opt))
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
2024-08-29 19:01:51 +12:00
}
// Delete this object from C++ memory.
func (this *QCborValueRef) Delete() {
2025-02-01 13:45:16 +13:00
C.QCborValueRef_delete(this.h)
}
// 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 *QCborValueRef) GoGC() {
runtime.SetFinalizer(this, func(this *QCborValueRef) {
this.Delete()
runtime.KeepAlive(this.h)
})
}