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 {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QLoggingCategory
|
|
|
|
isSubclass bool
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QLoggingCategory) cPointer() *C.QLoggingCategory {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QLoggingCategory) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQLoggingCategory constructs the type using only CGO pointers.
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQLoggingCategory(h *C.QLoggingCategory) *QLoggingCategory {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-12-07 04:15:57 +00:00
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QLoggingCategory{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQLoggingCategory constructs the type using only unsafe pointers.
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQLoggingCategory(h unsafe.Pointer) *QLoggingCategory {
|
2024-12-07 04:15:57 +00:00
|
|
|
return newQLoggingCategory((*C.QLoggingCategory)(h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQLoggingCategory constructs a new QLoggingCategory object.
|
|
|
|
func NewQLoggingCategory(category string) *QLoggingCategory {
|
|
|
|
category_Cstring := C.CString(category)
|
|
|
|
defer C.free(unsafe.Pointer(category_Cstring))
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQLoggingCategory(C.QLoggingCategory_new(category_Cstring))
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
func (this *QLoggingCategory) CategoryName() string {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QLoggingCategory_CategoryName(this.h)
|
2024-10-18 23:53:33 +00:00
|
|
|
return C.GoString(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QLoggingCategory) OperatorCall() *QLoggingCategory {
|
2024-12-07 02:02:06 +00:00
|
|
|
return newQLoggingCategory(C.QLoggingCategory_OperatorCall(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QLoggingCategory) OperatorCall2() *QLoggingCategory {
|
2024-12-07 02:02:06 +00:00
|
|
|
return newQLoggingCategory(C.QLoggingCategory_OperatorCall2(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QLoggingCategory_DefaultCategory() *QLoggingCategory {
|
2024-12-07 02:02:06 +00:00
|
|
|
return newQLoggingCategory(C.QLoggingCategory_DefaultCategory())
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QLoggingCategory_SetFilterRules(rules string) {
|
2024-10-18 23:53:33 +00:00
|
|
|
rules_ms := C.struct_miqt_string{}
|
|
|
|
rules_ms.data = C.CString(rules)
|
|
|
|
rules_ms.len = C.size_t(len(rules))
|
|
|
|
defer C.free(unsafe.Pointer(rules_ms.data))
|
|
|
|
C.QLoggingCategory_SetFilterRules(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() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QLoggingCategory_Delete(this.h, C.bool(this.isSubclass))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
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)
|
|
|
|
})
|
|
|
|
}
|