2024-08-25 04:08:24 +00:00
|
|
|
#include <QChar>
|
|
|
|
#include <QDir>
|
|
|
|
#include <QFileInfo>
|
|
|
|
#include <QList>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qdir.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qdir.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QDir_new(QDir* param1, QDir** outptr_QDir) {
|
|
|
|
QDir* ret = new QDir(*param1);
|
|
|
|
*outptr_QDir = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QDir_new2(QDir** outptr_QDir) {
|
|
|
|
QDir* ret = new QDir();
|
|
|
|
*outptr_QDir = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QDir_new3(struct miqt_string path, struct miqt_string nameFilter, QDir** outptr_QDir) {
|
2024-10-18 23:53:33 +00:00
|
|
|
QString path_QString = QString::fromUtf8(path.data, path.len);
|
|
|
|
QString nameFilter_QString = QString::fromUtf8(nameFilter.data, nameFilter.len);
|
2024-11-19 06:29:06 +00:00
|
|
|
QDir* ret = new QDir(path_QString, nameFilter_QString);
|
|
|
|
*outptr_QDir = ret;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QDir_new4(struct miqt_string path, QDir** outptr_QDir) {
|
2024-10-18 23:53:33 +00:00
|
|
|
QString path_QString = QString::fromUtf8(path.data, path.len);
|
2024-11-19 06:29:06 +00:00
|
|
|
QDir* ret = new QDir(path_QString);
|
|
|
|
*outptr_QDir = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QDir_new5(struct miqt_string path, struct miqt_string nameFilter, int sort, QDir** outptr_QDir) {
|
2024-10-18 23:53:33 +00:00
|
|
|
QString path_QString = QString::fromUtf8(path.data, path.len);
|
|
|
|
QString nameFilter_QString = QString::fromUtf8(nameFilter.data, nameFilter.len);
|
2024-11-19 06:29:06 +00:00
|
|
|
QDir* ret = new QDir(path_QString, nameFilter_QString, static_cast<QDir::SortFlags>(sort));
|
|
|
|
*outptr_QDir = ret;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QDir_new6(struct miqt_string path, struct miqt_string nameFilter, int sort, int filter, QDir** outptr_QDir) {
|
2024-10-18 23:53:33 +00:00
|
|
|
QString path_QString = QString::fromUtf8(path.data, path.len);
|
|
|
|
QString nameFilter_QString = QString::fromUtf8(nameFilter.data, nameFilter.len);
|
2024-11-19 06:29:06 +00:00
|
|
|
QDir* ret = new QDir(path_QString, nameFilter_QString, static_cast<QDir::SortFlags>(sort), static_cast<QDir::Filters>(filter));
|
|
|
|
*outptr_QDir = ret;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QDir_OperatorAssign(QDir* self, QDir* param1) {
|
|
|
|
self->operator=(*param1);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
void QDir_OperatorAssignWithPath(QDir* self, struct miqt_string path) {
|
|
|
|
QString path_QString = QString::fromUtf8(path.data, path.len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->operator=(path_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QDir_Swap(QDir* self, QDir* other) {
|
|
|
|
self->swap(*other);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
void QDir_SetPath(QDir* self, struct miqt_string path) {
|
|
|
|
QString path_QString = QString::fromUtf8(path.data, path.len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->setPath(path_QString);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QDir_Path(const QDir* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->path();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
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;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QDir_AbsolutePath(const QDir* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->absolutePath();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
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;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QDir_CanonicalPath(const QDir* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->canonicalPath();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
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;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
void QDir_AddResourceSearchPath(struct miqt_string path) {
|
|
|
|
QString path_QString = QString::fromUtf8(path.data, path.len);
|
2024-08-25 04:08:24 +00:00
|
|
|
QDir::addResourceSearchPath(path_QString);
|
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
void QDir_SetSearchPaths(struct miqt_string prefix, struct miqt_array /* of struct miqt_string */ searchPaths) {
|
2024-10-18 23:53:33 +00:00
|
|
|
QString prefix_QString = QString::fromUtf8(prefix.data, prefix.len);
|
2024-10-16 05:07:56 +00:00
|
|
|
QStringList searchPaths_QList;
|
2024-11-04 07:18:27 +00:00
|
|
|
searchPaths_QList.reserve(searchPaths.len);
|
|
|
|
struct miqt_string* searchPaths_arr = static_cast<struct miqt_string*>(searchPaths.data);
|
|
|
|
for(size_t i = 0; i < searchPaths.len; ++i) {
|
2024-10-18 23:53:33 +00:00
|
|
|
QString searchPaths_arr_i_QString = QString::fromUtf8(searchPaths_arr[i].data, searchPaths_arr[i].len);
|
2024-09-17 07:43:35 +00:00
|
|
|
searchPaths_QList.push_back(searchPaths_arr_i_QString);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
QDir::setSearchPaths(prefix_QString, searchPaths_QList);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
void QDir_AddSearchPath(struct miqt_string prefix, struct miqt_string path) {
|
|
|
|
QString prefix_QString = QString::fromUtf8(prefix.data, prefix.len);
|
|
|
|
QString path_QString = QString::fromUtf8(path.data, path.len);
|
2024-08-25 04:08:24 +00:00
|
|
|
QDir::addSearchPath(prefix_QString, path_QString);
|
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of struct miqt_string */ QDir_SearchPaths(struct miqt_string prefix) {
|
2024-10-18 23:53:33 +00:00
|
|
|
QString prefix_QString = QString::fromUtf8(prefix.data, prefix.len);
|
2024-09-14 22:29:05 +00:00
|
|
|
QStringList _ret = QDir::searchPaths(prefix_QString);
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string* _arr = static_cast<struct miqt_string*>(malloc(sizeof(struct miqt_string) * _ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
QString _lv_ret = _ret[i];
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _lv_b = _lv_ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string _lv_ms;
|
|
|
|
_lv_ms.len = _lv_b.length();
|
|
|
|
_lv_ms.data = static_cast<char*>(malloc(_lv_ms.len));
|
|
|
|
memcpy(_lv_ms.data, _lv_b.data(), _lv_ms.len);
|
|
|
|
_arr[i] = _lv_ms;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-09-14 22:29:05 +00:00
|
|
|
return _out;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QDir_DirName(const QDir* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->dirName();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
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;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QDir_FilePath(const QDir* self, struct miqt_string fileName) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(fileName.data, fileName.len);
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->filePath(fileName_QString);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
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;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QDir_AbsoluteFilePath(const QDir* self, struct miqt_string fileName) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(fileName.data, fileName.len);
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->absoluteFilePath(fileName_QString);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
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;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QDir_RelativeFilePath(const QDir* self, struct miqt_string fileName) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(fileName.data, fileName.len);
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->relativeFilePath(fileName_QString);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
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;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QDir_ToNativeSeparators(struct miqt_string pathName) {
|
|
|
|
QString pathName_QString = QString::fromUtf8(pathName.data, pathName.len);
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QDir::toNativeSeparators(pathName_QString);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
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;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QDir_FromNativeSeparators(struct miqt_string pathName) {
|
|
|
|
QString pathName_QString = QString::fromUtf8(pathName.data, pathName.len);
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QDir::fromNativeSeparators(pathName_QString);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
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;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
bool QDir_Cd(QDir* self, struct miqt_string dirName) {
|
|
|
|
QString dirName_QString = QString::fromUtf8(dirName.data, dirName.len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return self->cd(dirName_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QDir_CdUp(QDir* self) {
|
|
|
|
return self->cdUp();
|
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of struct miqt_string */ QDir_NameFilters(const QDir* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QStringList _ret = self->nameFilters();
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string* _arr = static_cast<struct miqt_string*>(malloc(sizeof(struct miqt_string) * _ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
QString _lv_ret = _ret[i];
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _lv_b = _lv_ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string _lv_ms;
|
|
|
|
_lv_ms.len = _lv_b.length();
|
|
|
|
_lv_ms.data = static_cast<char*>(malloc(_lv_ms.len));
|
|
|
|
memcpy(_lv_ms.data, _lv_b.data(), _lv_ms.len);
|
|
|
|
_arr[i] = _lv_ms;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-09-14 22:29:05 +00:00
|
|
|
return _out;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
void QDir_SetNameFilters(QDir* self, struct miqt_array /* of struct miqt_string */ nameFilters) {
|
2024-10-16 05:07:56 +00:00
|
|
|
QStringList nameFilters_QList;
|
2024-11-04 07:18:27 +00:00
|
|
|
nameFilters_QList.reserve(nameFilters.len);
|
|
|
|
struct miqt_string* nameFilters_arr = static_cast<struct miqt_string*>(nameFilters.data);
|
|
|
|
for(size_t i = 0; i < nameFilters.len; ++i) {
|
2024-10-18 23:53:33 +00:00
|
|
|
QString nameFilters_arr_i_QString = QString::fromUtf8(nameFilters_arr[i].data, nameFilters_arr[i].len);
|
2024-09-17 07:43:35 +00:00
|
|
|
nameFilters_QList.push_back(nameFilters_arr_i_QString);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
self->setNameFilters(nameFilters_QList);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QDir_Filter(const QDir* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QDir::Filters _ret = self->filter();
|
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QDir_SetFilter(QDir* self, int filter) {
|
|
|
|
self->setFilter(static_cast<QDir::Filters>(filter));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QDir_Sorting(const QDir* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QDir::SortFlags _ret = self->sorting();
|
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QDir_SetSorting(QDir* self, int sort) {
|
|
|
|
self->setSorting(static_cast<QDir::SortFlags>(sort));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
unsigned int QDir_Count(const QDir* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
uint _ret = self->count();
|
|
|
|
return static_cast<unsigned int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QDir_IsEmpty(const QDir* self) {
|
|
|
|
return self->isEmpty();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QDir_OperatorSubscript(const QDir* self, int param1) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->operator[](static_cast<int>(param1));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
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;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of struct miqt_string */ QDir_NameFiltersFromString(struct miqt_string nameFilter) {
|
2024-10-18 23:53:33 +00:00
|
|
|
QString nameFilter_QString = QString::fromUtf8(nameFilter.data, nameFilter.len);
|
2024-09-14 22:29:05 +00:00
|
|
|
QStringList _ret = QDir::nameFiltersFromString(nameFilter_QString);
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string* _arr = static_cast<struct miqt_string*>(malloc(sizeof(struct miqt_string) * _ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
QString _lv_ret = _ret[i];
|
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
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _lv_b = _lv_ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string _lv_ms;
|
|
|
|
_lv_ms.len = _lv_b.length();
|
|
|
|
_lv_ms.data = static_cast<char*>(malloc(_lv_ms.len));
|
|
|
|
memcpy(_lv_ms.data, _lv_b.data(), _lv_ms.len);
|
|
|
|
_arr[i] = _lv_ms;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-09-14 22:29:05 +00:00
|
|
|
return _out;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of struct miqt_string */ QDir_EntryList(const QDir* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QStringList _ret = self->entryList();
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string* _arr = static_cast<struct miqt_string*>(malloc(sizeof(struct miqt_string) * _ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
QString _lv_ret = _ret[i];
|
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
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _lv_b = _lv_ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string _lv_ms;
|
|
|
|
_lv_ms.len = _lv_b.length();
|
|
|
|
_lv_ms.data = static_cast<char*>(malloc(_lv_ms.len));
|
|
|
|
memcpy(_lv_ms.data, _lv_b.data(), _lv_ms.len);
|
|
|
|
_arr[i] = _lv_ms;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-09-14 22:29:05 +00:00
|
|
|
return _out;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of struct miqt_string */ QDir_EntryListWithNameFilters(const QDir* self, struct miqt_array /* of struct miqt_string */ nameFilters) {
|
2024-10-16 05:07:56 +00:00
|
|
|
QStringList nameFilters_QList;
|
2024-11-04 07:18:27 +00:00
|
|
|
nameFilters_QList.reserve(nameFilters.len);
|
|
|
|
struct miqt_string* nameFilters_arr = static_cast<struct miqt_string*>(nameFilters.data);
|
|
|
|
for(size_t i = 0; i < nameFilters.len; ++i) {
|
2024-10-18 23:53:33 +00:00
|
|
|
QString nameFilters_arr_i_QString = QString::fromUtf8(nameFilters_arr[i].data, nameFilters_arr[i].len);
|
2024-09-17 07:43:35 +00:00
|
|
|
nameFilters_QList.push_back(nameFilters_arr_i_QString);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
QStringList _ret = self->entryList(nameFilters_QList);
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string* _arr = static_cast<struct miqt_string*>(malloc(sizeof(struct miqt_string) * _ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
QString _lv_ret = _ret[i];
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _lv_b = _lv_ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string _lv_ms;
|
|
|
|
_lv_ms.len = _lv_b.length();
|
|
|
|
_lv_ms.data = static_cast<char*>(malloc(_lv_ms.len));
|
|
|
|
memcpy(_lv_ms.data, _lv_b.data(), _lv_ms.len);
|
|
|
|
_arr[i] = _lv_ms;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-09-14 22:29:05 +00:00
|
|
|
return _out;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of QFileInfo* */ QDir_EntryInfoList(const QDir* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QFileInfoList _ret = self->entryInfoList();
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
QFileInfo** _arr = static_cast<QFileInfo**>(malloc(sizeof(QFileInfo*) * _ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
_arr[i] = new QFileInfo(_ret[i]);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-09-14 22:29:05 +00:00
|
|
|
return _out;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of QFileInfo* */ QDir_EntryInfoListWithNameFilters(const QDir* self, struct miqt_array /* of struct miqt_string */ nameFilters) {
|
2024-10-16 05:07:56 +00:00
|
|
|
QStringList nameFilters_QList;
|
2024-11-04 07:18:27 +00:00
|
|
|
nameFilters_QList.reserve(nameFilters.len);
|
|
|
|
struct miqt_string* nameFilters_arr = static_cast<struct miqt_string*>(nameFilters.data);
|
|
|
|
for(size_t i = 0; i < nameFilters.len; ++i) {
|
2024-10-18 23:53:33 +00:00
|
|
|
QString nameFilters_arr_i_QString = QString::fromUtf8(nameFilters_arr[i].data, nameFilters_arr[i].len);
|
2024-09-17 07:43:35 +00:00
|
|
|
nameFilters_QList.push_back(nameFilters_arr_i_QString);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
QFileInfoList _ret = self->entryInfoList(nameFilters_QList);
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
QFileInfo** _arr = static_cast<QFileInfo**>(malloc(sizeof(QFileInfo*) * _ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
_arr[i] = new QFileInfo(_ret[i]);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-09-14 22:29:05 +00:00
|
|
|
return _out;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
bool QDir_Mkdir(const QDir* self, struct miqt_string dirName) {
|
|
|
|
QString dirName_QString = QString::fromUtf8(dirName.data, dirName.len);
|
2024-09-11 05:41:09 +00:00
|
|
|
return self->mkdir(dirName_QString);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
bool QDir_Rmdir(const QDir* self, struct miqt_string dirName) {
|
|
|
|
QString dirName_QString = QString::fromUtf8(dirName.data, dirName.len);
|
2024-09-11 05:41:09 +00:00
|
|
|
return self->rmdir(dirName_QString);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
bool QDir_Mkpath(const QDir* self, struct miqt_string dirPath) {
|
|
|
|
QString dirPath_QString = QString::fromUtf8(dirPath.data, dirPath.len);
|
2024-09-11 05:41:09 +00:00
|
|
|
return self->mkpath(dirPath_QString);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
bool QDir_Rmpath(const QDir* self, struct miqt_string dirPath) {
|
|
|
|
QString dirPath_QString = QString::fromUtf8(dirPath.data, dirPath.len);
|
2024-09-11 05:41:09 +00:00
|
|
|
return self->rmpath(dirPath_QString);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QDir_RemoveRecursively(QDir* self) {
|
|
|
|
return self->removeRecursively();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QDir_IsReadable(const QDir* self) {
|
|
|
|
return self->isReadable();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QDir_Exists(const QDir* self) {
|
|
|
|
return self->exists();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QDir_IsRoot(const QDir* self) {
|
|
|
|
return self->isRoot();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
bool QDir_IsRelativePath(struct miqt_string path) {
|
|
|
|
QString path_QString = QString::fromUtf8(path.data, path.len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return QDir::isRelativePath(path_QString);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
bool QDir_IsAbsolutePath(struct miqt_string path) {
|
|
|
|
QString path_QString = QString::fromUtf8(path.data, path.len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return QDir::isAbsolutePath(path_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QDir_IsRelative(const QDir* self) {
|
|
|
|
return self->isRelative();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QDir_IsAbsolute(const QDir* self) {
|
|
|
|
return self->isAbsolute();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QDir_MakeAbsolute(QDir* self) {
|
|
|
|
return self->makeAbsolute();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QDir_OperatorEqual(const QDir* self, QDir* dir) {
|
2024-11-22 06:06:01 +00:00
|
|
|
return (*self == *dir);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QDir_OperatorNotEqual(const QDir* self, QDir* dir) {
|
2024-11-22 06:06:01 +00:00
|
|
|
return (*self != *dir);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
bool QDir_Remove(QDir* self, struct miqt_string fileName) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(fileName.data, fileName.len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return self->remove(fileName_QString);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
bool QDir_Rename(QDir* self, struct miqt_string oldName, struct miqt_string newName) {
|
|
|
|
QString oldName_QString = QString::fromUtf8(oldName.data, oldName.len);
|
|
|
|
QString newName_QString = QString::fromUtf8(newName.data, newName.len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return self->rename(oldName_QString, newName_QString);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
bool QDir_ExistsWithName(const QDir* self, struct miqt_string name) {
|
|
|
|
QString name_QString = QString::fromUtf8(name.data, name.len);
|
2024-09-11 05:41:09 +00:00
|
|
|
return self->exists(name_QString);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of QFileInfo* */ QDir_Drives() {
|
2024-09-14 22:29:05 +00:00
|
|
|
QFileInfoList _ret = QDir::drives();
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
QFileInfo** _arr = static_cast<QFileInfo**>(malloc(sizeof(QFileInfo*) * _ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
_arr[i] = new QFileInfo(_ret[i]);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-09-14 22:29:05 +00:00
|
|
|
return _out;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QChar* QDir_ListSeparator() {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QChar(QDir::listSeparator());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QChar* QDir_Separator() {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QChar(QDir::separator());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
bool QDir_SetCurrent(struct miqt_string path) {
|
|
|
|
QString path_QString = QString::fromUtf8(path.data, path.len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return QDir::setCurrent(path_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
QDir* QDir_Current() {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QDir(QDir::current());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QDir_CurrentPath() {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QDir::currentPath();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
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;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QDir* QDir_Home() {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QDir(QDir::home());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QDir_HomePath() {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QDir::homePath();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
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;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QDir* QDir_Root() {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QDir(QDir::root());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QDir_RootPath() {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QDir::rootPath();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
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;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QDir* QDir_Temp() {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QDir(QDir::temp());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QDir_TempPath() {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QDir::tempPath();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
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;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
bool QDir_Match(struct miqt_array /* of struct miqt_string */ filters, struct miqt_string fileName) {
|
2024-10-16 05:07:56 +00:00
|
|
|
QStringList filters_QList;
|
2024-11-04 07:18:27 +00:00
|
|
|
filters_QList.reserve(filters.len);
|
|
|
|
struct miqt_string* filters_arr = static_cast<struct miqt_string*>(filters.data);
|
|
|
|
for(size_t i = 0; i < filters.len; ++i) {
|
2024-10-18 23:53:33 +00:00
|
|
|
QString filters_arr_i_QString = QString::fromUtf8(filters_arr[i].data, filters_arr[i].len);
|
2024-09-17 07:43:35 +00:00
|
|
|
filters_QList.push_back(filters_arr_i_QString);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-10-18 23:53:33 +00:00
|
|
|
QString fileName_QString = QString::fromUtf8(fileName.data, fileName.len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return QDir::match(filters_QList, fileName_QString);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
bool QDir_Match2(struct miqt_string filter, struct miqt_string fileName) {
|
|
|
|
QString filter_QString = QString::fromUtf8(filter.data, filter.len);
|
|
|
|
QString fileName_QString = QString::fromUtf8(fileName.data, fileName.len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return QDir::match(filter_QString, fileName_QString);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QDir_CleanPath(struct miqt_string path) {
|
|
|
|
QString path_QString = QString::fromUtf8(path.data, path.len);
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QDir::cleanPath(path_QString);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
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;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QDir_Refresh(const QDir* self) {
|
|
|
|
self->refresh();
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QDir_IsEmpty1(const QDir* self, int filters) {
|
|
|
|
return self->isEmpty(static_cast<QDir::Filters>(filters));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of struct miqt_string */ QDir_EntryList1(const QDir* self, int filters) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QStringList _ret = self->entryList(static_cast<QDir::Filters>(filters));
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string* _arr = static_cast<struct miqt_string*>(malloc(sizeof(struct miqt_string) * _ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
QString _lv_ret = _ret[i];
|
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
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _lv_b = _lv_ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string _lv_ms;
|
|
|
|
_lv_ms.len = _lv_b.length();
|
|
|
|
_lv_ms.data = static_cast<char*>(malloc(_lv_ms.len));
|
|
|
|
memcpy(_lv_ms.data, _lv_b.data(), _lv_ms.len);
|
|
|
|
_arr[i] = _lv_ms;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-09-14 22:29:05 +00:00
|
|
|
return _out;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of struct miqt_string */ QDir_EntryList2(const QDir* self, int filters, int sort) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QStringList _ret = self->entryList(static_cast<QDir::Filters>(filters), static_cast<QDir::SortFlags>(sort));
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string* _arr = static_cast<struct miqt_string*>(malloc(sizeof(struct miqt_string) * _ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
QString _lv_ret = _ret[i];
|
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
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _lv_b = _lv_ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string _lv_ms;
|
|
|
|
_lv_ms.len = _lv_b.length();
|
|
|
|
_lv_ms.data = static_cast<char*>(malloc(_lv_ms.len));
|
|
|
|
memcpy(_lv_ms.data, _lv_b.data(), _lv_ms.len);
|
|
|
|
_arr[i] = _lv_ms;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-09-14 22:29:05 +00:00
|
|
|
return _out;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of struct miqt_string */ QDir_EntryList22(const QDir* self, struct miqt_array /* of struct miqt_string */ nameFilters, int filters) {
|
2024-10-16 05:07:56 +00:00
|
|
|
QStringList nameFilters_QList;
|
2024-11-04 07:18:27 +00:00
|
|
|
nameFilters_QList.reserve(nameFilters.len);
|
|
|
|
struct miqt_string* nameFilters_arr = static_cast<struct miqt_string*>(nameFilters.data);
|
|
|
|
for(size_t i = 0; i < nameFilters.len; ++i) {
|
2024-10-18 23:53:33 +00:00
|
|
|
QString nameFilters_arr_i_QString = QString::fromUtf8(nameFilters_arr[i].data, nameFilters_arr[i].len);
|
2024-09-17 07:43:35 +00:00
|
|
|
nameFilters_QList.push_back(nameFilters_arr_i_QString);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
QStringList _ret = self->entryList(nameFilters_QList, static_cast<QDir::Filters>(filters));
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string* _arr = static_cast<struct miqt_string*>(malloc(sizeof(struct miqt_string) * _ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
QString _lv_ret = _ret[i];
|
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
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _lv_b = _lv_ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string _lv_ms;
|
|
|
|
_lv_ms.len = _lv_b.length();
|
|
|
|
_lv_ms.data = static_cast<char*>(malloc(_lv_ms.len));
|
|
|
|
memcpy(_lv_ms.data, _lv_b.data(), _lv_ms.len);
|
|
|
|
_arr[i] = _lv_ms;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-09-14 22:29:05 +00:00
|
|
|
return _out;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of struct miqt_string */ QDir_EntryList3(const QDir* self, struct miqt_array /* of struct miqt_string */ nameFilters, int filters, int sort) {
|
2024-10-16 05:07:56 +00:00
|
|
|
QStringList nameFilters_QList;
|
2024-11-04 07:18:27 +00:00
|
|
|
nameFilters_QList.reserve(nameFilters.len);
|
|
|
|
struct miqt_string* nameFilters_arr = static_cast<struct miqt_string*>(nameFilters.data);
|
|
|
|
for(size_t i = 0; i < nameFilters.len; ++i) {
|
2024-10-18 23:53:33 +00:00
|
|
|
QString nameFilters_arr_i_QString = QString::fromUtf8(nameFilters_arr[i].data, nameFilters_arr[i].len);
|
2024-09-17 07:43:35 +00:00
|
|
|
nameFilters_QList.push_back(nameFilters_arr_i_QString);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
QStringList _ret = self->entryList(nameFilters_QList, static_cast<QDir::Filters>(filters), static_cast<QDir::SortFlags>(sort));
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string* _arr = static_cast<struct miqt_string*>(malloc(sizeof(struct miqt_string) * _ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
QString _lv_ret = _ret[i];
|
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
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _lv_b = _lv_ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string _lv_ms;
|
|
|
|
_lv_ms.len = _lv_b.length();
|
|
|
|
_lv_ms.data = static_cast<char*>(malloc(_lv_ms.len));
|
|
|
|
memcpy(_lv_ms.data, _lv_b.data(), _lv_ms.len);
|
|
|
|
_arr[i] = _lv_ms;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-09-14 22:29:05 +00:00
|
|
|
return _out;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of QFileInfo* */ QDir_EntryInfoList1(const QDir* self, int filters) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QFileInfoList _ret = self->entryInfoList(static_cast<QDir::Filters>(filters));
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
QFileInfo** _arr = static_cast<QFileInfo**>(malloc(sizeof(QFileInfo*) * _ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
_arr[i] = new QFileInfo(_ret[i]);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-09-14 22:29:05 +00:00
|
|
|
return _out;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of QFileInfo* */ QDir_EntryInfoList2(const QDir* self, int filters, int sort) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QFileInfoList _ret = self->entryInfoList(static_cast<QDir::Filters>(filters), static_cast<QDir::SortFlags>(sort));
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
QFileInfo** _arr = static_cast<QFileInfo**>(malloc(sizeof(QFileInfo*) * _ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
_arr[i] = new QFileInfo(_ret[i]);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-09-14 22:29:05 +00:00
|
|
|
return _out;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of QFileInfo* */ QDir_EntryInfoList22(const QDir* self, struct miqt_array /* of struct miqt_string */ nameFilters, int filters) {
|
2024-10-16 05:07:56 +00:00
|
|
|
QStringList nameFilters_QList;
|
2024-11-04 07:18:27 +00:00
|
|
|
nameFilters_QList.reserve(nameFilters.len);
|
|
|
|
struct miqt_string* nameFilters_arr = static_cast<struct miqt_string*>(nameFilters.data);
|
|
|
|
for(size_t i = 0; i < nameFilters.len; ++i) {
|
2024-10-18 23:53:33 +00:00
|
|
|
QString nameFilters_arr_i_QString = QString::fromUtf8(nameFilters_arr[i].data, nameFilters_arr[i].len);
|
2024-09-17 07:43:35 +00:00
|
|
|
nameFilters_QList.push_back(nameFilters_arr_i_QString);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
QFileInfoList _ret = self->entryInfoList(nameFilters_QList, static_cast<QDir::Filters>(filters));
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
QFileInfo** _arr = static_cast<QFileInfo**>(malloc(sizeof(QFileInfo*) * _ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
_arr[i] = new QFileInfo(_ret[i]);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-09-14 22:29:05 +00:00
|
|
|
return _out;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of QFileInfo* */ QDir_EntryInfoList3(const QDir* self, struct miqt_array /* of struct miqt_string */ nameFilters, int filters, int sort) {
|
2024-10-16 05:07:56 +00:00
|
|
|
QStringList nameFilters_QList;
|
2024-11-04 07:18:27 +00:00
|
|
|
nameFilters_QList.reserve(nameFilters.len);
|
|
|
|
struct miqt_string* nameFilters_arr = static_cast<struct miqt_string*>(nameFilters.data);
|
|
|
|
for(size_t i = 0; i < nameFilters.len; ++i) {
|
2024-10-18 23:53:33 +00:00
|
|
|
QString nameFilters_arr_i_QString = QString::fromUtf8(nameFilters_arr[i].data, nameFilters_arr[i].len);
|
2024-09-17 07:43:35 +00:00
|
|
|
nameFilters_QList.push_back(nameFilters_arr_i_QString);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
QFileInfoList _ret = self->entryInfoList(nameFilters_QList, static_cast<QDir::Filters>(filters), static_cast<QDir::SortFlags>(sort));
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
QFileInfo** _arr = static_cast<QFileInfo**>(malloc(sizeof(QFileInfo*) * _ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
_arr[i] = new QFileInfo(_ret[i]);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-09-14 22:29:05 +00:00
|
|
|
return _out;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QDir_Delete(QDir* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QDir*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|