#include #include #include #include #include #include "qstandardpaths.h" #include "gen_qstandardpaths.h" #include "_cgo_export.h" struct miqt_string* QStandardPaths_WritableLocation(uintptr_t typeVal) { QString _ret = QStandardPaths::writableLocation(static_cast(typeVal)); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); return miqt_strdup(_b.data(), _b.length()); } struct miqt_array* QStandardPaths_StandardLocations(uintptr_t typeVal) { QStringList _ret = QStandardPaths::standardLocations(static_cast(typeVal)); // Convert QStringList from C++ memory to manually-managed C memory struct miqt_string** _arr = static_cast(malloc(sizeof(struct miqt_string*) * _ret.length())); for (size_t i = 0, e = _ret.length(); i < e; ++i) { QString _lv_ret = _ret[i]; // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _lv_b = _lv_ret.toUtf8(); _arr[i] = miqt_strdup(_lv_b.data(), _lv_b.length()); } struct miqt_array* _out = static_cast(malloc(sizeof(struct miqt_array))); _out->len = _ret.length(); _out->data = static_cast(_arr); return _out; } struct miqt_string* QStandardPaths_Locate(uintptr_t typeVal, struct miqt_string* fileName) { QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len); QString _ret = QStandardPaths::locate(static_cast(typeVal), fileName_QString); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); return miqt_strdup(_b.data(), _b.length()); } struct miqt_array* QStandardPaths_LocateAll(uintptr_t typeVal, struct miqt_string* fileName) { QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len); QStringList _ret = QStandardPaths::locateAll(static_cast(typeVal), fileName_QString); // Convert QStringList from C++ memory to manually-managed C memory struct miqt_string** _arr = static_cast(malloc(sizeof(struct miqt_string*) * _ret.length())); for (size_t i = 0, e = _ret.length(); i < e; ++i) { QString _lv_ret = _ret[i]; // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _lv_b = _lv_ret.toUtf8(); _arr[i] = miqt_strdup(_lv_b.data(), _lv_b.length()); } struct miqt_array* _out = static_cast(malloc(sizeof(struct miqt_array))); _out->len = _ret.length(); _out->data = static_cast(_arr); return _out; } struct miqt_string* QStandardPaths_DisplayName(uintptr_t typeVal) { QString _ret = QStandardPaths::displayName(static_cast(typeVal)); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); return miqt_strdup(_b.data(), _b.length()); } struct miqt_string* QStandardPaths_FindExecutable(struct miqt_string* executableName) { QString executableName_QString = QString::fromUtf8(&executableName->data, executableName->len); QString _ret = QStandardPaths::findExecutable(executableName_QString); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); return miqt_strdup(_b.data(), _b.length()); } void QStandardPaths_EnableTestMode(bool testMode) { QStandardPaths::enableTestMode(testMode); } void QStandardPaths_SetTestModeEnabled(bool testMode) { QStandardPaths::setTestModeEnabled(testMode); } bool QStandardPaths_IsTestModeEnabled() { return QStandardPaths::isTestModeEnabled(); } struct miqt_string* QStandardPaths_Locate3(uintptr_t typeVal, struct miqt_string* fileName, int options) { QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len); QString _ret = QStandardPaths::locate(static_cast(typeVal), fileName_QString, static_cast(options)); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); return miqt_strdup(_b.data(), _b.length()); } struct miqt_array* QStandardPaths_LocateAll3(uintptr_t typeVal, struct miqt_string* fileName, int options) { QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len); QStringList _ret = QStandardPaths::locateAll(static_cast(typeVal), fileName_QString, static_cast(options)); // Convert QStringList from C++ memory to manually-managed C memory struct miqt_string** _arr = static_cast(malloc(sizeof(struct miqt_string*) * _ret.length())); for (size_t i = 0, e = _ret.length(); i < e; ++i) { QString _lv_ret = _ret[i]; // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _lv_b = _lv_ret.toUtf8(); _arr[i] = miqt_strdup(_lv_b.data(), _lv_b.length()); } struct miqt_array* _out = static_cast(malloc(sizeof(struct miqt_array))); _out->len = _ret.length(); _out->data = static_cast(_arr); return _out; } struct miqt_string* QStandardPaths_FindExecutable2(struct miqt_string* executableName, struct miqt_array* /* of QString */ paths) { QString executableName_QString = QString::fromUtf8(&executableName->data, executableName->len); QList paths_QList; paths_QList.reserve(paths->len); miqt_string** paths_arr = static_cast(paths->data); for(size_t i = 0; i < paths->len; ++i) { paths_QList.push_back(QString::fromUtf8(& paths_arr[i]->data, paths_arr[i]->len)); } QString _ret = QStandardPaths::findExecutable(executableName_QString, paths_QList); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); return miqt_strdup(_b.data(), _b.length()); }