#include #include #include #include #include "gen_qcryptographichash.h" #include "_cgo_export.h" void QCryptographicHash_new(int method, QCryptographicHash** outptr_QCryptographicHash) { QCryptographicHash* ret = new QCryptographicHash(static_cast(method)); *outptr_QCryptographicHash = ret; } void QCryptographicHash_Reset(QCryptographicHash* self) { self->reset(); } void QCryptographicHash_AddData(QCryptographicHash* self, const char* data, int length) { self->addData(data, static_cast(length)); } void QCryptographicHash_AddDataWithData(QCryptographicHash* self, struct miqt_string data) { QByteArray data_QByteArray(data.data, data.len); self->addData(data_QByteArray); } bool QCryptographicHash_AddDataWithDevice(QCryptographicHash* self, QIODevice* device) { return self->addData(device); } struct miqt_string QCryptographicHash_Result(const QCryptographicHash* self) { QByteArray _qb = self->result(); struct miqt_string _ms; _ms.len = _qb.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _qb.data(), _ms.len); return _ms; } struct miqt_string QCryptographicHash_Hash(struct miqt_string data, int method) { QByteArray data_QByteArray(data.data, data.len); QByteArray _qb = QCryptographicHash::hash(data_QByteArray, static_cast(method)); struct miqt_string _ms; _ms.len = _qb.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _qb.data(), _ms.len); return _ms; } int QCryptographicHash_HashLength(int method) { return QCryptographicHash::hashLength(static_cast(method)); } void QCryptographicHash_Delete(QCryptographicHash* self, bool isSubclass) { if (isSubclass) { delete dynamic_cast( self ); } else { delete self; } }