2024-08-25 04:08:24 +00:00
|
|
|
#include <QDateTime>
|
|
|
|
#include <QDir>
|
|
|
|
#include <QFile>
|
|
|
|
#include <QFileInfo>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
|
|
|
#include "qfileinfo.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qfileinfo.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
extern void miqt_exec_callback(void* cb, int argc, void* argv);
|
|
|
|
}
|
|
|
|
|
|
|
|
QFileInfo* QFileInfo_new() {
|
|
|
|
return new QFileInfo();
|
|
|
|
}
|
|
|
|
|
|
|
|
QFileInfo* QFileInfo_new2(const char* file, size_t file_Strlen) {
|
|
|
|
QString file_QString = QString::fromUtf8(file, file_Strlen);
|
|
|
|
return new QFileInfo(file_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
QFileInfo* QFileInfo_new3(QFile* file) {
|
|
|
|
return new QFileInfo(*file);
|
|
|
|
}
|
|
|
|
|
|
|
|
QFileInfo* QFileInfo_new4(QDir* dir, const char* file, size_t file_Strlen) {
|
|
|
|
QString file_QString = QString::fromUtf8(file, file_Strlen);
|
|
|
|
return new QFileInfo(*dir, file_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
QFileInfo* QFileInfo_new5(QFileInfo* fileinfo) {
|
|
|
|
return new QFileInfo(*fileinfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFileInfo_OperatorAssign(QFileInfo* self, QFileInfo* fileinfo) {
|
|
|
|
self->operator=(*fileinfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFileInfo_Swap(QFileInfo* self, QFileInfo* other) {
|
|
|
|
self->swap(*other);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFileInfo_OperatorEqual(const QFileInfo* self, QFileInfo* fileinfo) {
|
|
|
|
return self->operator==(*fileinfo);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFileInfo_OperatorNotEqual(const QFileInfo* self, QFileInfo* fileinfo) {
|
|
|
|
return self->operator!=(*fileinfo);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFileInfo_SetFile(QFileInfo* self, const char* file, size_t file_Strlen) {
|
|
|
|
QString file_QString = QString::fromUtf8(file, file_Strlen);
|
|
|
|
self->setFile(file_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFileInfo_SetFileWithFile(QFileInfo* self, QFile* file) {
|
|
|
|
self->setFile(*file);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFileInfo_SetFile2(QFileInfo* self, QDir* dir, const char* file, size_t file_Strlen) {
|
|
|
|
QString file_QString = QString::fromUtf8(file, file_Strlen);
|
|
|
|
self->setFile(*dir, file_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFileInfo_Exists(const QFileInfo* self) {
|
|
|
|
return self->exists();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QFileInfo_ExistsWithFile(const char* file, size_t file_Strlen) {
|
|
|
|
QString file_QString = QString::fromUtf8(file, file_Strlen);
|
|
|
|
return QFileInfo::exists(file_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFileInfo_Refresh(QFileInfo* self) {
|
|
|
|
self->refresh();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QFileInfo_FilePath(const QFileInfo* self, char** _out, int* _out_Strlen) {
|
|
|
|
QString ret = self->filePath();
|
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
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QFileInfo_AbsoluteFilePath(const QFileInfo* self, char** _out, int* _out_Strlen) {
|
|
|
|
QString ret = self->absoluteFilePath();
|
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
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QFileInfo_CanonicalFilePath(const QFileInfo* self, char** _out, int* _out_Strlen) {
|
|
|
|
QString ret = self->canonicalFilePath();
|
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
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QFileInfo_FileName(const QFileInfo* self, char** _out, int* _out_Strlen) {
|
|
|
|
QString ret = self->fileName();
|
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
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QFileInfo_BaseName(const QFileInfo* self, char** _out, int* _out_Strlen) {
|
|
|
|
QString ret = self->baseName();
|
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
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QFileInfo_CompleteBaseName(const QFileInfo* self, char** _out, int* _out_Strlen) {
|
|
|
|
QString ret = self->completeBaseName();
|
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
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QFileInfo_Suffix(const QFileInfo* self, char** _out, int* _out_Strlen) {
|
|
|
|
QString ret = self->suffix();
|
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
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QFileInfo_BundleName(const QFileInfo* self, char** _out, int* _out_Strlen) {
|
|
|
|
QString ret = self->bundleName();
|
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
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QFileInfo_CompleteSuffix(const QFileInfo* self, char** _out, int* _out_Strlen) {
|
|
|
|
QString ret = self->completeSuffix();
|
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
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QFileInfo_Path(const QFileInfo* self, char** _out, int* _out_Strlen) {
|
|
|
|
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
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QFileInfo_AbsolutePath(const QFileInfo* self, char** _out, int* _out_Strlen) {
|
|
|
|
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
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QFileInfo_CanonicalPath(const QFileInfo* self, char** _out, int* _out_Strlen) {
|
|
|
|
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
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QDir* QFileInfo_Dir(const QFileInfo* self) {
|
|
|
|
QDir ret = self->dir();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QDir*>(new QDir(ret));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QDir* QFileInfo_AbsoluteDir(const QFileInfo* self) {
|
|
|
|
QDir ret = self->absoluteDir();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QDir*>(new QDir(ret));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFileInfo_IsReadable(const QFileInfo* self) {
|
|
|
|
return self->isReadable();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFileInfo_IsWritable(const QFileInfo* self) {
|
|
|
|
return self->isWritable();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFileInfo_IsExecutable(const QFileInfo* self) {
|
|
|
|
return self->isExecutable();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFileInfo_IsHidden(const QFileInfo* self) {
|
|
|
|
return self->isHidden();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFileInfo_IsNativePath(const QFileInfo* self) {
|
|
|
|
return self->isNativePath();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFileInfo_IsRelative(const QFileInfo* self) {
|
|
|
|
return self->isRelative();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFileInfo_IsAbsolute(const QFileInfo* self) {
|
|
|
|
return self->isAbsolute();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QFileInfo_MakeAbsolute(QFileInfo* self) {
|
|
|
|
return self->makeAbsolute();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFileInfo_IsFile(const QFileInfo* self) {
|
|
|
|
return self->isFile();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFileInfo_IsDir(const QFileInfo* self) {
|
|
|
|
return self->isDir();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFileInfo_IsSymLink(const QFileInfo* self) {
|
|
|
|
return self->isSymLink();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFileInfo_IsSymbolicLink(const QFileInfo* self) {
|
|
|
|
return self->isSymbolicLink();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFileInfo_IsShortcut(const QFileInfo* self) {
|
|
|
|
return self->isShortcut();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFileInfo_IsJunction(const QFileInfo* self) {
|
|
|
|
return self->isJunction();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFileInfo_IsRoot(const QFileInfo* self) {
|
|
|
|
return self->isRoot();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFileInfo_IsBundle(const QFileInfo* self) {
|
|
|
|
return self->isBundle();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QFileInfo_ReadLink(const QFileInfo* self, char** _out, int* _out_Strlen) {
|
|
|
|
QString ret = self->readLink();
|
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
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QFileInfo_SymLinkTarget(const QFileInfo* self, char** _out, int* _out_Strlen) {
|
|
|
|
QString ret = self->symLinkTarget();
|
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
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QFileInfo_Owner(const QFileInfo* self, char** _out, int* _out_Strlen) {
|
|
|
|
QString ret = self->owner();
|
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
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
unsigned int QFileInfo_OwnerId(const QFileInfo* self) {
|
|
|
|
return self->ownerId();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QFileInfo_Group(const QFileInfo* self, char** _out, int* _out_Strlen) {
|
|
|
|
QString ret = self->group();
|
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
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
unsigned int QFileInfo_GroupId(const QFileInfo* self) {
|
|
|
|
return self->groupId();
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFileInfo_Permission(const QFileInfo* self, int permissions) {
|
|
|
|
return self->permission(static_cast<QFile::Permissions>(permissions));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFileInfo_Permissions(const QFileInfo* self) {
|
|
|
|
QFile::Permissions ret = self->permissions();
|
2024-08-29 07:01:51 +00:00
|
|
|
return static_cast<int>(ret);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
long long QFileInfo_Size(const QFileInfo* self) {
|
|
|
|
return self->size();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QDateTime* QFileInfo_Created(const QFileInfo* self) {
|
|
|
|
QDateTime ret = self->created();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QDateTime*>(new QDateTime(ret));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QDateTime* QFileInfo_BirthTime(const QFileInfo* self) {
|
|
|
|
QDateTime ret = self->birthTime();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QDateTime*>(new QDateTime(ret));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QDateTime* QFileInfo_MetadataChangeTime(const QFileInfo* self) {
|
|
|
|
QDateTime ret = self->metadataChangeTime();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QDateTime*>(new QDateTime(ret));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QDateTime* QFileInfo_LastModified(const QFileInfo* self) {
|
|
|
|
QDateTime ret = self->lastModified();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QDateTime*>(new QDateTime(ret));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QDateTime* QFileInfo_LastRead(const QFileInfo* self) {
|
|
|
|
QDateTime ret = self->lastRead();
|
2024-08-29 07:01:51 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QDateTime*>(new QDateTime(ret));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QDateTime* QFileInfo_FileTime(const QFileInfo* self, uintptr_t time) {
|
|
|
|
QDateTime ret = self->fileTime(static_cast<QFile::FileTime>(time));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QDateTime*>(new QDateTime(ret));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFileInfo_Caching(const QFileInfo* self) {
|
|
|
|
return self->caching();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFileInfo_SetCaching(QFileInfo* self, bool on) {
|
|
|
|
self->setCaching(on);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFileInfo_Delete(QFileInfo* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|