コード例 #1
0
ファイル: Cursor.go プロジェクト: teodor-pripoae/gophia
// Value returns the current value of the cursor.
func (cur *Cursor) Value() []byte {
	size := C.int(C.sp_valuesize(cur.Pointer))
	if 0 == size {
		fmt.Println("Value is 0 len")
		return nil
	}
	return C.GoBytes(unsafe.Pointer(C.sp_value(cur.Pointer)), size)
}
コード例 #2
0
ファイル: Cursor.go プロジェクト: teodor-pripoae/gophia
// ValueSize returns the length of the current value.
func (cur *Cursor) ValueSize() int {
	return int(C.sp_valuesize(cur.Pointer))
}