2024-08-25 04:08:24 +00:00
|
|
|
#include <QList>
|
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QObject>
|
|
|
|
#include <QSettings>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
2024-08-25 04:08:24 +00:00
|
|
|
#include <QTextCodec>
|
|
|
|
#include <QVariant>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qsettings.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qsettings.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QSettings* QSettings_new(struct miqt_string organization) {
|
|
|
|
QString organization_QString = QString::fromUtf8(organization.data, organization.len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QSettings(organization_QString);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QSettings* QSettings_new2(int scope, struct miqt_string organization) {
|
|
|
|
QString organization_QString = QString::fromUtf8(organization.data, organization.len);
|
2024-08-29 07:01:51 +00:00
|
|
|
return new QSettings(static_cast<QSettings::Scope>(scope), organization_QString);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QSettings* QSettings_new3(int format, int scope, struct miqt_string organization) {
|
|
|
|
QString organization_QString = QString::fromUtf8(organization.data, organization.len);
|
2024-08-29 07:01:51 +00:00
|
|
|
return new QSettings(static_cast<QSettings::Format>(format), static_cast<QSettings::Scope>(scope), organization_QString);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QSettings* QSettings_new4(struct miqt_string fileName, int format) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(fileName.data, fileName.len);
|
2024-08-29 07:01:51 +00:00
|
|
|
return new QSettings(fileName_QString, static_cast<QSettings::Format>(format));
|
|
|
|
}
|
|
|
|
|
|
|
|
QSettings* QSettings_new5() {
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QSettings();
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
QSettings* QSettings_new6(int scope) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return new QSettings(static_cast<QSettings::Scope>(scope));
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QSettings* QSettings_new7(struct miqt_string organization, struct miqt_string application) {
|
|
|
|
QString organization_QString = QString::fromUtf8(organization.data, organization.len);
|
|
|
|
QString application_QString = QString::fromUtf8(application.data, application.len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QSettings(organization_QString, application_QString);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QSettings* QSettings_new8(struct miqt_string organization, struct miqt_string application, QObject* parent) {
|
|
|
|
QString organization_QString = QString::fromUtf8(organization.data, organization.len);
|
|
|
|
QString application_QString = QString::fromUtf8(application.data, application.len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QSettings(organization_QString, application_QString, parent);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QSettings* QSettings_new9(int scope, struct miqt_string organization, struct miqt_string application) {
|
|
|
|
QString organization_QString = QString::fromUtf8(organization.data, organization.len);
|
|
|
|
QString application_QString = QString::fromUtf8(application.data, application.len);
|
2024-08-29 07:01:51 +00:00
|
|
|
return new QSettings(static_cast<QSettings::Scope>(scope), organization_QString, application_QString);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QSettings* QSettings_new10(int scope, struct miqt_string organization, struct miqt_string application, QObject* parent) {
|
|
|
|
QString organization_QString = QString::fromUtf8(organization.data, organization.len);
|
|
|
|
QString application_QString = QString::fromUtf8(application.data, application.len);
|
2024-08-29 07:01:51 +00:00
|
|
|
return new QSettings(static_cast<QSettings::Scope>(scope), organization_QString, application_QString, parent);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QSettings* QSettings_new11(int format, int scope, struct miqt_string organization, struct miqt_string application) {
|
|
|
|
QString organization_QString = QString::fromUtf8(organization.data, organization.len);
|
|
|
|
QString application_QString = QString::fromUtf8(application.data, application.len);
|
2024-08-29 07:01:51 +00:00
|
|
|
return new QSettings(static_cast<QSettings::Format>(format), static_cast<QSettings::Scope>(scope), organization_QString, application_QString);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QSettings* QSettings_new12(int format, int scope, struct miqt_string organization, struct miqt_string application, QObject* parent) {
|
|
|
|
QString organization_QString = QString::fromUtf8(organization.data, organization.len);
|
|
|
|
QString application_QString = QString::fromUtf8(application.data, application.len);
|
2024-08-29 07:01:51 +00:00
|
|
|
return new QSettings(static_cast<QSettings::Format>(format), static_cast<QSettings::Scope>(scope), organization_QString, application_QString, parent);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QSettings* QSettings_new13(struct miqt_string fileName, int format, QObject* parent) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(fileName.data, fileName.len);
|
2024-08-29 07:01:51 +00:00
|
|
|
return new QSettings(fileName_QString, static_cast<QSettings::Format>(format), parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
QSettings* QSettings_new14(QObject* parent) {
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QSettings(parent);
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
QSettings* QSettings_new15(int scope, QObject* parent) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return new QSettings(static_cast<QSettings::Scope>(scope), parent);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMetaObject* QSettings_MetaObject(const QSettings* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 22:32:57 +00:00
|
|
|
void* QSettings_Metacast(QSettings* self, const char* param1) {
|
|
|
|
return self->qt_metacast(param1);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QSettings_Tr(const char* s) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QSettings::tr(s);
|
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 QSettings_TrUtf8(const char* s) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QSettings::trUtf8(s);
|
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
|
|
|
}
|
|
|
|
|
|
|
|
void QSettings_Clear(QSettings* self) {
|
|
|
|
self->clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QSettings_Sync(QSettings* self) {
|
|
|
|
self->sync();
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
int QSettings_Status(const QSettings* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QSettings::Status _ret = self->status();
|
2024-09-18 00:12:02 +00:00
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QSettings_IsAtomicSyncRequired(const QSettings* self) {
|
|
|
|
return self->isAtomicSyncRequired();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QSettings_SetAtomicSyncRequired(QSettings* self, bool enable) {
|
|
|
|
self->setAtomicSyncRequired(enable);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
void QSettings_BeginGroup(QSettings* self, struct miqt_string prefix) {
|
|
|
|
QString prefix_QString = QString::fromUtf8(prefix.data, prefix.len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->beginGroup(prefix_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QSettings_EndGroup(QSettings* self) {
|
|
|
|
self->endGroup();
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QSettings_Group(const QSettings* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
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
|
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
|
|
|
int QSettings_BeginReadArray(QSettings* self, struct miqt_string prefix) {
|
|
|
|
QString prefix_QString = QString::fromUtf8(prefix.data, prefix.len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return self->beginReadArray(prefix_QString);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
void QSettings_BeginWriteArray(QSettings* self, struct miqt_string prefix) {
|
|
|
|
QString prefix_QString = QString::fromUtf8(prefix.data, prefix.len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->beginWriteArray(prefix_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QSettings_EndArray(QSettings* self) {
|
|
|
|
self->endArray();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QSettings_SetArrayIndex(QSettings* self, int i) {
|
|
|
|
self->setArrayIndex(static_cast<int>(i));
|
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of struct miqt_string */ QSettings_AllKeys(const QSettings* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QStringList _ret = self->allKeys();
|
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 struct miqt_string */ QSettings_ChildKeys(const QSettings* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QStringList _ret = self->childKeys();
|
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 struct miqt_string */ QSettings_ChildGroups(const QSettings* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QStringList _ret = self->childGroups();
|
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-09-11 05:41:09 +00:00
|
|
|
bool QSettings_IsWritable(const QSettings* self) {
|
|
|
|
return self->isWritable();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
void QSettings_SetValue(QSettings* self, struct miqt_string key, QVariant* value) {
|
|
|
|
QString key_QString = QString::fromUtf8(key.data, key.len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->setValue(key_QString, *value);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QVariant* QSettings_Value(const QSettings* self, struct miqt_string key) {
|
|
|
|
QString key_QString = QString::fromUtf8(key.data, key.len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVariant(self->value(key_QString));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
void QSettings_Remove(QSettings* self, struct miqt_string key) {
|
|
|
|
QString key_QString = QString::fromUtf8(key.data, key.len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->remove(key_QString);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
bool QSettings_Contains(const QSettings* self, struct miqt_string key) {
|
|
|
|
QString key_QString = QString::fromUtf8(key.data, key.len);
|
2024-09-11 05:41:09 +00:00
|
|
|
return self->contains(key_QString);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QSettings_SetFallbacksEnabled(QSettings* self, bool b) {
|
|
|
|
self->setFallbacksEnabled(b);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QSettings_FallbacksEnabled(const QSettings* self) {
|
|
|
|
return self->fallbacksEnabled();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QSettings_FileName(const QSettings* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
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
|
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-18 00:12:02 +00:00
|
|
|
int QSettings_Format(const QSettings* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QSettings::Format _ret = self->format();
|
2024-09-18 00:12:02 +00:00
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
int QSettings_Scope(const QSettings* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QSettings::Scope _ret = self->scope();
|
2024-09-18 00:12:02 +00:00
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QSettings_OrganizationName(const QSettings* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->organizationName();
|
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 QSettings_ApplicationName(const QSettings* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->applicationName();
|
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
|
|
|
}
|
|
|
|
|
|
|
|
void QSettings_SetIniCodec(QSettings* self, QTextCodec* codec) {
|
|
|
|
self->setIniCodec(codec);
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QSettings_SetIniCodecWithCodecName(QSettings* self, const char* codecName) {
|
2024-08-25 04:08:24 +00:00
|
|
|
self->setIniCodec(codecName);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QTextCodec* QSettings_IniCodec(const QSettings* self) {
|
|
|
|
return self->iniCodec();
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
void QSettings_SetDefaultFormat(int format) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QSettings::setDefaultFormat(static_cast<QSettings::Format>(format));
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
int QSettings_DefaultFormat() {
|
2024-09-14 22:29:05 +00:00
|
|
|
QSettings::Format _ret = QSettings::defaultFormat();
|
2024-09-18 00:12:02 +00:00
|
|
|
return static_cast<int>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
void QSettings_SetSystemIniPath(struct miqt_string dir) {
|
|
|
|
QString dir_QString = QString::fromUtf8(dir.data, dir.len);
|
2024-08-25 04:08:24 +00:00
|
|
|
QSettings::setSystemIniPath(dir_QString);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
void QSettings_SetUserIniPath(struct miqt_string dir) {
|
|
|
|
QString dir_QString = QString::fromUtf8(dir.data, dir.len);
|
2024-08-25 04:08:24 +00:00
|
|
|
QSettings::setUserIniPath(dir_QString);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
void QSettings_SetPath(int format, int scope, struct miqt_string path) {
|
|
|
|
QString path_QString = QString::fromUtf8(path.data, path.len);
|
2024-08-29 07:01:51 +00:00
|
|
|
QSettings::setPath(static_cast<QSettings::Format>(format), static_cast<QSettings::Scope>(scope), path_QString);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QSettings_Tr2(const char* s, const char* c) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QSettings::tr(s, c);
|
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 QSettings_Tr3(const char* s, const char* c, int n) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QSettings::tr(s, c, static_cast<int>(n));
|
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 QSettings_TrUtf82(const char* s, const char* c) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QSettings::trUtf8(s, c);
|
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 QSettings_TrUtf83(const char* s, const char* c, int n) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QSettings::trUtf8(s, c, static_cast<int>(n));
|
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 QSettings_BeginWriteArray2(QSettings* self, struct miqt_string prefix, int size) {
|
|
|
|
QString prefix_QString = QString::fromUtf8(prefix.data, prefix.len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->beginWriteArray(prefix_QString, static_cast<int>(size));
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QVariant* QSettings_Value2(const QSettings* self, struct miqt_string key, QVariant* defaultValue) {
|
|
|
|
QString key_QString = QString::fromUtf8(key.data, key.len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QVariant(self->value(key_QString, *defaultValue));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QSettings_Delete(QSettings* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|