示例#1
0
func (h *HashIMP) Keys() []string {
	self := (*C.cfish_Hash)(Unwrap(h, "h"))
	keysCF := C.CFISH_Hash_Keys(self)
	numKeys := C.CFISH_Vec_Get_Size(keysCF)
	keys := make([]string, 0, int(numKeys))
	for i := C.size_t(0); i < numKeys; i++ {
		keys = append(keys, CFStringToGo(unsafe.Pointer(C.CFISH_Vec_Fetch(keysCF, i))))
	}
	C.cfish_decref(unsafe.Pointer(keysCF))
	return keys
}
示例#2
0
文件: lucy.go 项目: kidaa/lucy
//export GOLUCY_Doc_Field_Names
func GOLUCY_Doc_Field_Names(d *C.lucy_Doc) *C.cfish_Vector {
	ivars := C.lucy_Doc_IVARS(d)
	hash := (*C.cfish_Hash)(ivars.fields)
	return C.CFISH_Hash_Keys(hash)
}