miqt/qt/network/gen_qsslellipticcurve.cpp

61 lines
1.8 KiB
C++
Raw Normal View History

2024-11-04 09:53:04 +00:00
#include <QSslEllipticCurve>
#include <QString>
#include <QByteArray>
#include <cstring>
#include <qsslellipticcurve.h>
#include "gen_qsslellipticcurve.h"
#include "_cgo_export.h"
QSslEllipticCurve* QSslEllipticCurve_new() {
return new QSslEllipticCurve();
}
QSslEllipticCurve* QSslEllipticCurve_new2(QSslEllipticCurve* param1) {
return new QSslEllipticCurve(*param1);
}
QSslEllipticCurve* QSslEllipticCurve_FromShortName(struct miqt_string name) {
QString name_QString = QString::fromUtf8(name.data, name.len);
return new QSslEllipticCurve(QSslEllipticCurve::fromShortName(name_QString));
}
QSslEllipticCurve* QSslEllipticCurve_FromLongName(struct miqt_string name) {
QString name_QString = QString::fromUtf8(name.data, name.len);
return new QSslEllipticCurve(QSslEllipticCurve::fromLongName(name_QString));
}
struct miqt_string QSslEllipticCurve_ShortName(const QSslEllipticCurve* self) {
QString _ret = self->shortName();
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
struct miqt_string QSslEllipticCurve_LongName(const QSslEllipticCurve* self) {
QString _ret = self->longName();
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
bool QSslEllipticCurve_IsValid(const QSslEllipticCurve* self) {
return self->isValid();
}
bool QSslEllipticCurve_IsTlsNamedCurve(const QSslEllipticCurve* self) {
return self->isTlsNamedCurve();
}
void QSslEllipticCurve_Delete(QSslEllipticCurve* self) {
delete self;
}