mirror of
https://github.com/mappu/miqt.git
synced 2024-12-23 01:18:37 +00:00
129 lines
3.4 KiB
Go
129 lines
3.4 KiB
Go
package network
|
|
|
|
/*
|
|
|
|
#include "gen_qsslellipticcurve.h"
|
|
#include <stdlib.h>
|
|
|
|
*/
|
|
import "C"
|
|
|
|
import (
|
|
"runtime"
|
|
"unsafe"
|
|
)
|
|
|
|
type QSslEllipticCurve struct {
|
|
h *C.QSslEllipticCurve
|
|
isSubclass bool
|
|
}
|
|
|
|
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)
|
|
}
|
|
|
|
// newQSslEllipticCurve constructs the type using only CGO pointers.
|
|
func newQSslEllipticCurve(h *C.QSslEllipticCurve) *QSslEllipticCurve {
|
|
if h == nil {
|
|
return nil
|
|
}
|
|
return &QSslEllipticCurve{h: h}
|
|
}
|
|
|
|
// UnsafeNewQSslEllipticCurve constructs the type using only unsafe pointers.
|
|
func UnsafeNewQSslEllipticCurve(h unsafe.Pointer) *QSslEllipticCurve {
|
|
if h == nil {
|
|
return nil
|
|
}
|
|
|
|
return &QSslEllipticCurve{h: (*C.QSslEllipticCurve)(h)}
|
|
}
|
|
|
|
// NewQSslEllipticCurve constructs a new QSslEllipticCurve object.
|
|
func NewQSslEllipticCurve() *QSslEllipticCurve {
|
|
var outptr_QSslEllipticCurve *C.QSslEllipticCurve = nil
|
|
|
|
C.QSslEllipticCurve_new(&outptr_QSslEllipticCurve)
|
|
ret := newQSslEllipticCurve(outptr_QSslEllipticCurve)
|
|
ret.isSubclass = true
|
|
return ret
|
|
}
|
|
|
|
// NewQSslEllipticCurve2 constructs a new QSslEllipticCurve object.
|
|
func NewQSslEllipticCurve2(param1 *QSslEllipticCurve) *QSslEllipticCurve {
|
|
var outptr_QSslEllipticCurve *C.QSslEllipticCurve = nil
|
|
|
|
C.QSslEllipticCurve_new2(param1.cPointer(), &outptr_QSslEllipticCurve)
|
|
ret := newQSslEllipticCurve(outptr_QSslEllipticCurve)
|
|
ret.isSubclass = true
|
|
return ret
|
|
}
|
|
|
|
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))
|
|
_ret := C.QSslEllipticCurve_FromShortName(name_ms)
|
|
_goptr := newQSslEllipticCurve(_ret)
|
|
_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))
|
|
_ret := C.QSslEllipticCurve_FromLongName(name_ms)
|
|
_goptr := newQSslEllipticCurve(_ret)
|
|
_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() {
|
|
C.QSslEllipticCurve_Delete(this.h, C.bool(this.isSubclass))
|
|
}
|
|
|
|
// 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)
|
|
})
|
|
}
|