2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qmessageauthenticationcode.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QMessageAuthenticationCode struct {
|
|
|
|
h *C.QMessageAuthenticationCode
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMessageAuthenticationCode) cPointer() *C.QMessageAuthenticationCode {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QMessageAuthenticationCode) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQMessageAuthenticationCode(h *C.QMessageAuthenticationCode) *QMessageAuthenticationCode {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QMessageAuthenticationCode{h: h}
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQMessageAuthenticationCode(h unsafe.Pointer) *QMessageAuthenticationCode {
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQMessageAuthenticationCode((*C.QMessageAuthenticationCode)(h))
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
// NewQMessageAuthenticationCode constructs a new QMessageAuthenticationCode object.
|
2024-09-04 06:54:22 +00:00
|
|
|
func NewQMessageAuthenticationCode(method QCryptographicHash__Algorithm) *QMessageAuthenticationCode {
|
2024-09-18 00:12:02 +00:00
|
|
|
ret := C.QMessageAuthenticationCode_new((C.int)(method))
|
2024-08-29 07:01:51 +00:00
|
|
|
return newQMessageAuthenticationCode(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQMessageAuthenticationCode2 constructs a new QMessageAuthenticationCode object.
|
2024-09-04 06:54:22 +00:00
|
|
|
func NewQMessageAuthenticationCode2(method QCryptographicHash__Algorithm, key *QByteArray) *QMessageAuthenticationCode {
|
2024-09-18 00:12:02 +00:00
|
|
|
ret := C.QMessageAuthenticationCode_new2((C.int)(method), key.cPointer())
|
2024-08-29 07:01:51 +00:00
|
|
|
return newQMessageAuthenticationCode(ret)
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QMessageAuthenticationCode) Reset() {
|
|
|
|
C.QMessageAuthenticationCode_Reset(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMessageAuthenticationCode) SetKey(key *QByteArray) {
|
|
|
|
C.QMessageAuthenticationCode_SetKey(this.h, key.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMessageAuthenticationCode) AddData(data string, length int) {
|
|
|
|
data_Cstring := C.CString(data)
|
|
|
|
defer C.free(unsafe.Pointer(data_Cstring))
|
|
|
|
C.QMessageAuthenticationCode_AddData(this.h, data_Cstring, (C.int)(length))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMessageAuthenticationCode) AddDataWithData(data *QByteArray) {
|
|
|
|
C.QMessageAuthenticationCode_AddDataWithData(this.h, data.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMessageAuthenticationCode) AddDataWithDevice(device *QIODevice) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QMessageAuthenticationCode_AddDataWithDevice(this.h, device.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QMessageAuthenticationCode) Result() *QByteArray {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QMessageAuthenticationCode_Result(this.h)
|
|
|
|
_goptr := newQByteArray(_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 QMessageAuthenticationCode_Hash(message *QByteArray, key *QByteArray, method QCryptographicHash__Algorithm) *QByteArray {
|
2024-09-18 00:12:02 +00:00
|
|
|
_ret := C.QMessageAuthenticationCode_Hash(message.cPointer(), key.cPointer(), (C.int)(method))
|
2024-09-14 22:29:05 +00:00
|
|
|
_goptr := newQByteArray(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
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 *QMessageAuthenticationCode) Delete() {
|
|
|
|
C.QMessageAuthenticationCode_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 *QMessageAuthenticationCode) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QMessageAuthenticationCode) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|