2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_quuid.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
type QUuid__Variant int
|
|
|
|
|
|
|
|
const (
|
2024-09-20 07:13:26 +00:00
|
|
|
QUuid__VarUnknown QUuid__Variant = -1
|
|
|
|
QUuid__NCS QUuid__Variant = 0
|
|
|
|
QUuid__DCE QUuid__Variant = 2
|
|
|
|
QUuid__Microsoft QUuid__Variant = 6
|
|
|
|
QUuid__Reserved QUuid__Variant = 7
|
2024-09-04 06:54:22 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type QUuid__Version int
|
|
|
|
|
|
|
|
const (
|
2024-09-20 07:13:26 +00:00
|
|
|
QUuid__VerUnknown QUuid__Version = -1
|
|
|
|
QUuid__Time QUuid__Version = 1
|
|
|
|
QUuid__EmbeddedPOSIX QUuid__Version = 2
|
|
|
|
QUuid__Md5 QUuid__Version = 3
|
|
|
|
QUuid__Name QUuid__Version = 3
|
|
|
|
QUuid__Random QUuid__Version = 4
|
|
|
|
QUuid__Sha1 QUuid__Version = 5
|
2024-09-04 06:54:22 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type QUuid__StringFormat int
|
|
|
|
|
|
|
|
const (
|
2024-09-20 07:13:26 +00:00
|
|
|
QUuid__WithBraces QUuid__StringFormat = 0
|
|
|
|
QUuid__WithoutBraces QUuid__StringFormat = 1
|
|
|
|
QUuid__Id128 QUuid__StringFormat = 3
|
2024-09-04 06:54:22 +00:00
|
|
|
)
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QUuid struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QUuid
|
|
|
|
isSubclass bool
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QUuid) cPointer() *C.QUuid {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QUuid) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQUuid constructs the type using only CGO pointers.
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQUuid(h *C.QUuid) *QUuid {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QUuid{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQUuid constructs the type using only unsafe pointers.
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQUuid(h unsafe.Pointer) *QUuid {
|
2024-11-19 06:29:06 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
return &QUuid{h: (*C.QUuid)(h)}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQUuid constructs a new QUuid object.
|
|
|
|
func NewQUuid() *QUuid {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QUuid *C.QUuid = nil
|
|
|
|
|
|
|
|
C.QUuid_new(&outptr_QUuid)
|
|
|
|
ret := newQUuid(outptr_QUuid)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQUuid2 constructs a new QUuid object.
|
|
|
|
func NewQUuid2(l uint, w1 uint16, w2 uint16, b1 byte, b2 byte, b3 byte, b4 byte, b5 byte, b6 byte, b7 byte, b8 byte) *QUuid {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QUuid *C.QUuid = nil
|
|
|
|
|
|
|
|
C.QUuid_new2((C.uint)(l), (C.uint16_t)(w1), (C.uint16_t)(w2), (C.uchar)(b1), (C.uchar)(b2), (C.uchar)(b3), (C.uchar)(b4), (C.uchar)(b5), (C.uchar)(b6), (C.uchar)(b7), (C.uchar)(b8), &outptr_QUuid)
|
|
|
|
ret := newQUuid(outptr_QUuid)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQUuid3 constructs a new QUuid object.
|
|
|
|
func NewQUuid3(param1 string) *QUuid {
|
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))
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QUuid *C.QUuid = nil
|
|
|
|
|
|
|
|
C.QUuid_new3(param1_ms, &outptr_QUuid)
|
|
|
|
ret := newQUuid(outptr_QUuid)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQUuid4 constructs a new QUuid object.
|
|
|
|
func NewQUuid4(param1 string) *QUuid {
|
|
|
|
param1_Cstring := C.CString(param1)
|
|
|
|
defer C.free(unsafe.Pointer(param1_Cstring))
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QUuid *C.QUuid = nil
|
|
|
|
|
|
|
|
C.QUuid_new4(param1_Cstring, &outptr_QUuid)
|
|
|
|
ret := newQUuid(outptr_QUuid)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQUuid5 constructs a new QUuid object.
|
2024-10-18 23:53:33 +00:00
|
|
|
func NewQUuid5(param1 []byte) *QUuid {
|
|
|
|
param1_alias := C.struct_miqt_string{}
|
|
|
|
param1_alias.data = (*C.char)(unsafe.Pointer(¶m1[0]))
|
|
|
|
param1_alias.len = C.size_t(len(param1))
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QUuid *C.QUuid = nil
|
|
|
|
|
|
|
|
C.QUuid_new5(param1_alias, &outptr_QUuid)
|
|
|
|
ret := newQUuid(outptr_QUuid)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQUuid6 constructs a new QUuid object.
|
|
|
|
func NewQUuid6(param1 *QUuid) *QUuid {
|
2024-11-19 06:29:06 +00:00
|
|
|
var outptr_QUuid *C.QUuid = nil
|
|
|
|
|
|
|
|
C.QUuid_new6(param1.cPointer(), &outptr_QUuid)
|
|
|
|
ret := newQUuid(outptr_QUuid)
|
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QUuid) ToString() string {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QUuid_ToString(this.h)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QUuid) ToStringWithMode(mode QUuid__StringFormat) string {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QUuid_ToStringWithMode(this.h, (C.int)(mode))
|
|
|
|
_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 *QUuid) ToByteArray() []byte {
|
|
|
|
var _bytearray C.struct_miqt_string = C.QUuid_ToByteArray(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 *QUuid) ToByteArrayWithMode(mode QUuid__StringFormat) []byte {
|
|
|
|
var _bytearray C.struct_miqt_string = C.QUuid_ToByteArrayWithMode(this.h, (C.int)(mode))
|
|
|
|
_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-10-18 23:53:33 +00:00
|
|
|
func (this *QUuid) ToRfc4122() []byte {
|
|
|
|
var _bytearray C.struct_miqt_string = C.QUuid_ToRfc4122(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 QUuid_FromRfc4122(param1 []byte) *QUuid {
|
|
|
|
param1_alias := C.struct_miqt_string{}
|
|
|
|
param1_alias.data = (*C.char)(unsafe.Pointer(¶m1[0]))
|
|
|
|
param1_alias.len = C.size_t(len(param1))
|
|
|
|
_ret := C.QUuid_FromRfc4122(param1_alias)
|
2024-09-14 22:29:05 +00:00
|
|
|
_goptr := newQUuid(_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 *QUuid) IsNull() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QUuid_IsNull(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QUuid) OperatorEqual(orig *QUuid) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QUuid_OperatorEqual(this.h, orig.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QUuid) OperatorNotEqual(orig *QUuid) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QUuid_OperatorNotEqual(this.h, orig.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QUuid) OperatorLesser(other *QUuid) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QUuid_OperatorLesser(this.h, other.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QUuid) OperatorGreater(other *QUuid) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QUuid_OperatorGreater(this.h, other.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QUuid_CreateUuid() *QUuid {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QUuid_CreateUuid()
|
|
|
|
_goptr := newQUuid(_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-10-18 23:53:33 +00:00
|
|
|
func QUuid_CreateUuidV3(ns *QUuid, baseData []byte) *QUuid {
|
|
|
|
baseData_alias := C.struct_miqt_string{}
|
|
|
|
baseData_alias.data = (*C.char)(unsafe.Pointer(&baseData[0]))
|
|
|
|
baseData_alias.len = C.size_t(len(baseData))
|
|
|
|
_ret := C.QUuid_CreateUuidV3(ns.cPointer(), baseData_alias)
|
2024-09-14 22:29:05 +00:00
|
|
|
_goptr := newQUuid(_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-10-18 23:53:33 +00:00
|
|
|
func QUuid_CreateUuidV5(ns *QUuid, baseData []byte) *QUuid {
|
|
|
|
baseData_alias := C.struct_miqt_string{}
|
|
|
|
baseData_alias.data = (*C.char)(unsafe.Pointer(&baseData[0]))
|
|
|
|
baseData_alias.len = C.size_t(len(baseData))
|
|
|
|
_ret := C.QUuid_CreateUuidV5(ns.cPointer(), baseData_alias)
|
2024-09-14 22:29:05 +00:00
|
|
|
_goptr := newQUuid(_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 QUuid_CreateUuidV32(ns *QUuid, baseData string) *QUuid {
|
2024-10-18 23:53:33 +00:00
|
|
|
baseData_ms := C.struct_miqt_string{}
|
|
|
|
baseData_ms.data = C.CString(baseData)
|
|
|
|
baseData_ms.len = C.size_t(len(baseData))
|
|
|
|
defer C.free(unsafe.Pointer(baseData_ms.data))
|
|
|
|
_ret := C.QUuid_CreateUuidV32(ns.cPointer(), baseData_ms)
|
2024-09-14 22:29:05 +00:00
|
|
|
_goptr := newQUuid(_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 QUuid_CreateUuidV52(ns *QUuid, baseData string) *QUuid {
|
2024-10-18 23:53:33 +00:00
|
|
|
baseData_ms := C.struct_miqt_string{}
|
|
|
|
baseData_ms.data = C.CString(baseData)
|
|
|
|
baseData_ms.len = C.size_t(len(baseData))
|
|
|
|
defer C.free(unsafe.Pointer(baseData_ms.data))
|
|
|
|
_ret := C.QUuid_CreateUuidV52(ns.cPointer(), baseData_ms)
|
2024-09-14 22:29:05 +00:00
|
|
|
_goptr := newQUuid(_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 *QUuid) Variant() QUuid__Variant {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (QUuid__Variant)(C.QUuid_Variant(this.h))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QUuid) Version() QUuid__Version {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (QUuid__Version)(C.QUuid_Version(this.h))
|
2024-08-29 07:01:51 +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 *QUuid) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QUuid_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 *QUuid) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QUuid) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|