miqt/qt/gen_qurl.cpp

628 lines
23 KiB
C++
Raw Normal View History

#include <QByteArray>
#include <QList>
#include <QString>
2024-08-29 07:01:51 +00:00
#include <QByteArray>
#include <cstring>
#include <QUrl>
#include <QUrlQuery>
2024-08-29 07:01:51 +00:00
#include "qurl.h"
2024-08-29 07:01:51 +00:00
#include "gen_qurl.h"
extern "C" {
extern void miqt_exec_callback(void* cb, int argc, void* argv);
}
QUrl* QUrl_new() {
return new QUrl();
}
QUrl* QUrl_new2(QUrl* copyVal) {
return new QUrl(*copyVal);
}
2024-08-29 07:01:51 +00:00
QUrl* QUrl_new3(const char* url, size_t url_Strlen) {
QString url_QString = QString::fromUtf8(url, url_Strlen);
return new QUrl(url_QString);
}
QUrl* QUrl_new4(const char* url, size_t url_Strlen, uintptr_t mode) {
QString url_QString = QString::fromUtf8(url, url_Strlen);
return new QUrl(url_QString, static_cast<QUrl::ParsingMode>(mode));
}
void QUrl_OperatorAssign(QUrl* self, QUrl* copyVal) {
self->operator=(*copyVal);
}
void QUrl_OperatorAssignWithUrl(QUrl* self, const char* url, size_t url_Strlen) {
QString url_QString = QString::fromUtf8(url, url_Strlen);
self->operator=(url_QString);
}
void QUrl_Swap(QUrl* self, QUrl* other) {
self->swap(*other);
}
2024-08-29 07:01:51 +00:00
void QUrl_SetUrl(QUrl* self, const char* url, size_t url_Strlen) {
QString url_QString = QString::fromUtf8(url, url_Strlen);
self->setUrl(url_QString);
}
void QUrl_Url(const QUrl* self, char** _out, int* _out_Strlen) {
QString ret = self->url();
2024-08-29 07:01:51 +00:00
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
void QUrl_ToString(const QUrl* self, char** _out, int* _out_Strlen) {
QString ret = self->toString();
2024-08-29 07:01:51 +00:00
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
void QUrl_ToDisplayString(const QUrl* self, char** _out, int* _out_Strlen) {
QString ret = self->toDisplayString();
2024-08-29 07:01:51 +00:00
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
QByteArray* QUrl_ToEncoded(const QUrl* self) {
QByteArray ret = self->toEncoded();
2024-08-29 07:01:51 +00:00
// Copy-construct value returned type into heap-allocated copy
return static_cast<QByteArray*>(new QByteArray(ret));
}
QUrl* QUrl_FromEncoded(QByteArray* url) {
QUrl ret = QUrl::fromEncoded(*url);
// Copy-construct value returned type into heap-allocated copy
return static_cast<QUrl*>(new QUrl(ret));
}
QUrl* QUrl_FromUserInput(const char* userInput, size_t userInput_Strlen) {
QString userInput_QString = QString::fromUtf8(userInput, userInput_Strlen);
QUrl ret = QUrl::fromUserInput(userInput_QString);
// Copy-construct value returned type into heap-allocated copy
return static_cast<QUrl*>(new QUrl(ret));
}
2024-08-29 07:01:51 +00:00
QUrl* QUrl_FromUserInput2(const char* userInput, size_t userInput_Strlen, const char* workingDirectory, size_t workingDirectory_Strlen) {
QString userInput_QString = QString::fromUtf8(userInput, userInput_Strlen);
QString workingDirectory_QString = QString::fromUtf8(workingDirectory, workingDirectory_Strlen);
QUrl ret = QUrl::fromUserInput(userInput_QString, workingDirectory_QString);
// Copy-construct value returned type into heap-allocated copy
return static_cast<QUrl*>(new QUrl(ret));
}
bool QUrl_IsValid(const QUrl* self) {
return self->isValid();
}
void QUrl_ErrorString(const QUrl* self, char** _out, int* _out_Strlen) {
QString ret = self->errorString();
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
bool QUrl_IsEmpty(const QUrl* self) {
return self->isEmpty();
}
void QUrl_Clear(QUrl* self) {
self->clear();
}
void QUrl_SetScheme(QUrl* self, const char* scheme, size_t scheme_Strlen) {
QString scheme_QString = QString::fromUtf8(scheme, scheme_Strlen);
self->setScheme(scheme_QString);
}
void QUrl_Scheme(const QUrl* self, char** _out, int* _out_Strlen) {
QString ret = self->scheme();
2024-08-29 07:01:51 +00:00
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
void QUrl_SetAuthority(QUrl* self, const char* authority, size_t authority_Strlen) {
QString authority_QString = QString::fromUtf8(authority, authority_Strlen);
self->setAuthority(authority_QString);
}
void QUrl_Authority(const QUrl* self, char** _out, int* _out_Strlen) {
QString ret = self->authority();
2024-08-29 07:01:51 +00:00
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
void QUrl_SetUserInfo(QUrl* self, const char* userInfo, size_t userInfo_Strlen) {
QString userInfo_QString = QString::fromUtf8(userInfo, userInfo_Strlen);
self->setUserInfo(userInfo_QString);
}
void QUrl_UserInfo(const QUrl* self, char** _out, int* _out_Strlen) {
QString ret = self->userInfo();
2024-08-29 07:01:51 +00:00
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
void QUrl_SetUserName(QUrl* self, const char* userName, size_t userName_Strlen) {
QString userName_QString = QString::fromUtf8(userName, userName_Strlen);
self->setUserName(userName_QString);
}
void QUrl_UserName(const QUrl* self, char** _out, int* _out_Strlen) {
QString ret = self->userName();
2024-08-29 07:01:51 +00:00
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
void QUrl_SetPassword(QUrl* self, const char* password, size_t password_Strlen) {
QString password_QString = QString::fromUtf8(password, password_Strlen);
self->setPassword(password_QString);
}
void QUrl_Password(const QUrl* self, char** _out, int* _out_Strlen) {
QString ret = self->password();
2024-08-29 07:01:51 +00:00
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
void QUrl_SetHost(QUrl* self, const char* host, size_t host_Strlen) {
QString host_QString = QString::fromUtf8(host, host_Strlen);
self->setHost(host_QString);
}
void QUrl_Host(const QUrl* self, char** _out, int* _out_Strlen) {
QString ret = self->host();
2024-08-29 07:01:51 +00:00
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
void QUrl_TopLevelDomain(const QUrl* self, char** _out, int* _out_Strlen) {
QString ret = self->topLevelDomain();
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
void QUrl_SetPort(QUrl* self, int port) {
self->setPort(static_cast<int>(port));
}
int QUrl_Port(const QUrl* self) {
return self->port();
2024-08-29 07:01:51 +00:00
}
void QUrl_SetPath(QUrl* self, const char* path, size_t path_Strlen) {
QString path_QString = QString::fromUtf8(path, path_Strlen);
self->setPath(path_QString);
}
void QUrl_Path(const QUrl* self, char** _out, int* _out_Strlen) {
QString ret = self->path();
2024-08-29 07:01:51 +00:00
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
void QUrl_FileName(const QUrl* self, char** _out, int* _out_Strlen) {
QString ret = self->fileName();
2024-08-29 07:01:51 +00:00
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
bool QUrl_HasQuery(const QUrl* self) {
return self->hasQuery();
2024-08-29 07:01:51 +00:00
}
void QUrl_SetQuery(QUrl* self, const char* query, size_t query_Strlen) {
QString query_QString = QString::fromUtf8(query, query_Strlen);
self->setQuery(query_QString);
}
2024-08-29 07:01:51 +00:00
void QUrl_SetQueryWithQuery(QUrl* self, QUrlQuery* query) {
self->setQuery(*query);
}
void QUrl_Query(const QUrl* self, char** _out, int* _out_Strlen) {
QString ret = self->query();
2024-08-29 07:01:51 +00:00
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
bool QUrl_HasFragment(const QUrl* self) {
return self->hasFragment();
2024-08-29 07:01:51 +00:00
}
void QUrl_Fragment(const QUrl* self, char** _out, int* _out_Strlen) {
QString ret = self->fragment();
2024-08-29 07:01:51 +00:00
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
void QUrl_SetFragment(QUrl* self, const char* fragment, size_t fragment_Strlen) {
QString fragment_QString = QString::fromUtf8(fragment, fragment_Strlen);
self->setFragment(fragment_QString);
}
QUrl* QUrl_Resolved(const QUrl* self, QUrl* relative) {
QUrl ret = self->resolved(*relative);
// Copy-construct value returned type into heap-allocated copy
return static_cast<QUrl*>(new QUrl(ret));
}
bool QUrl_IsRelative(const QUrl* self) {
return self->isRelative();
}
bool QUrl_IsParentOf(const QUrl* self, QUrl* url) {
return self->isParentOf(*url);
}
bool QUrl_IsLocalFile(const QUrl* self) {
return self->isLocalFile();
}
QUrl* QUrl_FromLocalFile(const char* localfile, size_t localfile_Strlen) {
QString localfile_QString = QString::fromUtf8(localfile, localfile_Strlen);
QUrl ret = QUrl::fromLocalFile(localfile_QString);
// Copy-construct value returned type into heap-allocated copy
return static_cast<QUrl*>(new QUrl(ret));
}
void QUrl_ToLocalFile(const QUrl* self, char** _out, int* _out_Strlen) {
QString ret = self->toLocalFile();
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
void QUrl_Detach(QUrl* self) {
self->detach();
}
bool QUrl_IsDetached(const QUrl* self) {
return self->isDetached();
}
bool QUrl_OperatorLesser(const QUrl* self, QUrl* url) {
return self->operator<(*url);
}
bool QUrl_OperatorEqual(const QUrl* self, QUrl* url) {
return self->operator==(*url);
}
bool QUrl_OperatorNotEqual(const QUrl* self, QUrl* url) {
return self->operator!=(*url);
}
void QUrl_FromPercentEncoding(QByteArray* param1, char** _out, int* _out_Strlen) {
QString ret = QUrl::fromPercentEncoding(*param1);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
QByteArray* QUrl_ToPercentEncoding(const char* param1, size_t param1_Strlen) {
QString param1_QString = QString::fromUtf8(param1, param1_Strlen);
QByteArray ret = QUrl::toPercentEncoding(param1_QString);
// Copy-construct value returned type into heap-allocated copy
return static_cast<QByteArray*>(new QByteArray(ret));
}
void QUrl_FromAce(QByteArray* param1, char** _out, int* _out_Strlen) {
QString ret = QUrl::fromAce(*param1);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
QByteArray* QUrl_ToAce(const char* param1, size_t param1_Strlen) {
QString param1_QString = QString::fromUtf8(param1, param1_Strlen);
QByteArray ret = QUrl::toAce(param1_QString);
// Copy-construct value returned type into heap-allocated copy
return static_cast<QByteArray*>(new QByteArray(ret));
}
void QUrl_IdnWhitelist(char*** _out, int** _out_Lengths, size_t* _out_len) {
2024-08-29 07:01:51 +00:00
QStringList ret = QUrl::idnWhitelist();
// Convert QStringList from C++ memory to manually-managed C memory
char** __out = static_cast<char**>(malloc(sizeof(char*) * ret.length()));
int* __out_Lengths = static_cast<int*>(malloc(sizeof(int) * ret.length()));
for (size_t i = 0, e = ret.length(); i < e; ++i) {
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret[i].toUtf8();
__out[i] = static_cast<char*>(malloc(b.length()));
memcpy(__out[i], b.data(), b.length());
__out_Lengths[i] = b.length();
}
*_out = __out;
*_out_Lengths = __out_Lengths;
*_out_len = ret.length();
}
2024-08-29 07:01:51 +00:00
void QUrl_ToStringList(QUrl** uris, size_t uris_len, char*** _out, int** _out_Lengths, size_t* _out_len) {
QList<QUrl> uris_QList;
uris_QList.reserve(uris_len);
for(size_t i = 0; i < uris_len; ++i) {
uris_QList.push_back(*(uris[i]));
}
QStringList ret = QUrl::toStringList(uris_QList);
// Convert QStringList from C++ memory to manually-managed C memory
char** __out = static_cast<char**>(malloc(sizeof(char*) * ret.length()));
int* __out_Lengths = static_cast<int*>(malloc(sizeof(int) * ret.length()));
for (size_t i = 0, e = ret.length(); i < e; ++i) {
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret[i].toUtf8();
__out[i] = static_cast<char*>(malloc(b.length()));
memcpy(__out[i], b.data(), b.length());
__out_Lengths[i] = b.length();
}
*_out = __out;
*_out_Lengths = __out_Lengths;
*_out_len = ret.length();
}
void QUrl_FromStringList(char** uris, uint64_t* uris_Lengths, size_t uris_len, QUrl*** _out, size_t* _out_len) {
QList<QString> uris_QList;
uris_QList.reserve(uris_len);
for(size_t i = 0; i < uris_len; ++i) {
uris_QList.push_back(QString::fromUtf8(uris[i], uris_Lengths[i]));
}
QList<QUrl> ret = QUrl::fromStringList(uris_QList);
// Convert QList<> from C++ memory to manually-managed C memory of copy-constructed pointers
QUrl** __out = static_cast<QUrl**>(malloc(sizeof(QUrl**) * ret.length()));
for (size_t i = 0, e = ret.length(); i < e; ++i) {
__out[i] = new QUrl(ret[i]);
}
*_out = __out;
*_out_len = ret.length();
}
void QUrl_SetIdnWhitelist(char** idnWhitelist, uint64_t* idnWhitelist_Lengths, size_t idnWhitelist_len) {
QList<QString> idnWhitelist_QList;
idnWhitelist_QList.reserve(idnWhitelist_len);
for(size_t i = 0; i < idnWhitelist_len; ++i) {
idnWhitelist_QList.push_back(QString::fromUtf8(idnWhitelist[i], idnWhitelist_Lengths[i]));
}
QUrl::setIdnWhitelist(idnWhitelist_QList);
}
2024-08-29 07:01:51 +00:00
void QUrl_SetUrl2(QUrl* self, const char* url, size_t url_Strlen, uintptr_t mode) {
QString url_QString = QString::fromUtf8(url, url_Strlen);
self->setUrl(url_QString, static_cast<QUrl::ParsingMode>(mode));
}
QUrl* QUrl_FromEncoded2(QByteArray* url, uintptr_t mode) {
QUrl ret = QUrl::fromEncoded(*url, static_cast<QUrl::ParsingMode>(mode));
// Copy-construct value returned type into heap-allocated copy
return static_cast<QUrl*>(new QUrl(ret));
}
QUrl* QUrl_FromUserInput3(const char* userInput, size_t userInput_Strlen, const char* workingDirectory, size_t workingDirectory_Strlen, int options) {
QString userInput_QString = QString::fromUtf8(userInput, userInput_Strlen);
QString workingDirectory_QString = QString::fromUtf8(workingDirectory, workingDirectory_Strlen);
QUrl ret = QUrl::fromUserInput(userInput_QString, workingDirectory_QString, static_cast<QUrl::UserInputResolutionOptions>(options));
// Copy-construct value returned type into heap-allocated copy
return static_cast<QUrl*>(new QUrl(ret));
}
void QUrl_SetAuthority2(QUrl* self, const char* authority, size_t authority_Strlen, uintptr_t mode) {
QString authority_QString = QString::fromUtf8(authority, authority_Strlen);
self->setAuthority(authority_QString, static_cast<QUrl::ParsingMode>(mode));
}
void QUrl_Authority1(const QUrl* self, int options, char** _out, int* _out_Strlen) {
QString ret = self->authority(static_cast<QUrl::ComponentFormattingOptions>(options));
2024-08-29 07:01:51 +00:00
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
void QUrl_SetUserInfo2(QUrl* self, const char* userInfo, size_t userInfo_Strlen, uintptr_t mode) {
QString userInfo_QString = QString::fromUtf8(userInfo, userInfo_Strlen);
self->setUserInfo(userInfo_QString, static_cast<QUrl::ParsingMode>(mode));
}
void QUrl_UserInfo1(const QUrl* self, int options, char** _out, int* _out_Strlen) {
QString ret = self->userInfo(static_cast<QUrl::ComponentFormattingOptions>(options));
2024-08-29 07:01:51 +00:00
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
void QUrl_SetUserName2(QUrl* self, const char* userName, size_t userName_Strlen, uintptr_t mode) {
QString userName_QString = QString::fromUtf8(userName, userName_Strlen);
self->setUserName(userName_QString, static_cast<QUrl::ParsingMode>(mode));
}
void QUrl_UserName1(const QUrl* self, int options, char** _out, int* _out_Strlen) {
QString ret = self->userName(static_cast<QUrl::ComponentFormattingOptions>(options));
2024-08-29 07:01:51 +00:00
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
void QUrl_SetPassword2(QUrl* self, const char* password, size_t password_Strlen, uintptr_t mode) {
QString password_QString = QString::fromUtf8(password, password_Strlen);
self->setPassword(password_QString, static_cast<QUrl::ParsingMode>(mode));
}
void QUrl_Password1(const QUrl* self, int param1, char** _out, int* _out_Strlen) {
QString ret = self->password(static_cast<QUrl::ComponentFormattingOptions>(param1));
2024-08-29 07:01:51 +00:00
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
void QUrl_SetHost2(QUrl* self, const char* host, size_t host_Strlen, uintptr_t mode) {
QString host_QString = QString::fromUtf8(host, host_Strlen);
self->setHost(host_QString, static_cast<QUrl::ParsingMode>(mode));
}
void QUrl_Host1(const QUrl* self, int param1, char** _out, int* _out_Strlen) {
QString ret = self->host(static_cast<QUrl::ComponentFormattingOptions>(param1));
2024-08-29 07:01:51 +00:00
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
void QUrl_TopLevelDomain1(const QUrl* self, int options, char** _out, int* _out_Strlen) {
QString ret = self->topLevelDomain(static_cast<QUrl::ComponentFormattingOptions>(options));
2024-08-29 07:01:51 +00:00
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
int QUrl_Port1(const QUrl* self, int defaultPort) {
return self->port(static_cast<int>(defaultPort));
}
2024-08-29 07:01:51 +00:00
void QUrl_SetPath2(QUrl* self, const char* path, size_t path_Strlen, uintptr_t mode) {
QString path_QString = QString::fromUtf8(path, path_Strlen);
self->setPath(path_QString, static_cast<QUrl::ParsingMode>(mode));
}
void QUrl_Path1(const QUrl* self, int options, char** _out, int* _out_Strlen) {
QString ret = self->path(static_cast<QUrl::ComponentFormattingOptions>(options));
2024-08-29 07:01:51 +00:00
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
void QUrl_FileName1(const QUrl* self, int options, char** _out, int* _out_Strlen) {
QString ret = self->fileName(static_cast<QUrl::ComponentFormattingOptions>(options));
2024-08-29 07:01:51 +00:00
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
void QUrl_SetQuery2(QUrl* self, const char* query, size_t query_Strlen, uintptr_t mode) {
QString query_QString = QString::fromUtf8(query, query_Strlen);
self->setQuery(query_QString, static_cast<QUrl::ParsingMode>(mode));
}
void QUrl_Query1(const QUrl* self, int param1, char** _out, int* _out_Strlen) {
QString ret = self->query(static_cast<QUrl::ComponentFormattingOptions>(param1));
2024-08-29 07:01:51 +00:00
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
void QUrl_Fragment1(const QUrl* self, int options, char** _out, int* _out_Strlen) {
QString ret = self->fragment(static_cast<QUrl::ComponentFormattingOptions>(options));
2024-08-29 07:01:51 +00:00
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray b = ret.toUtf8();
*_out = static_cast<char*>(malloc(b.length()));
memcpy(*_out, b.data(), b.length());
*_out_Strlen = b.length();
}
void QUrl_SetFragment2(QUrl* self, const char* fragment, size_t fragment_Strlen, uintptr_t mode) {
QString fragment_QString = QString::fromUtf8(fragment, fragment_Strlen);
self->setFragment(fragment_QString, static_cast<QUrl::ParsingMode>(mode));
}
QByteArray* QUrl_ToPercentEncoding2(const char* param1, size_t param1_Strlen, QByteArray* exclude) {
QString param1_QString = QString::fromUtf8(param1, param1_Strlen);
QByteArray ret = QUrl::toPercentEncoding(param1_QString, *exclude);
// Copy-construct value returned type into heap-allocated copy
return static_cast<QByteArray*>(new QByteArray(ret));
}
QByteArray* QUrl_ToPercentEncoding3(const char* param1, size_t param1_Strlen, QByteArray* exclude, QByteArray* include) {
QString param1_QString = QString::fromUtf8(param1, param1_Strlen);
QByteArray ret = QUrl::toPercentEncoding(param1_QString, *exclude, *include);
// Copy-construct value returned type into heap-allocated copy
return static_cast<QByteArray*>(new QByteArray(ret));
}
2024-08-29 07:01:51 +00:00
void QUrl_FromStringList2(char** uris, uint64_t* uris_Lengths, size_t uris_len, uintptr_t mode, QUrl*** _out, size_t* _out_len) {
QList<QString> uris_QList;
uris_QList.reserve(uris_len);
for(size_t i = 0; i < uris_len; ++i) {
uris_QList.push_back(QString::fromUtf8(uris[i], uris_Lengths[i]));
}
QList<QUrl> ret = QUrl::fromStringList(uris_QList, static_cast<QUrl::ParsingMode>(mode));
// Convert QList<> from C++ memory to manually-managed C memory of copy-constructed pointers
QUrl** __out = static_cast<QUrl**>(malloc(sizeof(QUrl**) * ret.length()));
for (size_t i = 0, e = ret.length(); i < e; ++i) {
__out[i] = new QUrl(ret[i]);
}
*_out = __out;
*_out_len = ret.length();
}
void QUrl_Delete(QUrl* self) {
delete self;
}