/
qmessageauthenticationcode.go
277 lines (237 loc) · 8.54 KB
/
qmessageauthenticationcode.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
package qtcore
// /usr/include/qt/QtCore/qmessageauthenticationcode.h
// #include <qmessageauthenticationcode.h>
// #include <QtCore>
// header block end
// main block begin
// main block end
// use block begin
// use block end
// ext block begin
/*
#include <stdlib.h>
// extern C begin: 19
*/
// import "C"
import "unsafe"
import "reflect"
import "fmt"
import "log"
import "github.com/kitech/qt.go/qtrt"
// ext block end
// body block begin
/*
*/
type QMessageAuthenticationCode struct {
*qtrt.CObject
}
type QMessageAuthenticationCode_ITF interface {
QMessageAuthenticationCode_PTR() *QMessageAuthenticationCode
}
func (ptr *QMessageAuthenticationCode) QMessageAuthenticationCode_PTR() *QMessageAuthenticationCode {
return ptr
}
func (this *QMessageAuthenticationCode) GetCthis() unsafe.Pointer {
if this == nil {
return nil
} else {
return this.Cthis
}
}
func (this *QMessageAuthenticationCode) SetCthis(cthis unsafe.Pointer) {
if this.CObject == nil {
this.CObject = &qtrt.CObject{cthis}
} else {
this.CObject.Cthis = cthis
}
}
func NewQMessageAuthenticationCodeFromPointer(cthis unsafe.Pointer) *QMessageAuthenticationCode {
return &QMessageAuthenticationCode{&qtrt.CObject{cthis}}
}
func (*QMessageAuthenticationCode) NewFromPointer(cthis unsafe.Pointer) *QMessageAuthenticationCode {
return NewQMessageAuthenticationCodeFromPointer(cthis)
}
// /usr/include/qt/QtCore/qmessageauthenticationcode.h:54
// index:0
// Public Visibility=Default Availability=Available
// [-2] void QMessageAuthenticationCode(QCryptographicHash::Algorithm, const QByteArray &)
/*
Constructs an object that can be used to create a cryptographic hash from data using method method and key key.
*/
func (*QMessageAuthenticationCode) NewForInherit(method int, key QByteArray_ITF) *QMessageAuthenticationCode {
return NewQMessageAuthenticationCode(method, key)
}
func NewQMessageAuthenticationCode(method int, key QByteArray_ITF) *QMessageAuthenticationCode {
var convArg1 unsafe.Pointer
if key != nil && key.QByteArray_PTR() != nil {
convArg1 = key.QByteArray_PTR().GetCthis()
}
rv, err := qtrt.InvokeQtFunc6("_ZN26QMessageAuthenticationCodeC2EN18QCryptographicHash9AlgorithmERK10QByteArray", qtrt.FFI_TYPE_POINTER, method, convArg1)
qtrt.ErrPrint(err, rv)
gothis := NewQMessageAuthenticationCodeFromPointer(unsafe.Pointer(uintptr(rv)))
qtrt.SetFinalizer(gothis, DeleteQMessageAuthenticationCode)
return gothis
}
// /usr/include/qt/QtCore/qmessageauthenticationcode.h:54
// index:0
// Public Visibility=Default Availability=Available
// [-2] void QMessageAuthenticationCode(QCryptographicHash::Algorithm, const QByteArray &)
/*
Constructs an object that can be used to create a cryptographic hash from data using method method and key key.
*/
func (*QMessageAuthenticationCode) NewForInheritp(method int) *QMessageAuthenticationCode {
return NewQMessageAuthenticationCodep(method)
}
func NewQMessageAuthenticationCodep(method int) *QMessageAuthenticationCode {
// arg: 1, const QByteArray &=LValueReference, QByteArray=Record, , Invalid
var convArg1 = NewQByteArray()
rv, err := qtrt.InvokeQtFunc6("_ZN26QMessageAuthenticationCodeC2EN18QCryptographicHash9AlgorithmERK10QByteArray", qtrt.FFI_TYPE_POINTER, method, convArg1)
qtrt.ErrPrint(err, rv)
gothis := NewQMessageAuthenticationCodeFromPointer(unsafe.Pointer(uintptr(rv)))
qtrt.SetFinalizer(gothis, DeleteQMessageAuthenticationCode)
return gothis
}
// /usr/include/qt/QtCore/qmessageauthenticationcode.h:56
// index:0
// Public Visibility=Default Availability=Available
// [-2] void ~QMessageAuthenticationCode()
/*
*/
func DeleteQMessageAuthenticationCode(this *QMessageAuthenticationCode) {
rv, err := qtrt.InvokeQtFunc6("_ZN26QMessageAuthenticationCodeD2Ev", qtrt.FFI_TYPE_VOID, this.GetCthis())
qtrt.Cmemset(this.GetCthis(), 9, 8)
qtrt.ErrPrint(err, rv)
this.SetCthis(nil)
}
// /usr/include/qt/QtCore/qmessageauthenticationcode.h:58
// index:0
// Public Visibility=Default Availability=Available
// [-2] void reset()
/*
Resets message data. Calling this method doesn't affect the key.
*/
func (this *QMessageAuthenticationCode) Reset() {
rv, err := qtrt.InvokeQtFunc6("_ZN26QMessageAuthenticationCode5resetEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtCore/qmessageauthenticationcode.h:60
// index:0
// Public Visibility=Default Availability=Available
// [-2] void setKey(const QByteArray &)
/*
Sets secret key. Calling this method automatically resets the object state.
*/
func (this *QMessageAuthenticationCode) SetKey(key QByteArray_ITF) {
var convArg0 unsafe.Pointer
if key != nil && key.QByteArray_PTR() != nil {
convArg0 = key.QByteArray_PTR().GetCthis()
}
rv, err := qtrt.InvokeQtFunc6("_ZN26QMessageAuthenticationCode6setKeyERK10QByteArray", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtCore/qmessageauthenticationcode.h:62
// index:0
// Public Visibility=Default Availability=Available
// [-2] void addData(const char *, int)
/*
Adds the first length chars of data to the message.
*/
func (this *QMessageAuthenticationCode) AddData(data string, length int) {
var convArg0 = qtrt.CString(data)
defer qtrt.FreeMem(convArg0)
rv, err := qtrt.InvokeQtFunc6("_ZN26QMessageAuthenticationCode7addDataEPKci", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0, length)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtCore/qmessageauthenticationcode.h:63
// index:1
// Public Visibility=Default Availability=Available
// [-2] void addData(const QByteArray &)
/*
Adds the first length chars of data to the message.
*/
func (this *QMessageAuthenticationCode) AddData1(data QByteArray_ITF) {
var convArg0 unsafe.Pointer
if data != nil && data.QByteArray_PTR() != nil {
convArg0 = data.QByteArray_PTR().GetCthis()
}
rv, err := qtrt.InvokeQtFunc6("_ZN26QMessageAuthenticationCode7addDataERK10QByteArray", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0)
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtCore/qmessageauthenticationcode.h:64
// index:2
// Public Visibility=Default Availability=Available
// [1] bool addData(QIODevice *)
/*
Adds the first length chars of data to the message.
*/
func (this *QMessageAuthenticationCode) AddData2(device QIODevice_ITF /*777 QIODevice **/) bool {
var convArg0 unsafe.Pointer
if device != nil && device.QIODevice_PTR() != nil {
convArg0 = device.QIODevice_PTR().GetCthis()
}
rv, err := qtrt.InvokeQtFunc6("_ZN26QMessageAuthenticationCode7addDataEP9QIODevice", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0)
qtrt.ErrPrint(err, rv)
return rv != 0
}
// /usr/include/qt/QtCore/qmessageauthenticationcode.h:66
// index:0
// Public Visibility=Default Availability=Available
// [8] QByteArray result() const
/*
Returns the final authentication code.
See also QByteArray::toHex().
*/
func (this *QMessageAuthenticationCode) Result() *QByteArray /*123*/ {
rv, err := qtrt.InvokeQtFunc6("_ZNK26QMessageAuthenticationCode6resultEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
rv2 := /*==*/ NewQByteArrayFromPointer(unsafe.Pointer(uintptr(rv))) // 333
qtrt.SetFinalizer(rv2 /*==*/, DeleteQByteArray)
return rv2
}
// /usr/include/qt/QtCore/qmessageauthenticationcode.h:68
// index:0
// Public static Visibility=Default Availability=Available
// [8] QByteArray hash(const QByteArray &, const QByteArray &, QCryptographicHash::Algorithm)
/*
Returns the authentication code for the message message using the key key and the method method.
*/
func (this *QMessageAuthenticationCode) Hash(message QByteArray_ITF, key QByteArray_ITF, method int) *QByteArray /*123*/ {
var convArg0 unsafe.Pointer
if message != nil && message.QByteArray_PTR() != nil {
convArg0 = message.QByteArray_PTR().GetCthis()
}
var convArg1 unsafe.Pointer
if key != nil && key.QByteArray_PTR() != nil {
convArg1 = key.QByteArray_PTR().GetCthis()
}
rv, err := qtrt.InvokeQtFunc6("_ZN26QMessageAuthenticationCode4hashERK10QByteArrayS2_N18QCryptographicHash9AlgorithmE", qtrt.FFI_TYPE_POINTER, convArg0, convArg1, method)
qtrt.ErrPrint(err, rv)
rv2 := /*==*/ NewQByteArrayFromPointer(unsafe.Pointer(uintptr(rv))) // 333
qtrt.SetFinalizer(rv2 /*==*/, DeleteQByteArray)
return rv2
}
func QMessageAuthenticationCode_Hash(message QByteArray_ITF, key QByteArray_ITF, method int) *QByteArray /*123*/ {
var nilthis *QMessageAuthenticationCode
rv := nilthis.Hash(message, key, method)
return rv
}
// body block end
// keep block begin
func init_unused_10473() {
if false {
reflect.TypeOf(123)
}
if false {
reflect.TypeOf(unsafe.Sizeof(0))
}
if false {
fmt.Println(123)
}
if false {
log.Println(123)
}
if false {
qtrt.KeepMe()
}
}
// keep block end