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>
|
|
|
|
#include "qdir.h"
|
|
|
|
#include "gen_qdir.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
QDir* QDir_new(QDir* param1) {
|
|
|
|
return new QDir(*param1);
|
|
|
|
}
|
|
|
|
|
|
|
|
QDir* QDir_new2() {
|
|
|
|
return new QDir();
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QDir* QDir_new3(struct miqt_string* path, struct miqt_string* nameFilter) {
|
|
|
|
QString path_QString = QString::fromUtf8(&path->data, path->len);
|
|
|
|
QString nameFilter_QString = QString::fromUtf8(&nameFilter->data, nameFilter->len);
|
2024-08-29 07:01:51 +00:00
|
|
|
return new QDir(path_QString, nameFilter_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QDir* QDir_new4(struct miqt_string* path) {
|
|
|
|
QString path_QString = QString::fromUtf8(&path->data, path->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QDir(path_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QDir* QDir_new5(struct miqt_string* path, struct miqt_string* nameFilter, int sort) {
|
|
|
|
QString path_QString = QString::fromUtf8(&path->data, path->len);
|
|
|
|
QString nameFilter_QString = QString::fromUtf8(&nameFilter->data, nameFilter->len);
|
2024-08-29 07:01:51 +00:00
|
|
|
return new QDir(path_QString, nameFilter_QString, static_cast<QDir::SortFlags>(sort));
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QDir* QDir_new6(struct miqt_string* path, struct miqt_string* nameFilter, int sort, int filter) {
|
|
|
|
QString path_QString = QString::fromUtf8(&path->data, path->len);
|
|
|
|
QString nameFilter_QString = QString::fromUtf8(&nameFilter->data, nameFilter->len);
|
2024-08-29 07:01:51 +00:00
|
|
|
return new QDir(path_QString, nameFilter_QString, static_cast<QDir::SortFlags>(sort), static_cast<QDir::Filters>(filter));
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QDir_OperatorAssign(QDir* self, QDir* param1) {
|
|
|
|
self->operator=(*param1);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +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-09-14 22:29:05 +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-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QDir_Path(const QDir* self) {
|
|
|
|
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();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QDir_AbsolutePath(const QDir* self) {
|
|
|
|
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();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QDir_CanonicalPath(const QDir* self) {
|
|
|
|
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();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +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-09-14 22:29:05 +00:00
|
|
|
void QDir_SetSearchPaths(struct miqt_string* prefix, struct miqt_array* /* of QString */ searchPaths) {
|
|
|
|
QString prefix_QString = QString::fromUtf8(&prefix->data, prefix->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
QList<QString> searchPaths_QList;
|
2024-09-14 22:29:05 +00:00
|
|
|
searchPaths_QList.reserve(searchPaths->len);
|
|
|
|
miqt_string** searchPaths_arr = static_cast<miqt_string**>(searchPaths->data);
|
|
|
|
for(size_t i = 0; i < searchPaths->len; ++i) {
|
|
|
|
searchPaths_QList.push_back(QString::fromUtf8(& searchPaths_arr[i]->data, searchPaths_arr[i]->len));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
QDir::setSearchPaths(prefix_QString, searchPaths_QList);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +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-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QDir_SearchPaths(struct miqt_string* prefix) {
|
|
|
|
QString prefix_QString = QString::fromUtf8(&prefix->data, prefix->len);
|
|
|
|
QStringList _ret = QDir::searchPaths(prefix_QString);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QStringList from C++ memory to manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string** _arr = static_cast<struct miqt_string**>(malloc(sizeof(struct miqt_string*) * _ret.length()));
|
|
|
|
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();
|
|
|
|
_arr[i] = miqt_strdup(_lv_b.data(), _lv_b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
_out->len = _ret.length();
|
|
|
|
_out->data = static_cast<void*>(_arr);
|
|
|
|
return _out;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QDir_DirName(const QDir* self) {
|
|
|
|
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();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QDir_FilePath(const QDir* self, struct miqt_string* fileName) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len);
|
|
|
|
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();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QDir_AbsoluteFilePath(const QDir* self, struct miqt_string* fileName) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len);
|
|
|
|
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();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QDir_RelativeFilePath(const QDir* self, struct miqt_string* fileName) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len);
|
|
|
|
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();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QDir_ToNativeSeparators(struct miqt_string* pathName) {
|
|
|
|
QString pathName_QString = QString::fromUtf8(&pathName->data, pathName->len);
|
|
|
|
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();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QDir_FromNativeSeparators(struct miqt_string* pathName) {
|
|
|
|
QString pathName_QString = QString::fromUtf8(&pathName->data, pathName->len);
|
|
|
|
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();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +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-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QDir_NameFilters(const QDir* self) {
|
|
|
|
QStringList _ret = self->nameFilters();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QStringList from C++ memory to manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string** _arr = static_cast<struct miqt_string**>(malloc(sizeof(struct miqt_string*) * _ret.length()));
|
|
|
|
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();
|
|
|
|
_arr[i] = miqt_strdup(_lv_b.data(), _lv_b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
_out->len = _ret.length();
|
|
|
|
_out->data = static_cast<void*>(_arr);
|
|
|
|
return _out;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
void QDir_SetNameFilters(QDir* self, struct miqt_array* /* of QString */ nameFilters) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QList<QString> nameFilters_QList;
|
2024-09-14 22:29:05 +00:00
|
|
|
nameFilters_QList.reserve(nameFilters->len);
|
|
|
|
miqt_string** nameFilters_arr = static_cast<miqt_string**>(nameFilters->data);
|
|
|
|
for(size_t i = 0; i < nameFilters->len; ++i) {
|
|
|
|
nameFilters_QList.push_back(QString::fromUtf8(& nameFilters_arr[i]->data, nameFilters_arr[i]->len));
|
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) {
|
|
|
|
return self->count();
|
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-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QDir_OperatorSubscript(const QDir* self, int param1) {
|
|
|
|
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();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QDir_NameFiltersFromString(struct miqt_string* nameFilter) {
|
|
|
|
QString nameFilter_QString = QString::fromUtf8(&nameFilter->data, nameFilter->len);
|
|
|
|
QStringList _ret = QDir::nameFiltersFromString(nameFilter_QString);
|
2024-08-29 07:01:51 +00:00
|
|
|
// Convert QStringList from C++ memory to manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string** _arr = static_cast<struct miqt_string**>(malloc(sizeof(struct miqt_string*) * _ret.length()));
|
|
|
|
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();
|
|
|
|
_arr[i] = miqt_strdup(_lv_b.data(), _lv_b.length());
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
_out->len = _ret.length();
|
|
|
|
_out->data = static_cast<void*>(_arr);
|
|
|
|
return _out;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QDir_EntryList(const QDir* self) {
|
|
|
|
QStringList _ret = self->entryList();
|
2024-08-29 07:01:51 +00:00
|
|
|
// Convert QStringList from C++ memory to manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string** _arr = static_cast<struct miqt_string**>(malloc(sizeof(struct miqt_string*) * _ret.length()));
|
|
|
|
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();
|
|
|
|
_arr[i] = miqt_strdup(_lv_b.data(), _lv_b.length());
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
_out->len = _ret.length();
|
|
|
|
_out->data = static_cast<void*>(_arr);
|
|
|
|
return _out;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QDir_EntryListWithNameFilters(const QDir* self, struct miqt_array* /* of QString */ nameFilters) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QList<QString> nameFilters_QList;
|
2024-09-14 22:29:05 +00:00
|
|
|
nameFilters_QList.reserve(nameFilters->len);
|
|
|
|
miqt_string** nameFilters_arr = static_cast<miqt_string**>(nameFilters->data);
|
|
|
|
for(size_t i = 0; i < nameFilters->len; ++i) {
|
|
|
|
nameFilters_QList.push_back(QString::fromUtf8(& nameFilters_arr[i]->data, nameFilters_arr[i]->len));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
QStringList _ret = self->entryList(nameFilters_QList);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QStringList from C++ memory to manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string** _arr = static_cast<struct miqt_string**>(malloc(sizeof(struct miqt_string*) * _ret.length()));
|
|
|
|
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();
|
|
|
|
_arr[i] = miqt_strdup(_lv_b.data(), _lv_b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
_out->len = _ret.length();
|
|
|
|
_out->data = static_cast<void*>(_arr);
|
|
|
|
return _out;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QDir_EntryInfoList(const QDir* self) {
|
|
|
|
QFileInfoList _ret = self->entryInfoList();
|
2024-08-29 07:01:51 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory of copy-constructed pointers
|
2024-09-14 22:29:05 +00:00
|
|
|
QFileInfo** _arr = static_cast<QFileInfo**>(malloc(sizeof(QFileInfo**) * _ret.length()));
|
|
|
|
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-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
_out->len = _ret.length();
|
|
|
|
_out->data = static_cast<void*>(_arr);
|
|
|
|
return _out;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QDir_EntryInfoListWithNameFilters(const QDir* self, struct miqt_array* /* of QString */ nameFilters) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QList<QString> nameFilters_QList;
|
2024-09-14 22:29:05 +00:00
|
|
|
nameFilters_QList.reserve(nameFilters->len);
|
|
|
|
miqt_string** nameFilters_arr = static_cast<miqt_string**>(nameFilters->data);
|
|
|
|
for(size_t i = 0; i < nameFilters->len; ++i) {
|
|
|
|
nameFilters_QList.push_back(QString::fromUtf8(& nameFilters_arr[i]->data, nameFilters_arr[i]->len));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
QFileInfoList _ret = self->entryInfoList(nameFilters_QList);
|
2024-08-29 07:01:51 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory of copy-constructed pointers
|
2024-09-14 22:29:05 +00:00
|
|
|
QFileInfo** _arr = static_cast<QFileInfo**>(malloc(sizeof(QFileInfo**) * _ret.length()));
|
|
|
|
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-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
_out->len = _ret.length();
|
|
|
|
_out->data = static_cast<void*>(_arr);
|
|
|
|
return _out;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +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-09-14 22:29:05 +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-09-14 22:29:05 +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-09-14 22:29:05 +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-09-14 22:29:05 +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-09-14 22:29:05 +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) {
|
|
|
|
return self->operator==(*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) {
|
|
|
|
return self->operator!=(*dir);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +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-09-14 22:29:05 +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-09-14 22:29:05 +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-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QDir_Drives() {
|
|
|
|
QFileInfoList _ret = QDir::drives();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory of copy-constructed pointers
|
2024-09-14 22:29:05 +00:00
|
|
|
QFileInfo** _arr = static_cast<QFileInfo**>(malloc(sizeof(QFileInfo**) * _ret.length()));
|
|
|
|
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-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
_out->len = _ret.length();
|
|
|
|
_out->data = static_cast<void*>(_arr);
|
|
|
|
return _out;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QChar* QDir_ListSeparator() {
|
2024-09-14 22:29:05 +00:00
|
|
|
QChar _ret = QDir::listSeparator();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
2024-09-14 22:29:05 +00:00
|
|
|
return static_cast<QChar*>(new QChar(_ret));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QChar* QDir_Separator() {
|
2024-09-14 22:29:05 +00:00
|
|
|
QChar _ret = QDir::separator();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
2024-09-14 22:29:05 +00:00
|
|
|
return static_cast<QChar*>(new QChar(_ret));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +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-14 22:29:05 +00:00
|
|
|
QDir _ret = QDir::current();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
2024-09-14 22:29:05 +00:00
|
|
|
return static_cast<QDir*>(new QDir(_ret));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QDir_CurrentPath() {
|
|
|
|
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();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QDir* QDir_Home() {
|
2024-09-14 22:29:05 +00:00
|
|
|
QDir _ret = QDir::home();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
2024-09-14 22:29:05 +00:00
|
|
|
return static_cast<QDir*>(new QDir(_ret));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QDir_HomePath() {
|
|
|
|
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();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QDir* QDir_Root() {
|
2024-09-14 22:29:05 +00:00
|
|
|
QDir _ret = QDir::root();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
2024-09-14 22:29:05 +00:00
|
|
|
return static_cast<QDir*>(new QDir(_ret));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QDir_RootPath() {
|
|
|
|
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();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QDir* QDir_Temp() {
|
2024-09-14 22:29:05 +00:00
|
|
|
QDir _ret = QDir::temp();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
2024-09-14 22:29:05 +00:00
|
|
|
return static_cast<QDir*>(new QDir(_ret));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QDir_TempPath() {
|
|
|
|
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();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
bool QDir_Match(struct miqt_array* /* of QString */ filters, struct miqt_string* fileName) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QList<QString> filters_QList;
|
2024-09-14 22:29:05 +00:00
|
|
|
filters_QList.reserve(filters->len);
|
|
|
|
miqt_string** filters_arr = static_cast<miqt_string**>(filters->data);
|
|
|
|
for(size_t i = 0; i < filters->len; ++i) {
|
|
|
|
filters_QList.push_back(QString::fromUtf8(& filters_arr[i]->data, filters_arr[i]->len));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +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-09-14 22:29:05 +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-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QDir_CleanPath(struct miqt_string* path) {
|
|
|
|
QString path_QString = QString::fromUtf8(&path->data, path->len);
|
|
|
|
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();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
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-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QDir_EntryList1(const QDir* self, int filters) {
|
|
|
|
QStringList _ret = self->entryList(static_cast<QDir::Filters>(filters));
|
2024-08-29 07:01:51 +00:00
|
|
|
// Convert QStringList from C++ memory to manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string** _arr = static_cast<struct miqt_string**>(malloc(sizeof(struct miqt_string*) * _ret.length()));
|
|
|
|
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();
|
|
|
|
_arr[i] = miqt_strdup(_lv_b.data(), _lv_b.length());
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
_out->len = _ret.length();
|
|
|
|
_out->data = static_cast<void*>(_arr);
|
|
|
|
return _out;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QDir_EntryList2(const QDir* self, int filters, int sort) {
|
|
|
|
QStringList _ret = self->entryList(static_cast<QDir::Filters>(filters), static_cast<QDir::SortFlags>(sort));
|
2024-08-29 07:01:51 +00:00
|
|
|
// Convert QStringList from C++ memory to manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string** _arr = static_cast<struct miqt_string**>(malloc(sizeof(struct miqt_string*) * _ret.length()));
|
|
|
|
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();
|
|
|
|
_arr[i] = miqt_strdup(_lv_b.data(), _lv_b.length());
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
_out->len = _ret.length();
|
|
|
|
_out->data = static_cast<void*>(_arr);
|
|
|
|
return _out;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QDir_EntryList22(const QDir* self, struct miqt_array* /* of QString */ nameFilters, int filters) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QList<QString> nameFilters_QList;
|
2024-09-14 22:29:05 +00:00
|
|
|
nameFilters_QList.reserve(nameFilters->len);
|
|
|
|
miqt_string** nameFilters_arr = static_cast<miqt_string**>(nameFilters->data);
|
|
|
|
for(size_t i = 0; i < nameFilters->len; ++i) {
|
|
|
|
nameFilters_QList.push_back(QString::fromUtf8(& nameFilters_arr[i]->data, nameFilters_arr[i]->len));
|
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-08-29 07:01:51 +00:00
|
|
|
// Convert QStringList from C++ memory to manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string** _arr = static_cast<struct miqt_string**>(malloc(sizeof(struct miqt_string*) * _ret.length()));
|
|
|
|
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();
|
|
|
|
_arr[i] = miqt_strdup(_lv_b.data(), _lv_b.length());
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
_out->len = _ret.length();
|
|
|
|
_out->data = static_cast<void*>(_arr);
|
|
|
|
return _out;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QDir_EntryList3(const QDir* self, struct miqt_array* /* of QString */ nameFilters, int filters, int sort) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QList<QString> nameFilters_QList;
|
2024-09-14 22:29:05 +00:00
|
|
|
nameFilters_QList.reserve(nameFilters->len);
|
|
|
|
miqt_string** nameFilters_arr = static_cast<miqt_string**>(nameFilters->data);
|
|
|
|
for(size_t i = 0; i < nameFilters->len; ++i) {
|
|
|
|
nameFilters_QList.push_back(QString::fromUtf8(& nameFilters_arr[i]->data, nameFilters_arr[i]->len));
|
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-08-29 07:01:51 +00:00
|
|
|
// Convert QStringList from C++ memory to manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string** _arr = static_cast<struct miqt_string**>(malloc(sizeof(struct miqt_string*) * _ret.length()));
|
|
|
|
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();
|
|
|
|
_arr[i] = miqt_strdup(_lv_b.data(), _lv_b.length());
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
_out->len = _ret.length();
|
|
|
|
_out->data = static_cast<void*>(_arr);
|
|
|
|
return _out;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QDir_EntryInfoList1(const QDir* self, int filters) {
|
|
|
|
QFileInfoList _ret = self->entryInfoList(static_cast<QDir::Filters>(filters));
|
2024-08-29 07:01:51 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory of copy-constructed pointers
|
2024-09-14 22:29:05 +00:00
|
|
|
QFileInfo** _arr = static_cast<QFileInfo**>(malloc(sizeof(QFileInfo**) * _ret.length()));
|
|
|
|
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-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
_out->len = _ret.length();
|
|
|
|
_out->data = static_cast<void*>(_arr);
|
|
|
|
return _out;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QDir_EntryInfoList2(const QDir* self, int filters, int sort) {
|
|
|
|
QFileInfoList _ret = self->entryInfoList(static_cast<QDir::Filters>(filters), static_cast<QDir::SortFlags>(sort));
|
2024-08-29 07:01:51 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory of copy-constructed pointers
|
2024-09-14 22:29:05 +00:00
|
|
|
QFileInfo** _arr = static_cast<QFileInfo**>(malloc(sizeof(QFileInfo**) * _ret.length()));
|
|
|
|
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-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
_out->len = _ret.length();
|
|
|
|
_out->data = static_cast<void*>(_arr);
|
|
|
|
return _out;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QDir_EntryInfoList22(const QDir* self, struct miqt_array* /* of QString */ nameFilters, int filters) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QList<QString> nameFilters_QList;
|
2024-09-14 22:29:05 +00:00
|
|
|
nameFilters_QList.reserve(nameFilters->len);
|
|
|
|
miqt_string** nameFilters_arr = static_cast<miqt_string**>(nameFilters->data);
|
|
|
|
for(size_t i = 0; i < nameFilters->len; ++i) {
|
|
|
|
nameFilters_QList.push_back(QString::fromUtf8(& nameFilters_arr[i]->data, nameFilters_arr[i]->len));
|
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-08-29 07:01:51 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory of copy-constructed pointers
|
2024-09-14 22:29:05 +00:00
|
|
|
QFileInfo** _arr = static_cast<QFileInfo**>(malloc(sizeof(QFileInfo**) * _ret.length()));
|
|
|
|
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-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
_out->len = _ret.length();
|
|
|
|
_out->data = static_cast<void*>(_arr);
|
|
|
|
return _out;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QDir_EntryInfoList3(const QDir* self, struct miqt_array* /* of QString */ nameFilters, int filters, int sort) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QList<QString> nameFilters_QList;
|
2024-09-14 22:29:05 +00:00
|
|
|
nameFilters_QList.reserve(nameFilters->len);
|
|
|
|
miqt_string** nameFilters_arr = static_cast<miqt_string**>(nameFilters->data);
|
|
|
|
for(size_t i = 0; i < nameFilters->len; ++i) {
|
|
|
|
nameFilters_QList.push_back(QString::fromUtf8(& nameFilters_arr[i]->data, nameFilters_arr[i]->len));
|
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-08-29 07:01:51 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory of copy-constructed pointers
|
2024-09-14 22:29:05 +00:00
|
|
|
QFileInfo** _arr = static_cast<QFileInfo**>(malloc(sizeof(QFileInfo**) * _ret.length()));
|
|
|
|
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-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
_out->len = _ret.length();
|
|
|
|
_out->data = static_cast<void*>(_arr);
|
|
|
|
return _out;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QDir_Delete(QDir* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|