miqt/qt/network/gen_qsslellipticcurve.go

120 lines
3.2 KiB
Go
Raw Permalink Normal View History

2024-11-04 09:53:04 +00:00
package network
/*
#include "gen_qsslellipticcurve.h"
#include <stdlib.h>
*/
import "C"
import (
"runtime"
"unsafe"
)
type QSslEllipticCurve struct {
2024-11-19 06:29:06 +00:00
h *C.QSslEllipticCurve
isSubclass bool
2024-11-04 09:53:04 +00:00
}
func (this *QSslEllipticCurve) cPointer() *C.QSslEllipticCurve {
if this == nil {
return nil
}
return this.h
}
func (this *QSslEllipticCurve) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQSslEllipticCurve constructs the type using only CGO pointers.
2024-11-04 09:53:04 +00:00
func newQSslEllipticCurve(h *C.QSslEllipticCurve) *QSslEllipticCurve {
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
2024-11-04 09:53:04 +00:00
return &QSslEllipticCurve{h: h}
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQSslEllipticCurve constructs the type using only unsafe pointers.
2024-11-04 09:53:04 +00:00
func UnsafeNewQSslEllipticCurve(h unsafe.Pointer) *QSslEllipticCurve {
2024-12-07 04:15:57 +00:00
return newQSslEllipticCurve((*C.QSslEllipticCurve)(h))
2024-11-04 09:53:04 +00:00
}
// NewQSslEllipticCurve constructs a new QSslEllipticCurve object.
func NewQSslEllipticCurve() *QSslEllipticCurve {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQSslEllipticCurve(C.QSslEllipticCurve_new())
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-11-04 09:53:04 +00:00
}
// NewQSslEllipticCurve2 constructs a new QSslEllipticCurve object.
func NewQSslEllipticCurve2(param1 *QSslEllipticCurve) *QSslEllipticCurve {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQSslEllipticCurve(C.QSslEllipticCurve_new2(param1.cPointer()))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-11-04 09:53:04 +00:00
}
func QSslEllipticCurve_FromShortName(name string) *QSslEllipticCurve {
name_ms := C.struct_miqt_string{}
name_ms.data = C.CString(name)
name_ms.len = C.size_t(len(name))
defer C.free(unsafe.Pointer(name_ms.data))
_goptr := newQSslEllipticCurve(C.QSslEllipticCurve_FromShortName(name_ms))
2024-11-04 09:53:04 +00:00
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func QSslEllipticCurve_FromLongName(name string) *QSslEllipticCurve {
name_ms := C.struct_miqt_string{}
name_ms.data = C.CString(name)
name_ms.len = C.size_t(len(name))
defer C.free(unsafe.Pointer(name_ms.data))
_goptr := newQSslEllipticCurve(C.QSslEllipticCurve_FromLongName(name_ms))
2024-11-04 09:53:04 +00:00
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
return _goptr
}
func (this *QSslEllipticCurve) ShortName() string {
var _ms C.struct_miqt_string = C.QSslEllipticCurve_ShortName(this.h)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QSslEllipticCurve) LongName() string {
var _ms C.struct_miqt_string = C.QSslEllipticCurve_LongName(this.h)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QSslEllipticCurve) IsValid() bool {
return (bool)(C.QSslEllipticCurve_IsValid(this.h))
}
func (this *QSslEllipticCurve) IsTlsNamedCurve() bool {
return (bool)(C.QSslEllipticCurve_IsTlsNamedCurve(this.h))
}
// Delete this object from C++ memory.
func (this *QSslEllipticCurve) Delete() {
2024-11-19 06:29:06 +00:00
C.QSslEllipticCurve_Delete(this.h, C.bool(this.isSubclass))
2024-11-04 09:53:04 +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 *QSslEllipticCurve) GoGC() {
runtime.SetFinalizer(this, func(this *QSslEllipticCurve) {
this.Delete()
runtime.KeepAlive(this.h)
})
}