2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qjsonvalue.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
2024-10-16 05:07:56 +00:00
|
|
|
"github.com/mappu/miqt/libmiqt"
|
2024-08-25 04:08:24 +00:00
|
|
|
"runtime"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
type QJsonValue__Type int
|
|
|
|
|
|
|
|
const (
|
2024-09-20 07:13:26 +00:00
|
|
|
QJsonValue__Null QJsonValue__Type = 0
|
|
|
|
QJsonValue__Bool QJsonValue__Type = 1
|
|
|
|
QJsonValue__Double QJsonValue__Type = 2
|
|
|
|
QJsonValue__String QJsonValue__Type = 3
|
|
|
|
QJsonValue__Array QJsonValue__Type = 4
|
|
|
|
QJsonValue__Object QJsonValue__Type = 5
|
|
|
|
QJsonValue__Undefined QJsonValue__Type = 128
|
2024-09-04 06:54:22 +00:00
|
|
|
)
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QJsonValue struct {
|
|
|
|
h *C.QJsonValue
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValue) cPointer() *C.QJsonValue {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QJsonValue) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQJsonValue(h *C.QJsonValue) *QJsonValue {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QJsonValue{h: h}
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQJsonValue(h unsafe.Pointer) *QJsonValue {
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQJsonValue((*C.QJsonValue)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQJsonValue constructs a new QJsonValue object.
|
2024-08-29 07:01:51 +00:00
|
|
|
func NewQJsonValue() *QJsonValue {
|
|
|
|
ret := C.QJsonValue_new()
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQJsonValue(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQJsonValue2 constructs a new QJsonValue object.
|
2024-08-29 07:01:51 +00:00
|
|
|
func NewQJsonValue2(b bool) *QJsonValue {
|
|
|
|
ret := C.QJsonValue_new2((C.bool)(b))
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQJsonValue(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQJsonValue3 constructs a new QJsonValue object.
|
2024-08-29 07:01:51 +00:00
|
|
|
func NewQJsonValue3(n float64) *QJsonValue {
|
|
|
|
ret := C.QJsonValue_new3((C.double)(n))
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQJsonValue(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQJsonValue4 constructs a new QJsonValue object.
|
2024-08-29 07:01:51 +00:00
|
|
|
func NewQJsonValue4(n int) *QJsonValue {
|
|
|
|
ret := C.QJsonValue_new4((C.int)(n))
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQJsonValue(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQJsonValue5 constructs a new QJsonValue object.
|
2024-08-29 07:01:51 +00:00
|
|
|
func NewQJsonValue5(v int64) *QJsonValue {
|
|
|
|
ret := C.QJsonValue_new5((C.longlong)(v))
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQJsonValue(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQJsonValue6 constructs a new QJsonValue object.
|
|
|
|
func NewQJsonValue6(s string) *QJsonValue {
|
2024-10-16 05:07:56 +00:00
|
|
|
s_ms := libmiqt.Strdupg(s)
|
2024-09-14 22:29:05 +00:00
|
|
|
defer C.free(s_ms)
|
|
|
|
ret := C.QJsonValue_new6((*C.struct_miqt_string)(s_ms))
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQJsonValue(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQJsonValue7 constructs a new QJsonValue object.
|
2024-08-29 07:01:51 +00:00
|
|
|
func NewQJsonValue7(s string) *QJsonValue {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
|
|
|
ret := C.QJsonValue_new7(s_Cstring)
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQJsonValue(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQJsonValue8 constructs a new QJsonValue object.
|
2024-08-29 07:01:51 +00:00
|
|
|
func NewQJsonValue8(a *QJsonArray) *QJsonValue {
|
|
|
|
ret := C.QJsonValue_new8(a.cPointer())
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQJsonValue(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQJsonValue9 constructs a new QJsonValue object.
|
2024-08-29 07:01:51 +00:00
|
|
|
func NewQJsonValue9(o *QJsonObject) *QJsonValue {
|
|
|
|
ret := C.QJsonValue_new9(o.cPointer())
|
|
|
|
return newQJsonValue(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQJsonValue10 constructs a new QJsonValue object.
|
|
|
|
func NewQJsonValue10(other *QJsonValue) *QJsonValue {
|
|
|
|
ret := C.QJsonValue_new10(other.cPointer())
|
|
|
|
return newQJsonValue(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQJsonValue11 constructs a new QJsonValue object.
|
2024-09-04 06:54:22 +00:00
|
|
|
func NewQJsonValue11(param1 QJsonValue__Type) *QJsonValue {
|
2024-09-18 00:12:02 +00:00
|
|
|
ret := C.QJsonValue_new11((C.int)(param1))
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQJsonValue(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValue) OperatorAssign(other *QJsonValue) {
|
|
|
|
C.QJsonValue_OperatorAssign(this.h, other.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValue) Swap(other *QJsonValue) {
|
|
|
|
C.QJsonValue_Swap(this.h, other.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func QJsonValue_FromVariant(variant *QVariant) *QJsonValue {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QJsonValue_FromVariant(variant.cPointer())
|
|
|
|
_goptr := newQJsonValue(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValue) ToVariant() *QVariant {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QJsonValue_ToVariant(this.h)
|
|
|
|
_goptr := newQVariant(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QJsonValue) Type() QJsonValue__Type {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (QJsonValue__Type)(C.QJsonValue_Type(this.h))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QJsonValue) IsNull() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QJsonValue_IsNull(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValue) IsBool() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QJsonValue_IsBool(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValue) IsDouble() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QJsonValue_IsDouble(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValue) IsString() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QJsonValue_IsString(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValue) IsArray() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QJsonValue_IsArray(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValue) IsObject() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QJsonValue_IsObject(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValue) IsUndefined() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QJsonValue_IsUndefined(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValue) ToBool() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QJsonValue_ToBool(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValue) ToInt() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QJsonValue_ToInt(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValue) ToDouble() float64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float64)(C.QJsonValue_ToDouble(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValue) ToString() string {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QJsonValue_ToString(this.h)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValue) ToStringWithDefaultValue(defaultValue string) string {
|
2024-10-16 05:07:56 +00:00
|
|
|
defaultValue_ms := libmiqt.Strdupg(defaultValue)
|
2024-09-14 22:29:05 +00:00
|
|
|
defer C.free(defaultValue_ms)
|
|
|
|
var _ms *C.struct_miqt_string = C.QJsonValue_ToStringWithDefaultValue(this.h, (*C.struct_miqt_string)(defaultValue_ms))
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValue) ToArray() *QJsonArray {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QJsonValue_ToArray(this.h)
|
|
|
|
_goptr := newQJsonArray(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValue) ToArrayWithDefaultValue(defaultValue *QJsonArray) *QJsonArray {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QJsonValue_ToArrayWithDefaultValue(this.h, defaultValue.cPointer())
|
|
|
|
_goptr := newQJsonArray(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValue) ToObject() *QJsonObject {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QJsonValue_ToObject(this.h)
|
|
|
|
_goptr := newQJsonObject(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValue) ToObjectWithDefaultValue(defaultValue *QJsonObject) *QJsonObject {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QJsonValue_ToObjectWithDefaultValue(this.h, defaultValue.cPointer())
|
|
|
|
_goptr := newQJsonObject(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValue) OperatorSubscript(key string) *QJsonValue {
|
2024-10-16 05:07:56 +00:00
|
|
|
key_ms := libmiqt.Strdupg(key)
|
2024-09-14 22:29:05 +00:00
|
|
|
defer C.free(key_ms)
|
|
|
|
_ret := C.QJsonValue_OperatorSubscript(this.h, (*C.struct_miqt_string)(key_ms))
|
|
|
|
_goptr := newQJsonValue(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValue) OperatorSubscriptWithInt(i int) *QJsonValue {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QJsonValue_OperatorSubscriptWithInt(this.h, (C.int)(i))
|
|
|
|
_goptr := newQJsonValue(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValue) OperatorEqual(other *QJsonValue) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QJsonValue_OperatorEqual(this.h, other.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValue) OperatorNotEqual(other *QJsonValue) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QJsonValue_OperatorNotEqual(this.h, other.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValue) ToBool1(defaultValue bool) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QJsonValue_ToBool1(this.h, (C.bool)(defaultValue)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValue) ToInt1(defaultValue int) int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QJsonValue_ToInt1(this.h, (C.int)(defaultValue)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValue) ToDouble1(defaultValue float64) float64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float64)(C.QJsonValue_ToDouble1(this.h, (C.double)(defaultValue)))
|
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 *QJsonValue) Delete() {
|
|
|
|
C.QJsonValue_Delete(this.h)
|
|
|
|
}
|
|
|
|
|
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 *QJsonValue) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QJsonValue) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QJsonValueRef struct {
|
|
|
|
h *C.QJsonValueRef
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValueRef) cPointer() *C.QJsonValueRef {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QJsonValueRef) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQJsonValueRef(h *C.QJsonValueRef) *QJsonValueRef {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QJsonValueRef{h: h}
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQJsonValueRef(h unsafe.Pointer) *QJsonValueRef {
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQJsonValueRef((*C.QJsonValueRef)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQJsonValueRef constructs a new QJsonValueRef object.
|
|
|
|
func NewQJsonValueRef(param1 *QJsonValueRef) *QJsonValueRef {
|
|
|
|
ret := C.QJsonValueRef_new(param1.cPointer())
|
|
|
|
return newQJsonValueRef(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQJsonValueRef2 constructs a new QJsonValueRef object.
|
|
|
|
func NewQJsonValueRef2(array *QJsonArray, idx int) *QJsonValueRef {
|
|
|
|
ret := C.QJsonValueRef_new2(array.cPointer(), (C.int)(idx))
|
|
|
|
return newQJsonValueRef(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQJsonValueRef3 constructs a new QJsonValueRef object.
|
|
|
|
func NewQJsonValueRef3(object *QJsonObject, idx int) *QJsonValueRef {
|
|
|
|
ret := C.QJsonValueRef_new3(object.cPointer(), (C.int)(idx))
|
|
|
|
return newQJsonValueRef(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValueRef) OperatorAssign(val *QJsonValue) {
|
|
|
|
C.QJsonValueRef_OperatorAssign(this.h, val.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValueRef) OperatorAssignWithVal(val *QJsonValueRef) {
|
|
|
|
C.QJsonValueRef_OperatorAssignWithVal(this.h, val.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValueRef) ToVariant() *QVariant {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QJsonValueRef_ToVariant(this.h)
|
|
|
|
_goptr := newQVariant(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QJsonValueRef) Type() QJsonValue__Type {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (QJsonValue__Type)(C.QJsonValueRef_Type(this.h))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QJsonValueRef) IsNull() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QJsonValueRef_IsNull(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValueRef) IsBool() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QJsonValueRef_IsBool(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValueRef) IsDouble() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QJsonValueRef_IsDouble(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValueRef) IsString() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QJsonValueRef_IsString(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValueRef) IsArray() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QJsonValueRef_IsArray(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValueRef) IsObject() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QJsonValueRef_IsObject(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValueRef) IsUndefined() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QJsonValueRef_IsUndefined(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValueRef) ToBool() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QJsonValueRef_ToBool(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValueRef) ToInt() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QJsonValueRef_ToInt(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValueRef) ToDouble() float64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float64)(C.QJsonValueRef_ToDouble(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValueRef) ToString() string {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QJsonValueRef_ToString(this.h)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValueRef) ToArray() *QJsonArray {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QJsonValueRef_ToArray(this.h)
|
|
|
|
_goptr := newQJsonArray(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValueRef) ToObject() *QJsonObject {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QJsonValueRef_ToObject(this.h)
|
|
|
|
_goptr := newQJsonObject(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValueRef) ToBoolWithDefaultValue(defaultValue bool) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QJsonValueRef_ToBoolWithDefaultValue(this.h, (C.bool)(defaultValue)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValueRef) ToIntWithDefaultValue(defaultValue int) int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QJsonValueRef_ToIntWithDefaultValue(this.h, (C.int)(defaultValue)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValueRef) ToDoubleWithDefaultValue(defaultValue float64) float64 {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (float64)(C.QJsonValueRef_ToDoubleWithDefaultValue(this.h, (C.double)(defaultValue)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValueRef) ToStringWithDefaultValue(defaultValue string) string {
|
2024-10-16 05:07:56 +00:00
|
|
|
defaultValue_ms := libmiqt.Strdupg(defaultValue)
|
2024-09-14 22:29:05 +00:00
|
|
|
defer C.free(defaultValue_ms)
|
|
|
|
var _ms *C.struct_miqt_string = C.QJsonValueRef_ToStringWithDefaultValue(this.h, (*C.struct_miqt_string)(defaultValue_ms))
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValueRef) OperatorEqual(other *QJsonValue) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QJsonValueRef_OperatorEqual(this.h, other.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValueRef) OperatorNotEqual(other *QJsonValue) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QJsonValueRef_OperatorNotEqual(this.h, other.cPointer()))
|
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 *QJsonValueRef) Delete() {
|
|
|
|
C.QJsonValueRef_Delete(this.h)
|
|
|
|
}
|
|
|
|
|
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 *QJsonValueRef) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QJsonValueRef) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QJsonValuePtr struct {
|
|
|
|
h *C.QJsonValuePtr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValuePtr) cPointer() *C.QJsonValuePtr {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QJsonValuePtr) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQJsonValuePtr(h *C.QJsonValuePtr) *QJsonValuePtr {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QJsonValuePtr{h: h}
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQJsonValuePtr(h unsafe.Pointer) *QJsonValuePtr {
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQJsonValuePtr((*C.QJsonValuePtr)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQJsonValuePtr constructs a new QJsonValuePtr object.
|
|
|
|
func NewQJsonValuePtr(val *QJsonValue) *QJsonValuePtr {
|
|
|
|
ret := C.QJsonValuePtr_new(val.cPointer())
|
|
|
|
return newQJsonValuePtr(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQJsonValuePtr2 constructs a new QJsonValuePtr object.
|
|
|
|
func NewQJsonValuePtr2(param1 *QJsonValuePtr) *QJsonValuePtr {
|
|
|
|
ret := C.QJsonValuePtr_new2(param1.cPointer())
|
|
|
|
return newQJsonValuePtr(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValuePtr) OperatorMultiply() *QJsonValue {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQJsonValue(unsafe.Pointer(C.QJsonValuePtr_OperatorMultiply(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValuePtr) OperatorMinusGreater() *QJsonValue {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQJsonValue(unsafe.Pointer(C.QJsonValuePtr_OperatorMinusGreater(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValuePtr) OperatorAssign(param1 *QJsonValuePtr) {
|
|
|
|
C.QJsonValuePtr_OperatorAssign(this.h, param1.cPointer())
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QJsonValuePtr) Delete() {
|
|
|
|
C.QJsonValuePtr_Delete(this.h)
|
|
|
|
}
|
|
|
|
|
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 *QJsonValuePtr) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QJsonValuePtr) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QJsonValueRefPtr struct {
|
|
|
|
h *C.QJsonValueRefPtr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValueRefPtr) cPointer() *C.QJsonValueRefPtr {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QJsonValueRefPtr) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQJsonValueRefPtr(h *C.QJsonValueRefPtr) *QJsonValueRefPtr {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QJsonValueRefPtr{h: h}
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQJsonValueRefPtr(h unsafe.Pointer) *QJsonValueRefPtr {
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQJsonValueRefPtr((*C.QJsonValueRefPtr)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQJsonValueRefPtr constructs a new QJsonValueRefPtr object.
|
|
|
|
func NewQJsonValueRefPtr(array *QJsonArray, idx int) *QJsonValueRefPtr {
|
|
|
|
ret := C.QJsonValueRefPtr_new(array.cPointer(), (C.int)(idx))
|
|
|
|
return newQJsonValueRefPtr(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQJsonValueRefPtr2 constructs a new QJsonValueRefPtr object.
|
|
|
|
func NewQJsonValueRefPtr2(object *QJsonObject, idx int) *QJsonValueRefPtr {
|
|
|
|
ret := C.QJsonValueRefPtr_new2(object.cPointer(), (C.int)(idx))
|
|
|
|
return newQJsonValueRefPtr(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQJsonValueRefPtr3 constructs a new QJsonValueRefPtr object.
|
|
|
|
func NewQJsonValueRefPtr3(param1 *QJsonValueRefPtr) *QJsonValueRefPtr {
|
|
|
|
ret := C.QJsonValueRefPtr_new3(param1.cPointer())
|
|
|
|
return newQJsonValueRefPtr(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValueRefPtr) OperatorMultiply() *QJsonValueRef {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQJsonValueRef(unsafe.Pointer(C.QJsonValueRefPtr_OperatorMultiply(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValueRefPtr) OperatorMinusGreater() *QJsonValueRef {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQJsonValueRef(unsafe.Pointer(C.QJsonValueRefPtr_OperatorMinusGreater(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QJsonValueRefPtr) OperatorAssign(param1 *QJsonValueRefPtr) {
|
|
|
|
C.QJsonValueRefPtr_OperatorAssign(this.h, param1.cPointer())
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QJsonValueRefPtr) Delete() {
|
|
|
|
C.QJsonValueRefPtr_Delete(this.h)
|
|
|
|
}
|
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 *QJsonValueRefPtr) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QJsonValueRefPtr) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|