2024-08-25 04:08:24 +00:00
|
|
|
#include <QChar>
|
|
|
|
#include <QCollator>
|
|
|
|
#include <QCollatorSortKey>
|
|
|
|
#include <QLocale>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qcollator.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qcollator.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 QCollatorSortKey_new(QCollatorSortKey* other, QCollatorSortKey** outptr_QCollatorSortKey) {
|
|
|
|
QCollatorSortKey* ret = new QCollatorSortKey(*other);
|
|
|
|
*outptr_QCollatorSortKey = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QCollatorSortKey_OperatorAssign(QCollatorSortKey* self, QCollatorSortKey* other) {
|
|
|
|
self->operator=(*other);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QCollatorSortKey_Swap(QCollatorSortKey* self, QCollatorSortKey* other) {
|
|
|
|
self->swap(*other);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QCollatorSortKey_Compare(const QCollatorSortKey* self, QCollatorSortKey* key) {
|
|
|
|
return self->compare(*key);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCollatorSortKey_Delete(QCollatorSortKey* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QCollatorSortKey*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCollator_new(QCollator** outptr_QCollator) {
|
|
|
|
QCollator* ret = new QCollator();
|
|
|
|
*outptr_QCollator = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCollator_new2(QLocale* locale, QCollator** outptr_QCollator) {
|
|
|
|
QCollator* ret = new QCollator(*locale);
|
|
|
|
*outptr_QCollator = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCollator_new3(QCollator* param1, QCollator** outptr_QCollator) {
|
|
|
|
QCollator* ret = new QCollator(*param1);
|
|
|
|
*outptr_QCollator = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QCollator_OperatorAssign(QCollator* self, QCollator* param1) {
|
|
|
|
self->operator=(*param1);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QCollator_Swap(QCollator* self, QCollator* other) {
|
|
|
|
self->swap(*other);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QCollator_SetLocale(QCollator* self, QLocale* locale) {
|
|
|
|
self->setLocale(*locale);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QLocale* QCollator_Locale(const QCollator* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QLocale(self->locale());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
int QCollator_CaseSensitivity(const QCollator* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
Qt::CaseSensitivity _ret = self->caseSensitivity();
|
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
|
|
|
void QCollator_SetCaseSensitivity(QCollator* self, int cs) {
|
2024-08-29 07:01:51 +00:00
|
|
|
self->setCaseSensitivity(static_cast<Qt::CaseSensitivity>(cs));
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QCollator_SetNumericMode(QCollator* self, bool on) {
|
|
|
|
self->setNumericMode(on);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCollator_NumericMode(const QCollator* self) {
|
|
|
|
return self->numericMode();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QCollator_SetIgnorePunctuation(QCollator* self, bool on) {
|
|
|
|
self->setIgnorePunctuation(on);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QCollator_IgnorePunctuation(const QCollator* self) {
|
|
|
|
return self->ignorePunctuation();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
int QCollator_Compare(const QCollator* self, struct miqt_string s1, struct miqt_string s2) {
|
|
|
|
QString s1_QString = QString::fromUtf8(s1.data, s1.len);
|
|
|
|
QString s2_QString = QString::fromUtf8(s2.data, s2.len);
|
2024-09-11 05:41:09 +00:00
|
|
|
return self->compare(s1_QString, s2_QString);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QCollator_Compare3(const QCollator* self, QChar* s1, int len1, QChar* s2, int len2) {
|
|
|
|
return self->compare(s1, static_cast<int>(len1), s2, static_cast<int>(len2));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
bool QCollator_OperatorCall(const QCollator* self, struct miqt_string s1, struct miqt_string s2) {
|
|
|
|
QString s1_QString = QString::fromUtf8(s1.data, s1.len);
|
|
|
|
QString s2_QString = QString::fromUtf8(s2.data, s2.len);
|
2024-09-11 05:41:09 +00:00
|
|
|
return self->operator()(s1_QString, s2_QString);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QCollatorSortKey* QCollator_SortKey(const QCollator* self, struct miqt_string stringVal) {
|
|
|
|
QString stringVal_QString = QString::fromUtf8(stringVal.data, stringVal.len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QCollatorSortKey(self->sortKey(stringVal_QString));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QCollator_Delete(QCollator* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QCollator*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|