miqt/qt/network/gen_qsslpresharedkeyauthenticator.go

129 lines
4.3 KiB
Go
Raw Permalink Normal View History

2024-11-04 09:53:04 +00:00
package network
/*
#include "gen_qsslpresharedkeyauthenticator.h"
#include <stdlib.h>
*/
import "C"
import (
"runtime"
"unsafe"
)
type QSslPreSharedKeyAuthenticator struct {
2024-11-19 06:29:06 +00:00
h *C.QSslPreSharedKeyAuthenticator
isSubclass bool
2024-11-04 09:53:04 +00:00
}
func (this *QSslPreSharedKeyAuthenticator) cPointer() *C.QSslPreSharedKeyAuthenticator {
if this == nil {
return nil
}
return this.h
}
func (this *QSslPreSharedKeyAuthenticator) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQSslPreSharedKeyAuthenticator constructs the type using only CGO pointers.
2024-11-04 09:53:04 +00:00
func newQSslPreSharedKeyAuthenticator(h *C.QSslPreSharedKeyAuthenticator) *QSslPreSharedKeyAuthenticator {
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
2024-11-04 09:53:04 +00:00
return &QSslPreSharedKeyAuthenticator{h: h}
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQSslPreSharedKeyAuthenticator constructs the type using only unsafe pointers.
2024-11-04 09:53:04 +00:00
func UnsafeNewQSslPreSharedKeyAuthenticator(h unsafe.Pointer) *QSslPreSharedKeyAuthenticator {
2024-12-07 04:15:57 +00:00
return newQSslPreSharedKeyAuthenticator((*C.QSslPreSharedKeyAuthenticator)(h))
2024-11-04 09:53:04 +00:00
}
// NewQSslPreSharedKeyAuthenticator constructs a new QSslPreSharedKeyAuthenticator object.
func NewQSslPreSharedKeyAuthenticator() *QSslPreSharedKeyAuthenticator {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQSslPreSharedKeyAuthenticator(C.QSslPreSharedKeyAuthenticator_new())
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-11-04 09:53:04 +00:00
}
// NewQSslPreSharedKeyAuthenticator2 constructs a new QSslPreSharedKeyAuthenticator object.
func NewQSslPreSharedKeyAuthenticator2(authenticator *QSslPreSharedKeyAuthenticator) *QSslPreSharedKeyAuthenticator {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQSslPreSharedKeyAuthenticator(C.QSslPreSharedKeyAuthenticator_new2(authenticator.cPointer()))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-11-04 09:53:04 +00:00
}
func (this *QSslPreSharedKeyAuthenticator) OperatorAssign(authenticator *QSslPreSharedKeyAuthenticator) {
C.QSslPreSharedKeyAuthenticator_OperatorAssign(this.h, authenticator.cPointer())
}
func (this *QSslPreSharedKeyAuthenticator) Swap(other *QSslPreSharedKeyAuthenticator) {
C.QSslPreSharedKeyAuthenticator_Swap(this.h, other.cPointer())
}
func (this *QSslPreSharedKeyAuthenticator) IdentityHint() []byte {
var _bytearray C.struct_miqt_string = C.QSslPreSharedKeyAuthenticator_IdentityHint(this.h)
_ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len)))
C.free(unsafe.Pointer(_bytearray.data))
return _ret
}
func (this *QSslPreSharedKeyAuthenticator) SetIdentity(identity []byte) {
identity_alias := C.struct_miqt_string{}
identity_alias.data = (*C.char)(unsafe.Pointer(&identity[0]))
identity_alias.len = C.size_t(len(identity))
C.QSslPreSharedKeyAuthenticator_SetIdentity(this.h, identity_alias)
}
func (this *QSslPreSharedKeyAuthenticator) Identity() []byte {
var _bytearray C.struct_miqt_string = C.QSslPreSharedKeyAuthenticator_Identity(this.h)
_ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len)))
C.free(unsafe.Pointer(_bytearray.data))
return _ret
}
func (this *QSslPreSharedKeyAuthenticator) MaximumIdentityLength() int {
return (int)(C.QSslPreSharedKeyAuthenticator_MaximumIdentityLength(this.h))
}
func (this *QSslPreSharedKeyAuthenticator) SetPreSharedKey(preSharedKey []byte) {
preSharedKey_alias := C.struct_miqt_string{}
preSharedKey_alias.data = (*C.char)(unsafe.Pointer(&preSharedKey[0]))
preSharedKey_alias.len = C.size_t(len(preSharedKey))
C.QSslPreSharedKeyAuthenticator_SetPreSharedKey(this.h, preSharedKey_alias)
}
func (this *QSslPreSharedKeyAuthenticator) PreSharedKey() []byte {
var _bytearray C.struct_miqt_string = C.QSslPreSharedKeyAuthenticator_PreSharedKey(this.h)
_ret := C.GoBytes(unsafe.Pointer(_bytearray.data), C.int(int64(_bytearray.len)))
C.free(unsafe.Pointer(_bytearray.data))
return _ret
}
func (this *QSslPreSharedKeyAuthenticator) MaximumPreSharedKeyLength() int {
return (int)(C.QSslPreSharedKeyAuthenticator_MaximumPreSharedKeyLength(this.h))
}
// Delete this object from C++ memory.
func (this *QSslPreSharedKeyAuthenticator) Delete() {
2024-11-19 06:29:06 +00:00
C.QSslPreSharedKeyAuthenticator_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 *QSslPreSharedKeyAuthenticator) GoGC() {
runtime.SetFinalizer(this, func(this *QSslPreSharedKeyAuthenticator) {
this.Delete()
runtime.KeepAlive(this.h)
})
}