mirror of
https://github.com/mappu/miqt.git
synced 2025-01-22 14:40:38 +00:00
a0c6344ecd
The expected type of the callback is already known from the AST - this change reduces dependency on cgo specifics and makes the generated C ABI entirely cgo-independent - in particular, there is no need to include `_cgo_export.h` any more.
41 lines
1.3 KiB
C++
41 lines
1.3 KiB
C++
#include <QList>
|
|
#include <QSslCertificate>
|
|
#include <QSslKey>
|
|
#include <QWebEngineClientCertificateStore>
|
|
#include <qwebengineclientcertificatestore.h>
|
|
#include "gen_qwebengineclientcertificatestore.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
} /* extern C */
|
|
#endif
|
|
|
|
void QWebEngineClientCertificateStore_Add(QWebEngineClientCertificateStore* self, QSslCertificate* certificate, QSslKey* privateKey) {
|
|
self->add(*certificate, *privateKey);
|
|
}
|
|
|
|
struct miqt_array /* of QSslCertificate* */ QWebEngineClientCertificateStore_Certificates(const QWebEngineClientCertificateStore* self) {
|
|
QList<QSslCertificate> _ret = self->certificates();
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
QSslCertificate** _arr = static_cast<QSslCertificate**>(malloc(sizeof(QSslCertificate*) * _ret.length()));
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
_arr[i] = new QSslCertificate(_ret[i]);
|
|
}
|
|
struct miqt_array _out;
|
|
_out.len = _ret.length();
|
|
_out.data = static_cast<void*>(_arr);
|
|
return _out;
|
|
}
|
|
|
|
void QWebEngineClientCertificateStore_Remove(QWebEngineClientCertificateStore* self, QSslCertificate* certificate) {
|
|
self->remove(*certificate);
|
|
}
|
|
|
|
void QWebEngineClientCertificateStore_Clear(QWebEngineClientCertificateStore* self) {
|
|
self->clear();
|
|
}
|
|
|