File: cpptest.go

package info (click to toggle)
ciborium 1.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,928 kB
  • sloc: cpp: 2,199; sh: 75; makefile: 20
file content (30 lines) | stat: -rw-r--r-- 601 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Package cpptest is an internal test helper.
package cpptest

// #cgo CXXFLAGS: -std=c++0x -Wall -fno-strict-aliasing -I..
// #cgo LDFLAGS: -lstdc++
//
// #cgo pkg-config: Qt5Core
//
// #include "cpptest.h"
//
import "C"

import (
	"unsafe"

	"gitlab.com/ubports/development/core/ciborium/qml.v1"
)

func NewTestType(engine *qml.Engine) qml.Object {
	var obj qml.Object
	qml.RunMain(func() {
		addr := C.newTestType()
		obj = qml.CommonOf(addr, engine)
	})
	return obj
}

func PlainTestTypeN(obj qml.Object) int {
	return int(C.plainTestTypeN(unsafe.Pointer(obj.Property("plainAddr").(uintptr))))
}