2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qtemporarydir.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 QTemporaryDir struct {
|
|
|
|
h *C.QTemporaryDir
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTemporaryDir) cPointer() *C.QTemporaryDir {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQTemporaryDir(h *C.QTemporaryDir) *QTemporaryDir {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QTemporaryDir{h: h}
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQTemporaryDir_U(h unsafe.Pointer) *QTemporaryDir {
|
|
|
|
return newQTemporaryDir((*C.QTemporaryDir)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQTemporaryDir constructs a new QTemporaryDir object.
|
|
|
|
func NewQTemporaryDir() *QTemporaryDir {
|
|
|
|
ret := C.QTemporaryDir_new()
|
|
|
|
return newQTemporaryDir(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQTemporaryDir2 constructs a new QTemporaryDir object.
|
|
|
|
func NewQTemporaryDir2(templateName string) *QTemporaryDir {
|
2024-09-14 22:29:05 +00:00
|
|
|
templateName_ms := miqt_strdupg(templateName)
|
|
|
|
defer C.free(templateName_ms)
|
|
|
|
ret := C.QTemporaryDir_new2((*C.struct_miqt_string)(templateName_ms))
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQTemporaryDir(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTemporaryDir) IsValid() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QTemporaryDir_IsValid(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTemporaryDir) ErrorString() string {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QTemporaryDir_ErrorString(this.h)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTemporaryDir) AutoRemove() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QTemporaryDir_AutoRemove(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTemporaryDir) SetAutoRemove(b bool) {
|
|
|
|
C.QTemporaryDir_SetAutoRemove(this.h, (C.bool)(b))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTemporaryDir) Remove() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QTemporaryDir_Remove(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTemporaryDir) Path() string {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QTemporaryDir_Path(this.h)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTemporaryDir) FilePath(fileName string) string {
|
2024-09-14 22:29:05 +00:00
|
|
|
fileName_ms := miqt_strdupg(fileName)
|
|
|
|
defer C.free(fileName_ms)
|
|
|
|
var _ms *C.struct_miqt_string = C.QTemporaryDir_FilePath(this.h, (*C.struct_miqt_string)(fileName_ms))
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
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 *QTemporaryDir) Delete() {
|
|
|
|
C.QTemporaryDir_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 *QTemporaryDir) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QTemporaryDir) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|