2024-08-25 04:08:24 +00:00
|
|
|
#include <QLoggingCategory>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
|
|
|
#include "qloggingcategory.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qloggingcategory.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
extern void miqt_exec_callback(void* cb, int argc, void* argv);
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
QLoggingCategory* QLoggingCategory_new(const char* category) {
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QLoggingCategory(category);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QLoggingCategory_IsDebugEnabled(QLoggingCategory* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QLoggingCategory*>(self)->isDebugEnabled();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QLoggingCategory_IsInfoEnabled(QLoggingCategory* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QLoggingCategory*>(self)->isInfoEnabled();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QLoggingCategory_IsWarningEnabled(QLoggingCategory* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QLoggingCategory*>(self)->isWarningEnabled();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QLoggingCategory_IsCriticalEnabled(QLoggingCategory* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QLoggingCategory*>(self)->isCriticalEnabled();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
const char* QLoggingCategory_CategoryName(QLoggingCategory* self) {
|
|
|
|
return (const char*) const_cast<const QLoggingCategory*>(self)->categoryName();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QLoggingCategory* QLoggingCategory_OperatorCall(QLoggingCategory* self) {
|
|
|
|
QLoggingCategory& ret = self->operator()();
|
|
|
|
// Cast returned reference into pointer
|
|
|
|
return &ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
QLoggingCategory* QLoggingCategory_OperatorCall2(QLoggingCategory* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
const QLoggingCategory& ret = const_cast<const QLoggingCategory*>(self)->operator()();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Cast returned reference into pointer
|
|
|
|
return const_cast<QLoggingCategory*>(&ret);
|
|
|
|
}
|
|
|
|
|
|
|
|
QLoggingCategory* QLoggingCategory_DefaultCategory() {
|
|
|
|
return QLoggingCategory::defaultCategory();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QLoggingCategory_SetFilterRules(const char* rules, size_t rules_Strlen) {
|
|
|
|
QString rules_QString = QString::fromUtf8(rules, rules_Strlen);
|
|
|
|
QLoggingCategory::setFilterRules(rules_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QLoggingCategory_Delete(QLoggingCategory* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|