2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qcommandlineoption.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QCommandLineOption struct {
|
|
|
|
h *C.QCommandLineOption
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineOption) cPointer() *C.QCommandLineOption {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQCommandLineOption(h *C.QCommandLineOption) *QCommandLineOption {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QCommandLineOption{h: h}
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQCommandLineOption_U(h unsafe.Pointer) *QCommandLineOption {
|
|
|
|
return newQCommandLineOption((*C.QCommandLineOption)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQCommandLineOption constructs a new QCommandLineOption object.
|
|
|
|
func NewQCommandLineOption(name string) *QCommandLineOption {
|
|
|
|
name_Cstring := C.CString(name)
|
|
|
|
defer C.free(unsafe.Pointer(name_Cstring))
|
2024-09-01 06:50:42 +00:00
|
|
|
ret := C.QCommandLineOption_new(name_Cstring, C.size_t(len(name)))
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQCommandLineOption(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQCommandLineOption2 constructs a new QCommandLineOption object.
|
|
|
|
func NewQCommandLineOption2(names []string) *QCommandLineOption {
|
|
|
|
// For the C ABI, malloc two C arrays; raw char* pointers and their lengths
|
2024-09-01 05:51:28 +00:00
|
|
|
names_CArray := (*[0xffff]*C.char)(C.malloc(C.size_t(8 * len(names))))
|
2024-09-01 06:50:42 +00:00
|
|
|
names_Lengths := (*[0xffff]C.uint64_t)(C.malloc(C.size_t(8 * len(names))))
|
2024-08-25 04:08:24 +00:00
|
|
|
defer C.free(unsafe.Pointer(names_CArray))
|
|
|
|
defer C.free(unsafe.Pointer(names_Lengths))
|
|
|
|
for i := range names {
|
|
|
|
single_cstring := C.CString(names[i])
|
|
|
|
defer C.free(unsafe.Pointer(single_cstring))
|
|
|
|
names_CArray[i] = single_cstring
|
2024-09-01 06:50:42 +00:00
|
|
|
names_Lengths[i] = (C.uint64_t)(len(names[i]))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-01 06:50:42 +00:00
|
|
|
ret := C.QCommandLineOption_new2(&names_CArray[0], &names_Lengths[0], C.size_t(len(names)))
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQCommandLineOption(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQCommandLineOption3 constructs a new QCommandLineOption object.
|
|
|
|
func NewQCommandLineOption3(name string, description string) *QCommandLineOption {
|
|
|
|
name_Cstring := C.CString(name)
|
|
|
|
defer C.free(unsafe.Pointer(name_Cstring))
|
|
|
|
description_Cstring := C.CString(description)
|
|
|
|
defer C.free(unsafe.Pointer(description_Cstring))
|
2024-09-01 06:50:42 +00:00
|
|
|
ret := C.QCommandLineOption_new3(name_Cstring, C.size_t(len(name)), description_Cstring, C.size_t(len(description)))
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQCommandLineOption(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQCommandLineOption4 constructs a new QCommandLineOption object.
|
|
|
|
func NewQCommandLineOption4(names []string, description string) *QCommandLineOption {
|
|
|
|
// For the C ABI, malloc two C arrays; raw char* pointers and their lengths
|
2024-09-01 05:51:28 +00:00
|
|
|
names_CArray := (*[0xffff]*C.char)(C.malloc(C.size_t(8 * len(names))))
|
2024-09-01 06:50:42 +00:00
|
|
|
names_Lengths := (*[0xffff]C.uint64_t)(C.malloc(C.size_t(8 * len(names))))
|
2024-08-25 04:08:24 +00:00
|
|
|
defer C.free(unsafe.Pointer(names_CArray))
|
|
|
|
defer C.free(unsafe.Pointer(names_Lengths))
|
|
|
|
for i := range names {
|
|
|
|
single_cstring := C.CString(names[i])
|
|
|
|
defer C.free(unsafe.Pointer(single_cstring))
|
|
|
|
names_CArray[i] = single_cstring
|
2024-09-01 06:50:42 +00:00
|
|
|
names_Lengths[i] = (C.uint64_t)(len(names[i]))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
description_Cstring := C.CString(description)
|
|
|
|
defer C.free(unsafe.Pointer(description_Cstring))
|
2024-09-01 06:50:42 +00:00
|
|
|
ret := C.QCommandLineOption_new4(&names_CArray[0], &names_Lengths[0], C.size_t(len(names)), description_Cstring, C.size_t(len(description)))
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQCommandLineOption(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQCommandLineOption5 constructs a new QCommandLineOption object.
|
|
|
|
func NewQCommandLineOption5(other *QCommandLineOption) *QCommandLineOption {
|
|
|
|
ret := C.QCommandLineOption_new5(other.cPointer())
|
|
|
|
return newQCommandLineOption(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQCommandLineOption6 constructs a new QCommandLineOption object.
|
|
|
|
func NewQCommandLineOption6(name string, description string, valueName string) *QCommandLineOption {
|
|
|
|
name_Cstring := C.CString(name)
|
|
|
|
defer C.free(unsafe.Pointer(name_Cstring))
|
|
|
|
description_Cstring := C.CString(description)
|
|
|
|
defer C.free(unsafe.Pointer(description_Cstring))
|
|
|
|
valueName_Cstring := C.CString(valueName)
|
|
|
|
defer C.free(unsafe.Pointer(valueName_Cstring))
|
2024-09-01 06:50:42 +00:00
|
|
|
ret := C.QCommandLineOption_new6(name_Cstring, C.size_t(len(name)), description_Cstring, C.size_t(len(description)), valueName_Cstring, C.size_t(len(valueName)))
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQCommandLineOption(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQCommandLineOption7 constructs a new QCommandLineOption object.
|
|
|
|
func NewQCommandLineOption7(name string, description string, valueName string, defaultValue string) *QCommandLineOption {
|
|
|
|
name_Cstring := C.CString(name)
|
|
|
|
defer C.free(unsafe.Pointer(name_Cstring))
|
|
|
|
description_Cstring := C.CString(description)
|
|
|
|
defer C.free(unsafe.Pointer(description_Cstring))
|
|
|
|
valueName_Cstring := C.CString(valueName)
|
|
|
|
defer C.free(unsafe.Pointer(valueName_Cstring))
|
|
|
|
defaultValue_Cstring := C.CString(defaultValue)
|
|
|
|
defer C.free(unsafe.Pointer(defaultValue_Cstring))
|
2024-09-01 06:50:42 +00:00
|
|
|
ret := C.QCommandLineOption_new7(name_Cstring, C.size_t(len(name)), description_Cstring, C.size_t(len(description)), valueName_Cstring, C.size_t(len(valueName)), defaultValue_Cstring, C.size_t(len(defaultValue)))
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQCommandLineOption(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQCommandLineOption8 constructs a new QCommandLineOption object.
|
|
|
|
func NewQCommandLineOption8(names []string, description string, valueName string) *QCommandLineOption {
|
|
|
|
// For the C ABI, malloc two C arrays; raw char* pointers and their lengths
|
2024-09-01 05:51:28 +00:00
|
|
|
names_CArray := (*[0xffff]*C.char)(C.malloc(C.size_t(8 * len(names))))
|
2024-09-01 06:50:42 +00:00
|
|
|
names_Lengths := (*[0xffff]C.uint64_t)(C.malloc(C.size_t(8 * len(names))))
|
2024-08-25 04:08:24 +00:00
|
|
|
defer C.free(unsafe.Pointer(names_CArray))
|
|
|
|
defer C.free(unsafe.Pointer(names_Lengths))
|
|
|
|
for i := range names {
|
|
|
|
single_cstring := C.CString(names[i])
|
|
|
|
defer C.free(unsafe.Pointer(single_cstring))
|
|
|
|
names_CArray[i] = single_cstring
|
2024-09-01 06:50:42 +00:00
|
|
|
names_Lengths[i] = (C.uint64_t)(len(names[i]))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
description_Cstring := C.CString(description)
|
|
|
|
defer C.free(unsafe.Pointer(description_Cstring))
|
|
|
|
valueName_Cstring := C.CString(valueName)
|
|
|
|
defer C.free(unsafe.Pointer(valueName_Cstring))
|
2024-09-01 06:50:42 +00:00
|
|
|
ret := C.QCommandLineOption_new8(&names_CArray[0], &names_Lengths[0], C.size_t(len(names)), description_Cstring, C.size_t(len(description)), valueName_Cstring, C.size_t(len(valueName)))
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQCommandLineOption(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQCommandLineOption9 constructs a new QCommandLineOption object.
|
|
|
|
func NewQCommandLineOption9(names []string, description string, valueName string, defaultValue string) *QCommandLineOption {
|
|
|
|
// For the C ABI, malloc two C arrays; raw char* pointers and their lengths
|
2024-09-01 05:51:28 +00:00
|
|
|
names_CArray := (*[0xffff]*C.char)(C.malloc(C.size_t(8 * len(names))))
|
2024-09-01 06:50:42 +00:00
|
|
|
names_Lengths := (*[0xffff]C.uint64_t)(C.malloc(C.size_t(8 * len(names))))
|
2024-08-25 04:08:24 +00:00
|
|
|
defer C.free(unsafe.Pointer(names_CArray))
|
|
|
|
defer C.free(unsafe.Pointer(names_Lengths))
|
|
|
|
for i := range names {
|
|
|
|
single_cstring := C.CString(names[i])
|
|
|
|
defer C.free(unsafe.Pointer(single_cstring))
|
|
|
|
names_CArray[i] = single_cstring
|
2024-09-01 06:50:42 +00:00
|
|
|
names_Lengths[i] = (C.uint64_t)(len(names[i]))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
description_Cstring := C.CString(description)
|
|
|
|
defer C.free(unsafe.Pointer(description_Cstring))
|
|
|
|
valueName_Cstring := C.CString(valueName)
|
|
|
|
defer C.free(unsafe.Pointer(valueName_Cstring))
|
|
|
|
defaultValue_Cstring := C.CString(defaultValue)
|
|
|
|
defer C.free(unsafe.Pointer(defaultValue_Cstring))
|
2024-09-01 06:50:42 +00:00
|
|
|
ret := C.QCommandLineOption_new9(&names_CArray[0], &names_Lengths[0], C.size_t(len(names)), description_Cstring, C.size_t(len(description)), valueName_Cstring, C.size_t(len(valueName)), defaultValue_Cstring, C.size_t(len(defaultValue)))
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQCommandLineOption(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineOption) OperatorAssign(other *QCommandLineOption) {
|
|
|
|
C.QCommandLineOption_OperatorAssign(this.h, other.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineOption) Swap(other *QCommandLineOption) {
|
|
|
|
C.QCommandLineOption_Swap(this.h, other.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineOption) Names() []string {
|
|
|
|
var _out **C.char = nil
|
|
|
|
var _out_Lengths *C.int = nil
|
|
|
|
var _out_len C.size_t = 0
|
|
|
|
C.QCommandLineOption_Names(this.h, &_out, &_out_Lengths, &_out_len)
|
|
|
|
ret := make([]string, int(_out_len))
|
|
|
|
_outCast := (*[0xffff]*C.char)(unsafe.Pointer(_out)) // hey ya
|
|
|
|
_out_LengthsCast := (*[0xffff]C.int)(unsafe.Pointer(_out_Lengths))
|
|
|
|
for i := 0; i < int(_out_len); i++ {
|
|
|
|
ret[i] = C.GoStringN(_outCast[i], _out_LengthsCast[i])
|
|
|
|
}
|
|
|
|
C.free(unsafe.Pointer(_out))
|
|
|
|
return ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineOption) SetValueName(name string) {
|
|
|
|
name_Cstring := C.CString(name)
|
|
|
|
defer C.free(unsafe.Pointer(name_Cstring))
|
2024-09-01 06:50:42 +00:00
|
|
|
C.QCommandLineOption_SetValueName(this.h, name_Cstring, C.size_t(len(name)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineOption) ValueName() string {
|
|
|
|
var _out *C.char = nil
|
|
|
|
var _out_Strlen C.int = 0
|
|
|
|
C.QCommandLineOption_ValueName(this.h, &_out, &_out_Strlen)
|
|
|
|
ret := C.GoStringN(_out, _out_Strlen)
|
|
|
|
C.free(unsafe.Pointer(_out))
|
|
|
|
return ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineOption) SetDescription(description string) {
|
|
|
|
description_Cstring := C.CString(description)
|
|
|
|
defer C.free(unsafe.Pointer(description_Cstring))
|
2024-09-01 06:50:42 +00:00
|
|
|
C.QCommandLineOption_SetDescription(this.h, description_Cstring, C.size_t(len(description)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineOption) Description() string {
|
|
|
|
var _out *C.char = nil
|
|
|
|
var _out_Strlen C.int = 0
|
|
|
|
C.QCommandLineOption_Description(this.h, &_out, &_out_Strlen)
|
|
|
|
ret := C.GoStringN(_out, _out_Strlen)
|
|
|
|
C.free(unsafe.Pointer(_out))
|
|
|
|
return ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineOption) SetDefaultValue(defaultValue string) {
|
|
|
|
defaultValue_Cstring := C.CString(defaultValue)
|
|
|
|
defer C.free(unsafe.Pointer(defaultValue_Cstring))
|
2024-09-01 06:50:42 +00:00
|
|
|
C.QCommandLineOption_SetDefaultValue(this.h, defaultValue_Cstring, C.size_t(len(defaultValue)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineOption) SetDefaultValues(defaultValues []string) {
|
|
|
|
// For the C ABI, malloc two C arrays; raw char* pointers and their lengths
|
2024-09-01 05:51:28 +00:00
|
|
|
defaultValues_CArray := (*[0xffff]*C.char)(C.malloc(C.size_t(8 * len(defaultValues))))
|
2024-09-01 06:50:42 +00:00
|
|
|
defaultValues_Lengths := (*[0xffff]C.uint64_t)(C.malloc(C.size_t(8 * len(defaultValues))))
|
2024-08-25 04:08:24 +00:00
|
|
|
defer C.free(unsafe.Pointer(defaultValues_CArray))
|
|
|
|
defer C.free(unsafe.Pointer(defaultValues_Lengths))
|
|
|
|
for i := range defaultValues {
|
|
|
|
single_cstring := C.CString(defaultValues[i])
|
|
|
|
defer C.free(unsafe.Pointer(single_cstring))
|
|
|
|
defaultValues_CArray[i] = single_cstring
|
2024-09-01 06:50:42 +00:00
|
|
|
defaultValues_Lengths[i] = (C.uint64_t)(len(defaultValues[i]))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-01 06:50:42 +00:00
|
|
|
C.QCommandLineOption_SetDefaultValues(this.h, &defaultValues_CArray[0], &defaultValues_Lengths[0], C.size_t(len(defaultValues)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineOption) DefaultValues() []string {
|
|
|
|
var _out **C.char = nil
|
|
|
|
var _out_Lengths *C.int = nil
|
|
|
|
var _out_len C.size_t = 0
|
|
|
|
C.QCommandLineOption_DefaultValues(this.h, &_out, &_out_Lengths, &_out_len)
|
|
|
|
ret := make([]string, int(_out_len))
|
|
|
|
_outCast := (*[0xffff]*C.char)(unsafe.Pointer(_out)) // hey ya
|
|
|
|
_out_LengthsCast := (*[0xffff]C.int)(unsafe.Pointer(_out_Lengths))
|
|
|
|
for i := 0; i < int(_out_len); i++ {
|
|
|
|
ret[i] = C.GoStringN(_outCast[i], _out_LengthsCast[i])
|
|
|
|
}
|
|
|
|
C.free(unsafe.Pointer(_out))
|
|
|
|
return ret
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
func (this *QCommandLineOption) Flags() int {
|
|
|
|
ret := C.QCommandLineOption_Flags(this.h)
|
|
|
|
return (int)(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineOption) SetFlags(aflags int) {
|
|
|
|
C.QCommandLineOption_SetFlags(this.h, (C.int)(aflags))
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QCommandLineOption) SetHidden(hidden bool) {
|
|
|
|
C.QCommandLineOption_SetHidden(this.h, (C.bool)(hidden))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineOption) IsHidden() bool {
|
|
|
|
ret := C.QCommandLineOption_IsHidden(this.h)
|
|
|
|
return (bool)(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineOption) Delete() {
|
|
|
|
C.QCommandLineOption_Delete(this.h)
|
|
|
|
}
|