2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qloggingcategory.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
2024-09-14 22:29:05 +00:00
|
|
|
"runtime"
|
2024-08-25 04:08:24 +00:00
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QLoggingCategory struct {
|
|
|
|
h *C.QLoggingCategory
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QLoggingCategory) cPointer() *C.QLoggingCategory {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQLoggingCategory(h *C.QLoggingCategory) *QLoggingCategory {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QLoggingCategory{h: h}
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQLoggingCategory_U(h unsafe.Pointer) *QLoggingCategory {
|
|
|
|
return newQLoggingCategory((*C.QLoggingCategory)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQLoggingCategory constructs a new QLoggingCategory object.
|
|
|
|
func NewQLoggingCategory(category string) *QLoggingCategory {
|
|
|
|
category_Cstring := C.CString(category)
|
|
|
|
defer C.free(unsafe.Pointer(category_Cstring))
|
|
|
|
ret := C.QLoggingCategory_new(category_Cstring)
|
|
|
|
return newQLoggingCategory(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QLoggingCategory) IsDebugEnabled() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QLoggingCategory_IsDebugEnabled(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QLoggingCategory) IsInfoEnabled() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QLoggingCategory_IsInfoEnabled(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QLoggingCategory) IsWarningEnabled() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QLoggingCategory_IsWarningEnabled(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QLoggingCategory) IsCriticalEnabled() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QLoggingCategory_IsCriticalEnabled(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QLoggingCategory) CategoryName() unsafe.Pointer {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QLoggingCategory_CategoryName(this.h)
|
|
|
|
return (unsafe.Pointer)(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QLoggingCategory) OperatorCall() *QLoggingCategory {
|
2024-09-17 07:30:27 +00:00
|
|
|
return newQLoggingCategory_U(unsafe.Pointer(C.QLoggingCategory_OperatorCall(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QLoggingCategory) OperatorCall2() *QLoggingCategory {
|
2024-09-17 07:30:27 +00:00
|
|
|
return newQLoggingCategory_U(unsafe.Pointer(C.QLoggingCategory_OperatorCall2(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QLoggingCategory_DefaultCategory() *QLoggingCategory {
|
2024-09-17 07:30:27 +00:00
|
|
|
return newQLoggingCategory_U(unsafe.Pointer(C.QLoggingCategory_DefaultCategory()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QLoggingCategory_SetFilterRules(rules string) {
|
2024-09-14 22:29:05 +00:00
|
|
|
rules_ms := miqt_strdupg(rules)
|
|
|
|
defer C.free(rules_ms)
|
|
|
|
C.QLoggingCategory_SetFilterRules((*C.struct_miqt_string)(rules_ms))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QLoggingCategory) Delete() {
|
|
|
|
C.QLoggingCategory_Delete(this.h)
|
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
|
|
|
|
// GoGC adds a Go Finalizer to this pointer, so that it will be deleted
|
|
|
|
// from C++ memory once it is unreachable from Go memory.
|
|
|
|
func (this *QLoggingCategory) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QLoggingCategory) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|