2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qurlquery.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QUrlQuery struct {
|
|
|
|
h *C.QUrlQuery
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QUrlQuery) cPointer() *C.QUrlQuery {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQUrlQuery(h *C.QUrlQuery) *QUrlQuery {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QUrlQuery{h: h}
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQUrlQuery_U(h unsafe.Pointer) *QUrlQuery {
|
|
|
|
return newQUrlQuery((*C.QUrlQuery)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQUrlQuery constructs a new QUrlQuery object.
|
|
|
|
func NewQUrlQuery() *QUrlQuery {
|
|
|
|
ret := C.QUrlQuery_new()
|
|
|
|
return newQUrlQuery(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQUrlQuery2 constructs a new QUrlQuery object.
|
|
|
|
func NewQUrlQuery2(url *QUrl) *QUrlQuery {
|
|
|
|
ret := C.QUrlQuery_new2(url.cPointer())
|
|
|
|
return newQUrlQuery(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQUrlQuery3 constructs a new QUrlQuery object.
|
|
|
|
func NewQUrlQuery3(queryString string) *QUrlQuery {
|
2024-09-14 22:29:05 +00:00
|
|
|
queryString_ms := miqt_strdupg(queryString)
|
|
|
|
defer C.free(queryString_ms)
|
|
|
|
ret := C.QUrlQuery_new3((*C.struct_miqt_string)(queryString_ms))
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQUrlQuery(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQUrlQuery4 constructs a new QUrlQuery object.
|
|
|
|
func NewQUrlQuery4(other *QUrlQuery) *QUrlQuery {
|
|
|
|
ret := C.QUrlQuery_new4(other.cPointer())
|
|
|
|
return newQUrlQuery(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QUrlQuery) OperatorAssign(other *QUrlQuery) {
|
|
|
|
C.QUrlQuery_OperatorAssign(this.h, other.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QUrlQuery) OperatorEqual(other *QUrlQuery) bool {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QUrlQuery_OperatorEqual(this.h, other.cPointer())
|
|
|
|
return (bool)(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QUrlQuery) OperatorNotEqual(other *QUrlQuery) bool {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QUrlQuery_OperatorNotEqual(this.h, other.cPointer())
|
|
|
|
return (bool)(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QUrlQuery) Swap(other *QUrlQuery) {
|
|
|
|
C.QUrlQuery_Swap(this.h, other.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QUrlQuery) IsEmpty() bool {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QUrlQuery_IsEmpty(this.h)
|
|
|
|
return (bool)(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QUrlQuery) IsDetached() bool {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QUrlQuery_IsDetached(this.h)
|
|
|
|
return (bool)(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QUrlQuery) Clear() {
|
|
|
|
C.QUrlQuery_Clear(this.h)
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
func (this *QUrlQuery) Query() string {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QUrlQuery_Query(this.h)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QUrlQuery) SetQuery(queryString string) {
|
2024-09-14 22:29:05 +00:00
|
|
|
queryString_ms := miqt_strdupg(queryString)
|
|
|
|
defer C.free(queryString_ms)
|
|
|
|
C.QUrlQuery_SetQuery(this.h, (*C.struct_miqt_string)(queryString_ms))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
func (this *QUrlQuery) ToString() string {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QUrlQuery_ToString(this.h)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QUrlQuery) SetQueryDelimiters(valueDelimiter QChar, pairDelimiter QChar) {
|
|
|
|
C.QUrlQuery_SetQueryDelimiters(this.h, valueDelimiter.cPointer(), pairDelimiter.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QUrlQuery) QueryValueDelimiter() *QChar {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QUrlQuery_QueryValueDelimiter(this.h)
|
|
|
|
_goptr := newQChar(_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 *QUrlQuery) QueryPairDelimiter() *QChar {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QUrlQuery_QueryPairDelimiter(this.h)
|
|
|
|
_goptr := newQChar(_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 *QUrlQuery) HasQueryItem(key string) bool {
|
2024-09-14 22:29:05 +00:00
|
|
|
key_ms := miqt_strdupg(key)
|
|
|
|
defer C.free(key_ms)
|
|
|
|
_ret := C.QUrlQuery_HasQueryItem(this.h, (*C.struct_miqt_string)(key_ms))
|
|
|
|
return (bool)(_ret)
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QUrlQuery) AddQueryItem(key string, value string) {
|
2024-09-14 22:29:05 +00:00
|
|
|
key_ms := miqt_strdupg(key)
|
|
|
|
defer C.free(key_ms)
|
|
|
|
value_ms := miqt_strdupg(value)
|
|
|
|
defer C.free(value_ms)
|
|
|
|
C.QUrlQuery_AddQueryItem(this.h, (*C.struct_miqt_string)(key_ms), (*C.struct_miqt_string)(value_ms))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QUrlQuery) RemoveQueryItem(key string) {
|
2024-09-14 22:29:05 +00:00
|
|
|
key_ms := miqt_strdupg(key)
|
|
|
|
defer C.free(key_ms)
|
|
|
|
C.QUrlQuery_RemoveQueryItem(this.h, (*C.struct_miqt_string)(key_ms))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
func (this *QUrlQuery) QueryItemValue(key string) string {
|
2024-09-14 22:29:05 +00:00
|
|
|
key_ms := miqt_strdupg(key)
|
|
|
|
defer C.free(key_ms)
|
|
|
|
var _ms *C.struct_miqt_string = C.QUrlQuery_QueryItemValue(this.h, (*C.struct_miqt_string)(key_ms))
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QUrlQuery) AllQueryItemValues(key string) []string {
|
2024-09-14 22:29:05 +00:00
|
|
|
key_ms := miqt_strdupg(key)
|
|
|
|
defer C.free(key_ms)
|
|
|
|
var _ma *C.struct_miqt_array = C.QUrlQuery_AllQueryItemValues(this.h, (*C.struct_miqt_string)(key_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-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
C.free(unsafe.Pointer(_ma))
|
|
|
|
return _ret
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QUrlQuery) RemoveAllQueryItems(key string) {
|
2024-09-14 22:29:05 +00:00
|
|
|
key_ms := miqt_strdupg(key)
|
|
|
|
defer C.free(key_ms)
|
|
|
|
C.QUrlQuery_RemoveAllQueryItems(this.h, (*C.struct_miqt_string)(key_ms))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QUrlQuery_DefaultQueryValueDelimiter() *QChar {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QUrlQuery_DefaultQueryValueDelimiter()
|
|
|
|
_goptr := newQChar(_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 QUrlQuery_DefaultQueryPairDelimiter() *QChar {
|
2024-09-14 22:29:05 +00:00
|
|
|
_ret := C.QUrlQuery_DefaultQueryPairDelimiter()
|
|
|
|
_goptr := newQChar(_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
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
func (this *QUrlQuery) Query1(encoding int) string {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QUrlQuery_Query1(this.h, (C.int)(encoding))
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QUrlQuery) ToString1(encoding int) string {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QUrlQuery_ToString1(this.h, (C.int)(encoding))
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QUrlQuery) QueryItemValue2(key string, encoding int) string {
|
2024-09-14 22:29:05 +00:00
|
|
|
key_ms := miqt_strdupg(key)
|
|
|
|
defer C.free(key_ms)
|
|
|
|
var _ms *C.struct_miqt_string = C.QUrlQuery_QueryItemValue2(this.h, (*C.struct_miqt_string)(key_ms), (C.int)(encoding))
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QUrlQuery) AllQueryItemValues2(key string, encoding int) []string {
|
2024-09-14 22:29:05 +00:00
|
|
|
key_ms := miqt_strdupg(key)
|
|
|
|
defer C.free(key_ms)
|
|
|
|
var _ma *C.struct_miqt_array = C.QUrlQuery_AllQueryItemValues2(this.h, (*C.struct_miqt_string)(key_ms), (C.int)(encoding))
|
|
|
|
_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-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
C.free(unsafe.Pointer(_ma))
|
|
|
|
return _ret
|
2024-08-29 07:01:51 +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 *QUrlQuery) Delete() {
|
|
|
|
C.QUrlQuery_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 *QUrlQuery) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QUrlQuery) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|