#include #include #include #include #include #include #include #include #define WORKAROUND_INNER_CLASS_DEFINITION_QTimeZone__OffsetData #include "qtimezone.h" #include "gen_qtimezone.h" extern "C" { extern void miqt_exec_callback(void* cb, int argc, void* argv); } QTimeZone* QTimeZone_new() { return new QTimeZone(); } QTimeZone* QTimeZone_new2(QByteArray* ianaId) { return new QTimeZone(*ianaId); } QTimeZone* QTimeZone_new3(int offsetSeconds) { return new QTimeZone(static_cast(offsetSeconds)); } QTimeZone* QTimeZone_new4(QByteArray* zoneId, int offsetSeconds, const char* name, size_t name_Strlen, const char* abbreviation, size_t abbreviation_Strlen) { QString name_QString = QString::fromUtf8(name, name_Strlen); QString abbreviation_QString = QString::fromUtf8(abbreviation, abbreviation_Strlen); return new QTimeZone(*zoneId, static_cast(offsetSeconds), name_QString, abbreviation_QString); } QTimeZone* QTimeZone_new5(QTimeZone* other) { return new QTimeZone(*other); } QTimeZone* QTimeZone_new6(QByteArray* zoneId, int offsetSeconds, const char* name, size_t name_Strlen, const char* abbreviation, size_t abbreviation_Strlen, uintptr_t country) { QString name_QString = QString::fromUtf8(name, name_Strlen); QString abbreviation_QString = QString::fromUtf8(abbreviation, abbreviation_Strlen); return new QTimeZone(*zoneId, static_cast(offsetSeconds), name_QString, abbreviation_QString, static_cast(country)); } QTimeZone* QTimeZone_new7(QByteArray* zoneId, int offsetSeconds, const char* name, size_t name_Strlen, const char* abbreviation, size_t abbreviation_Strlen, uintptr_t country, const char* comment, size_t comment_Strlen) { QString name_QString = QString::fromUtf8(name, name_Strlen); QString abbreviation_QString = QString::fromUtf8(abbreviation, abbreviation_Strlen); QString comment_QString = QString::fromUtf8(comment, comment_Strlen); return new QTimeZone(*zoneId, static_cast(offsetSeconds), name_QString, abbreviation_QString, static_cast(country), comment_QString); } void QTimeZone_OperatorAssign(QTimeZone* self, QTimeZone* other) { self->operator=(*other); } void QTimeZone_Swap(QTimeZone* self, QTimeZone* other) { self->swap(*other); } bool QTimeZone_OperatorEqual(QTimeZone* self, QTimeZone* other) { return const_cast(self)->operator==(*other); } bool QTimeZone_OperatorNotEqual(QTimeZone* self, QTimeZone* other) { return const_cast(self)->operator!=(*other); } bool QTimeZone_IsValid(QTimeZone* self) { return const_cast(self)->isValid(); } QByteArray* QTimeZone_Id(QTimeZone* self) { QByteArray ret = const_cast(self)->id(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QByteArray(ret)); } uintptr_t QTimeZone_Country(QTimeZone* self) { QLocale::Country ret = const_cast(self)->country(); return static_cast(ret); } void QTimeZone_Comment(QTimeZone* self, char** _out, int* _out_Strlen) { QString ret = const_cast(self)->comment(); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray b = ret.toUtf8(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QTimeZone_DisplayName(QTimeZone* self, QDateTime* atDateTime, char** _out, int* _out_Strlen) { QString ret = const_cast(self)->displayName(*atDateTime); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray b = ret.toUtf8(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QTimeZone_DisplayNameWithTimeType(QTimeZone* self, uintptr_t timeType, char** _out, int* _out_Strlen) { QString ret = const_cast(self)->displayName(static_cast(timeType)); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray b = ret.toUtf8(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QTimeZone_Abbreviation(QTimeZone* self, QDateTime* atDateTime, char** _out, int* _out_Strlen) { QString ret = const_cast(self)->abbreviation(*atDateTime); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray b = ret.toUtf8(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } int QTimeZone_OffsetFromUtc(QTimeZone* self, QDateTime* atDateTime) { return const_cast(self)->offsetFromUtc(*atDateTime); } int QTimeZone_StandardTimeOffset(QTimeZone* self, QDateTime* atDateTime) { return const_cast(self)->standardTimeOffset(*atDateTime); } int QTimeZone_DaylightTimeOffset(QTimeZone* self, QDateTime* atDateTime) { return const_cast(self)->daylightTimeOffset(*atDateTime); } bool QTimeZone_HasDaylightTime(QTimeZone* self) { return const_cast(self)->hasDaylightTime(); } bool QTimeZone_IsDaylightTime(QTimeZone* self, QDateTime* atDateTime) { return const_cast(self)->isDaylightTime(*atDateTime); } QTimeZone__OffsetData* QTimeZone_OffsetData(QTimeZone* self, QDateTime* forDateTime) { QTimeZone::OffsetData ret = const_cast(self)->offsetData(*forDateTime); // Copy-construct value returned type into heap-allocated copy return static_cast(new QTimeZone::OffsetData(ret)); } bool QTimeZone_HasTransitions(QTimeZone* self) { return const_cast(self)->hasTransitions(); } QTimeZone__OffsetData* QTimeZone_NextTransition(QTimeZone* self, QDateTime* afterDateTime) { QTimeZone::OffsetData ret = const_cast(self)->nextTransition(*afterDateTime); // Copy-construct value returned type into heap-allocated copy return static_cast(new QTimeZone::OffsetData(ret)); } QTimeZone__OffsetData* QTimeZone_PreviousTransition(QTimeZone* self, QDateTime* beforeDateTime) { QTimeZone::OffsetData ret = const_cast(self)->previousTransition(*beforeDateTime); // Copy-construct value returned type into heap-allocated copy return static_cast(new QTimeZone::OffsetData(ret)); } void QTimeZone_Transitions(QTimeZone* self, QDateTime* fromDateTime, QDateTime* toDateTime, QTimeZone__OffsetData*** _out, size_t* _out_len) { QTimeZone::OffsetDataList ret = const_cast(self)->transitions(*fromDateTime, *toDateTime); // Convert QList<> from C++ memory to manually-managed C memory of copy-constructed pointers QTimeZone__OffsetData** __out = static_cast(malloc(sizeof(QTimeZone__OffsetData**) * ret.length())); for (size_t i = 0, e = ret.length(); i < e; ++i) { __out[i] = new QTimeZone::OffsetData(ret[i]); } *_out = __out; *_out_len = ret.length(); } QByteArray* QTimeZone_SystemTimeZoneId() { QByteArray ret = QTimeZone::systemTimeZoneId(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QByteArray(ret)); } QTimeZone* QTimeZone_SystemTimeZone() { QTimeZone ret = QTimeZone::systemTimeZone(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QTimeZone(ret)); } QTimeZone* QTimeZone_Utc() { QTimeZone ret = QTimeZone::utc(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QTimeZone(ret)); } bool QTimeZone_IsTimeZoneIdAvailable(QByteArray* ianaId) { return QTimeZone::isTimeZoneIdAvailable(*ianaId); } void QTimeZone_AvailableTimeZoneIds(QByteArray*** _out, size_t* _out_len) { QList ret = QTimeZone::availableTimeZoneIds(); // Convert QList<> from C++ memory to manually-managed C memory of copy-constructed pointers QByteArray** __out = static_cast(malloc(sizeof(QByteArray**) * ret.length())); for (size_t i = 0, e = ret.length(); i < e; ++i) { __out[i] = new QByteArray(ret[i]); } *_out = __out; *_out_len = ret.length(); } void QTimeZone_AvailableTimeZoneIdsWithCountry(uintptr_t country, QByteArray*** _out, size_t* _out_len) { QList ret = QTimeZone::availableTimeZoneIds(static_cast(country)); // Convert QList<> from C++ memory to manually-managed C memory of copy-constructed pointers QByteArray** __out = static_cast(malloc(sizeof(QByteArray**) * ret.length())); for (size_t i = 0, e = ret.length(); i < e; ++i) { __out[i] = new QByteArray(ret[i]); } *_out = __out; *_out_len = ret.length(); } void QTimeZone_AvailableTimeZoneIdsWithOffsetSeconds(int offsetSeconds, QByteArray*** _out, size_t* _out_len) { QList ret = QTimeZone::availableTimeZoneIds(static_cast(offsetSeconds)); // Convert QList<> from C++ memory to manually-managed C memory of copy-constructed pointers QByteArray** __out = static_cast(malloc(sizeof(QByteArray**) * ret.length())); for (size_t i = 0, e = ret.length(); i < e; ++i) { __out[i] = new QByteArray(ret[i]); } *_out = __out; *_out_len = ret.length(); } QByteArray* QTimeZone_IanaIdToWindowsId(QByteArray* ianaId) { QByteArray ret = QTimeZone::ianaIdToWindowsId(*ianaId); // Copy-construct value returned type into heap-allocated copy return static_cast(new QByteArray(ret)); } QByteArray* QTimeZone_WindowsIdToDefaultIanaId(QByteArray* windowsId) { QByteArray ret = QTimeZone::windowsIdToDefaultIanaId(*windowsId); // Copy-construct value returned type into heap-allocated copy return static_cast(new QByteArray(ret)); } QByteArray* QTimeZone_WindowsIdToDefaultIanaId2(QByteArray* windowsId, uintptr_t country) { QByteArray ret = QTimeZone::windowsIdToDefaultIanaId(*windowsId, static_cast(country)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QByteArray(ret)); } void QTimeZone_WindowsIdToIanaIds(QByteArray* windowsId, QByteArray*** _out, size_t* _out_len) { QList ret = QTimeZone::windowsIdToIanaIds(*windowsId); // Convert QList<> from C++ memory to manually-managed C memory of copy-constructed pointers QByteArray** __out = static_cast(malloc(sizeof(QByteArray**) * ret.length())); for (size_t i = 0, e = ret.length(); i < e; ++i) { __out[i] = new QByteArray(ret[i]); } *_out = __out; *_out_len = ret.length(); } void QTimeZone_WindowsIdToIanaIds2(QByteArray* windowsId, uintptr_t country, QByteArray*** _out, size_t* _out_len) { QList ret = QTimeZone::windowsIdToIanaIds(*windowsId, static_cast(country)); // Convert QList<> from C++ memory to manually-managed C memory of copy-constructed pointers QByteArray** __out = static_cast(malloc(sizeof(QByteArray**) * ret.length())); for (size_t i = 0, e = ret.length(); i < e; ++i) { __out[i] = new QByteArray(ret[i]); } *_out = __out; *_out_len = ret.length(); } void QTimeZone_DisplayName2(QTimeZone* self, QDateTime* atDateTime, uintptr_t nameType, char** _out, int* _out_Strlen) { QString ret = self->displayName(*atDateTime, static_cast(nameType)); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray b = ret.toUtf8(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QTimeZone_DisplayName3(QTimeZone* self, QDateTime* atDateTime, uintptr_t nameType, QLocale* locale, char** _out, int* _out_Strlen) { QString ret = self->displayName(*atDateTime, static_cast(nameType), *locale); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray b = ret.toUtf8(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QTimeZone_DisplayName22(QTimeZone* self, uintptr_t timeType, uintptr_t nameType, char** _out, int* _out_Strlen) { QString ret = self->displayName(static_cast(timeType), static_cast(nameType)); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray b = ret.toUtf8(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QTimeZone_DisplayName32(QTimeZone* self, uintptr_t timeType, uintptr_t nameType, QLocale* locale, char** _out, int* _out_Strlen) { QString ret = self->displayName(static_cast(timeType), static_cast(nameType), *locale); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray b = ret.toUtf8(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QTimeZone_Delete(QTimeZone* self) { delete self; } QTimeZone__OffsetData* QTimeZone__OffsetData_new(QTimeZone__OffsetData* param1) { return new QTimeZone::OffsetData(*param1); } void QTimeZone__OffsetData_Delete(QTimeZone__OffsetData* self) { delete self; }