2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qcommandlineparser.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
type QCommandLineParser__SingleDashWordOptionMode int
|
|
|
|
|
|
|
|
const (
|
|
|
|
QCommandLineParser__SingleDashWordOptionMode__ParseAsCompactedShortOptions QCommandLineParser__SingleDashWordOptionMode = 0
|
|
|
|
QCommandLineParser__SingleDashWordOptionMode__ParseAsLongOptions QCommandLineParser__SingleDashWordOptionMode = 1
|
|
|
|
)
|
|
|
|
|
|
|
|
type QCommandLineParser__OptionsAfterPositionalArgumentsMode int
|
|
|
|
|
|
|
|
const (
|
|
|
|
QCommandLineParser__OptionsAfterPositionalArgumentsMode__ParseAsOptions QCommandLineParser__OptionsAfterPositionalArgumentsMode = 0
|
|
|
|
QCommandLineParser__OptionsAfterPositionalArgumentsMode__ParseAsPositionalArguments QCommandLineParser__OptionsAfterPositionalArgumentsMode = 1
|
|
|
|
)
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QCommandLineParser struct {
|
|
|
|
h *C.QCommandLineParser
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineParser) cPointer() *C.QCommandLineParser {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQCommandLineParser(h *C.QCommandLineParser) *QCommandLineParser {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QCommandLineParser{h: h}
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQCommandLineParser_U(h unsafe.Pointer) *QCommandLineParser {
|
|
|
|
return newQCommandLineParser((*C.QCommandLineParser)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQCommandLineParser constructs a new QCommandLineParser object.
|
|
|
|
func NewQCommandLineParser() *QCommandLineParser {
|
|
|
|
ret := C.QCommandLineParser_new()
|
|
|
|
return newQCommandLineParser(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func QCommandLineParser_Tr(sourceText string) string {
|
|
|
|
sourceText_Cstring := C.CString(sourceText)
|
|
|
|
defer C.free(unsafe.Pointer(sourceText_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QCommandLineParser_Tr(sourceText_Cstring)
|
|
|
|
_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 QCommandLineParser_TrUtf8(sourceText string) string {
|
|
|
|
sourceText_Cstring := C.CString(sourceText)
|
|
|
|
defer C.free(unsafe.Pointer(sourceText_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QCommandLineParser_TrUtf8(sourceText_Cstring)
|
|
|
|
_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-04 06:54:22 +00:00
|
|
|
func (this *QCommandLineParser) SetSingleDashWordOptionMode(parsingMode QCommandLineParser__SingleDashWordOptionMode) {
|
2024-08-29 07:01:51 +00:00
|
|
|
C.QCommandLineParser_SetSingleDashWordOptionMode(this.h, (C.uintptr_t)(parsingMode))
|
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QCommandLineParser) SetOptionsAfterPositionalArgumentsMode(mode QCommandLineParser__OptionsAfterPositionalArgumentsMode) {
|
2024-08-29 07:01:51 +00:00
|
|
|
C.QCommandLineParser_SetOptionsAfterPositionalArgumentsMode(this.h, (C.uintptr_t)(mode))
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QCommandLineParser) AddOption(commandLineOption *QCommandLineOption) bool {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QCommandLineParser_AddOption(this.h, commandLineOption.cPointer())
|
|
|
|
return (bool)(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineParser) AddOptions(options []QCommandLineOption) bool {
|
|
|
|
// For the C ABI, malloc a C array of raw pointers
|
2024-09-01 05:51:28 +00:00
|
|
|
options_CArray := (*[0xffff]*C.QCommandLineOption)(C.malloc(C.size_t(8 * len(options))))
|
2024-08-25 04:08:24 +00:00
|
|
|
defer C.free(unsafe.Pointer(options_CArray))
|
|
|
|
for i := range options {
|
|
|
|
options_CArray[i] = options[i].cPointer()
|
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
options_ma := &C.struct_miqt_array{len: C.size_t(len(options)), data: unsafe.Pointer(options_CArray)}
|
|
|
|
defer runtime.KeepAlive(unsafe.Pointer(options_ma))
|
|
|
|
_ret := C.QCommandLineParser_AddOptions(this.h, options_ma)
|
|
|
|
return (bool)(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineParser) AddVersionOption() *QCommandLineOption {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QCommandLineParser_AddVersionOption(this.h)
|
|
|
|
_goptr := newQCommandLineOption(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineParser) AddHelpOption() *QCommandLineOption {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QCommandLineParser_AddHelpOption(this.h)
|
|
|
|
_goptr := newQCommandLineOption(_ret)
|
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineParser) SetApplicationDescription(description string) {
|
2024-09-14 22:29:05 +00:00
|
|
|
description_ms := miqt_strdupg(description)
|
|
|
|
defer C.free(description_ms)
|
|
|
|
C.QCommandLineParser_SetApplicationDescription(this.h, (*C.struct_miqt_string)(description_ms))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineParser) ApplicationDescription() string {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QCommandLineParser_ApplicationDescription(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 *QCommandLineParser) AddPositionalArgument(name string, description string) {
|
2024-09-14 22:29:05 +00:00
|
|
|
name_ms := miqt_strdupg(name)
|
|
|
|
defer C.free(name_ms)
|
|
|
|
description_ms := miqt_strdupg(description)
|
|
|
|
defer C.free(description_ms)
|
|
|
|
C.QCommandLineParser_AddPositionalArgument(this.h, (*C.struct_miqt_string)(name_ms), (*C.struct_miqt_string)(description_ms))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineParser) ClearPositionalArguments() {
|
|
|
|
C.QCommandLineParser_ClearPositionalArguments(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineParser) Process(arguments []string) {
|
|
|
|
// For the C ABI, malloc two C arrays; raw char* pointers and their lengths
|
2024-09-14 22:29:05 +00:00
|
|
|
arguments_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(arguments))))
|
2024-08-25 04:08:24 +00:00
|
|
|
defer C.free(unsafe.Pointer(arguments_CArray))
|
|
|
|
for i := range arguments {
|
2024-09-14 22:29:05 +00:00
|
|
|
single_ms := miqt_strdupg(arguments[i])
|
|
|
|
defer C.free(single_ms)
|
|
|
|
arguments_CArray[i] = (*C.struct_miqt_string)(single_ms)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
arguments_ma := &C.struct_miqt_array{len: C.size_t(len(arguments)), data: unsafe.Pointer(arguments_CArray)}
|
|
|
|
defer runtime.KeepAlive(unsafe.Pointer(arguments_ma))
|
|
|
|
C.QCommandLineParser_Process(this.h, arguments_ma)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineParser) ProcessWithApp(app *QCoreApplication) {
|
|
|
|
C.QCommandLineParser_ProcessWithApp(this.h, app.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineParser) Parse(arguments []string) bool {
|
|
|
|
// For the C ABI, malloc two C arrays; raw char* pointers and their lengths
|
2024-09-14 22:29:05 +00:00
|
|
|
arguments_CArray := (*[0xffff]*C.struct_miqt_string)(C.malloc(C.size_t(8 * len(arguments))))
|
2024-08-25 04:08:24 +00:00
|
|
|
defer C.free(unsafe.Pointer(arguments_CArray))
|
|
|
|
for i := range arguments {
|
2024-09-14 22:29:05 +00:00
|
|
|
single_ms := miqt_strdupg(arguments[i])
|
|
|
|
defer C.free(single_ms)
|
|
|
|
arguments_CArray[i] = (*C.struct_miqt_string)(single_ms)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
arguments_ma := &C.struct_miqt_array{len: C.size_t(len(arguments)), data: unsafe.Pointer(arguments_CArray)}
|
|
|
|
defer runtime.KeepAlive(unsafe.Pointer(arguments_ma))
|
|
|
|
_ret := C.QCommandLineParser_Parse(this.h, arguments_ma)
|
|
|
|
return (bool)(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineParser) ErrorText() string {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QCommandLineParser_ErrorText(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 *QCommandLineParser) IsSet(name string) bool {
|
2024-09-14 22:29:05 +00:00
|
|
|
name_ms := miqt_strdupg(name)
|
|
|
|
defer C.free(name_ms)
|
|
|
|
_ret := C.QCommandLineParser_IsSet(this.h, (*C.struct_miqt_string)(name_ms))
|
|
|
|
return (bool)(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineParser) Value(name string) string {
|
2024-09-14 22:29:05 +00:00
|
|
|
name_ms := miqt_strdupg(name)
|
|
|
|
defer C.free(name_ms)
|
|
|
|
var _ms *C.struct_miqt_string = C.QCommandLineParser_Value(this.h, (*C.struct_miqt_string)(name_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
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineParser) Values(name string) []string {
|
2024-09-14 22:29:05 +00:00
|
|
|
name_ms := miqt_strdupg(name)
|
|
|
|
defer C.free(name_ms)
|
|
|
|
var _ma *C.struct_miqt_array = C.QCommandLineParser_Values(this.h, (*C.struct_miqt_string)(name_ms))
|
|
|
|
_ret := make([]string, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]*C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya
|
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
|
|
|
_ret[i] = C.GoStringN(&_outCast[i].data, C.int(int64(_outCast[i].len)))
|
|
|
|
C.free(unsafe.Pointer(_outCast[i])) // free the inner miqt_string*
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
C.free(unsafe.Pointer(_ma))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineParser) IsSetWithOption(option *QCommandLineOption) bool {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QCommandLineParser_IsSetWithOption(this.h, option.cPointer())
|
|
|
|
return (bool)(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineParser) ValueWithOption(option *QCommandLineOption) string {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QCommandLineParser_ValueWithOption(this.h, option.cPointer())
|
|
|
|
_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 *QCommandLineParser) ValuesWithOption(option *QCommandLineOption) []string {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ma *C.struct_miqt_array = C.QCommandLineParser_ValuesWithOption(this.h, option.cPointer())
|
|
|
|
_ret := make([]string, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]*C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya
|
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
|
|
|
_ret[i] = C.GoStringN(&_outCast[i].data, C.int(int64(_outCast[i].len)))
|
|
|
|
C.free(unsafe.Pointer(_outCast[i])) // free the inner miqt_string*
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
C.free(unsafe.Pointer(_ma))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineParser) PositionalArguments() []string {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ma *C.struct_miqt_array = C.QCommandLineParser_PositionalArguments(this.h)
|
|
|
|
_ret := make([]string, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]*C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya
|
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
|
|
|
_ret[i] = C.GoStringN(&_outCast[i].data, C.int(int64(_outCast[i].len)))
|
|
|
|
C.free(unsafe.Pointer(_outCast[i])) // free the inner miqt_string*
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
C.free(unsafe.Pointer(_ma))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineParser) OptionNames() []string {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ma *C.struct_miqt_array = C.QCommandLineParser_OptionNames(this.h)
|
|
|
|
_ret := make([]string, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]*C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya
|
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
|
|
|
_ret[i] = C.GoStringN(&_outCast[i].data, C.int(int64(_outCast[i].len)))
|
|
|
|
C.free(unsafe.Pointer(_outCast[i])) // free the inner miqt_string*
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
C.free(unsafe.Pointer(_ma))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineParser) UnknownOptionNames() []string {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ma *C.struct_miqt_array = C.QCommandLineParser_UnknownOptionNames(this.h)
|
|
|
|
_ret := make([]string, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]*C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya
|
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
|
|
|
_ret[i] = C.GoStringN(&_outCast[i].data, C.int(int64(_outCast[i].len)))
|
|
|
|
C.free(unsafe.Pointer(_outCast[i])) // free the inner miqt_string*
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
C.free(unsafe.Pointer(_ma))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QCommandLineParser) HelpText() string {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QCommandLineParser_HelpText(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 QCommandLineParser_Tr2(sourceText string, disambiguation string) string {
|
|
|
|
sourceText_Cstring := C.CString(sourceText)
|
|
|
|
defer C.free(unsafe.Pointer(sourceText_Cstring))
|
|
|
|
disambiguation_Cstring := C.CString(disambiguation)
|
|
|
|
defer C.free(unsafe.Pointer(disambiguation_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QCommandLineParser_Tr2(sourceText_Cstring, disambiguation_Cstring)
|
|
|
|
_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 QCommandLineParser_Tr3(sourceText string, disambiguation string, n int) string {
|
|
|
|
sourceText_Cstring := C.CString(sourceText)
|
|
|
|
defer C.free(unsafe.Pointer(sourceText_Cstring))
|
|
|
|
disambiguation_Cstring := C.CString(disambiguation)
|
|
|
|
defer C.free(unsafe.Pointer(disambiguation_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QCommandLineParser_Tr3(sourceText_Cstring, disambiguation_Cstring, (C.int)(n))
|
|
|
|
_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 QCommandLineParser_TrUtf82(sourceText string, disambiguation string) string {
|
|
|
|
sourceText_Cstring := C.CString(sourceText)
|
|
|
|
defer C.free(unsafe.Pointer(sourceText_Cstring))
|
|
|
|
disambiguation_Cstring := C.CString(disambiguation)
|
|
|
|
defer C.free(unsafe.Pointer(disambiguation_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QCommandLineParser_TrUtf82(sourceText_Cstring, disambiguation_Cstring)
|
|
|
|
_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 QCommandLineParser_TrUtf83(sourceText string, disambiguation string, n int) string {
|
|
|
|
sourceText_Cstring := C.CString(sourceText)
|
|
|
|
defer C.free(unsafe.Pointer(sourceText_Cstring))
|
|
|
|
disambiguation_Cstring := C.CString(disambiguation)
|
|
|
|
defer C.free(unsafe.Pointer(disambiguation_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QCommandLineParser_TrUtf83(sourceText_Cstring, disambiguation_Cstring, (C.int)(n))
|
|
|
|
_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 *QCommandLineParser) AddPositionalArgument3(name string, description string, syntax string) {
|
2024-09-14 22:29:05 +00:00
|
|
|
name_ms := miqt_strdupg(name)
|
|
|
|
defer C.free(name_ms)
|
|
|
|
description_ms := miqt_strdupg(description)
|
|
|
|
defer C.free(description_ms)
|
|
|
|
syntax_ms := miqt_strdupg(syntax)
|
|
|
|
defer C.free(syntax_ms)
|
|
|
|
C.QCommandLineParser_AddPositionalArgument3(this.h, (*C.struct_miqt_string)(name_ms), (*C.struct_miqt_string)(description_ms), (*C.struct_miqt_string)(syntax_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 *QCommandLineParser) Delete() {
|
|
|
|
C.QCommandLineParser_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 *QCommandLineParser) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QCommandLineParser) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|