2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qversionnumber.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QVersionNumber struct {
|
|
|
|
h *C.QVersionNumber
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVersionNumber) cPointer() *C.QVersionNumber {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QVersionNumber) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQVersionNumber(h *C.QVersionNumber) *QVersionNumber {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QVersionNumber{h: h}
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQVersionNumber(h unsafe.Pointer) *QVersionNumber {
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQVersionNumber((*C.QVersionNumber)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQVersionNumber constructs a new QVersionNumber object.
|
|
|
|
func NewQVersionNumber() *QVersionNumber {
|
|
|
|
ret := C.QVersionNumber_new()
|
|
|
|
return newQVersionNumber(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQVersionNumber2 constructs a new QVersionNumber object.
|
|
|
|
func NewQVersionNumber2(seg []int) *QVersionNumber {
|
|
|
|
// For the C ABI, malloc a C array of raw pointers
|
2024-09-01 05:51:28 +00:00
|
|
|
seg_CArray := (*[0xffff]C.int)(C.malloc(C.size_t(8 * len(seg))))
|
2024-08-25 04:08:24 +00:00
|
|
|
defer C.free(unsafe.Pointer(seg_CArray))
|
|
|
|
for i := range seg {
|
|
|
|
seg_CArray[i] = (C.int)(seg[i])
|
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
seg_ma := &C.struct_miqt_array{len: C.size_t(len(seg)), data: unsafe.Pointer(seg_CArray)}
|
|
|
|
defer runtime.KeepAlive(unsafe.Pointer(seg_ma))
|
|
|
|
ret := C.QVersionNumber_new2(seg_ma)
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQVersionNumber(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQVersionNumber3 constructs a new QVersionNumber object.
|
|
|
|
func NewQVersionNumber3(maj int) *QVersionNumber {
|
|
|
|
ret := C.QVersionNumber_new3((C.int)(maj))
|
|
|
|
return newQVersionNumber(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQVersionNumber4 constructs a new QVersionNumber object.
|
|
|
|
func NewQVersionNumber4(maj int, min int) *QVersionNumber {
|
|
|
|
ret := C.QVersionNumber_new4((C.int)(maj), (C.int)(min))
|
|
|
|
return newQVersionNumber(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQVersionNumber5 constructs a new QVersionNumber object.
|
|
|
|
func NewQVersionNumber5(maj int, min int, mic int) *QVersionNumber {
|
|
|
|
ret := C.QVersionNumber_new5((C.int)(maj), (C.int)(min), (C.int)(mic))
|
|
|
|
return newQVersionNumber(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVersionNumber) IsNull() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QVersionNumber_IsNull(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVersionNumber) IsNormalized() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QVersionNumber_IsNormalized(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVersionNumber) MajorVersion() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QVersionNumber_MajorVersion(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVersionNumber) MinorVersion() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QVersionNumber_MinorVersion(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVersionNumber) MicroVersion() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QVersionNumber_MicroVersion(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVersionNumber) Normalized() *QVersionNumber {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QVersionNumber_Normalized(this.h)
|
|
|
|
_goptr := newQVersionNumber(_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 *QVersionNumber) Segments() []int {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ma *C.struct_miqt_array = C.QVersionNumber_Segments(this.h)
|
|
|
|
_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
|
|
|
C.free(unsafe.Pointer(_ma))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVersionNumber) SegmentAt(index int) int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QVersionNumber_SegmentAt(this.h, (C.int)(index)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVersionNumber) SegmentCount() int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QVersionNumber_SegmentCount(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QVersionNumber) IsPrefixOf(other *QVersionNumber) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QVersionNumber_IsPrefixOf(this.h, other.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QVersionNumber_Compare(v1 *QVersionNumber, v2 *QVersionNumber) int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QVersionNumber_Compare(v1.cPointer(), v2.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QVersionNumber_CommonPrefix(v1 *QVersionNumber, v2 *QVersionNumber) *QVersionNumber {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QVersionNumber_CommonPrefix(v1.cPointer(), v2.cPointer())
|
|
|
|
_goptr := newQVersionNumber(_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 *QVersionNumber) ToString() string {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QVersionNumber_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
|
|
|
}
|
|
|
|
|
|
|
|
func QVersionNumber_FromString(stringVal string) *QVersionNumber {
|
2024-10-18 23:53:33 +00:00
|
|
|
stringVal_ms := C.struct_miqt_string{}
|
|
|
|
stringVal_ms.data = C.CString(stringVal)
|
|
|
|
stringVal_ms.len = C.size_t(len(stringVal))
|
|
|
|
defer C.free(unsafe.Pointer(stringVal_ms.data))
|
|
|
|
_ret := C.QVersionNumber_FromString(stringVal_ms)
|
2024-09-14 22:29:05 +00:00
|
|
|
_goptr := newQVersionNumber(_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-08-29 07:01:51 +00:00
|
|
|
func QVersionNumber_FromString22(stringVal string, suffixIndex *int) *QVersionNumber {
|
2024-10-18 23:53:33 +00:00
|
|
|
stringVal_ms := C.struct_miqt_string{}
|
|
|
|
stringVal_ms.data = C.CString(stringVal)
|
|
|
|
stringVal_ms.len = C.size_t(len(stringVal))
|
|
|
|
defer C.free(unsafe.Pointer(stringVal_ms.data))
|
|
|
|
_ret := C.QVersionNumber_FromString22(stringVal_ms, (*C.int)(unsafe.Pointer(suffixIndex)))
|
2024-09-14 22:29:05 +00:00
|
|
|
_goptr := newQVersionNumber(_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-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QVersionNumber) Delete() {
|
|
|
|
C.QVersionNumber_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 *QVersionNumber) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QVersionNumber) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|