在pyi模块中定义了该接口 ,
def get_para(self)->dict:
C中参考了返列表的操作,实现不了,关键代码如下:
PikaObj* dict = newNormalObj(New_PikaStdData_Dict);
PikaStdData_Dict___init__(dict);
Arg* arg = arg_setBytes(NULL, "", para1, 32);
PikaStdData_Dict_set(dict,"para1", arg);
arg_deinit(arg);
arg = arg_setBytes(NULL, "", para2, 32);
PikaStdData_Dict_set(dict,"para2", arg);
arg_deinit(arg);
return dict;
最近编辑记录 jiuri (2022-09-09 11:50:57)
离线
之前版本有些问题,升级到 v1.10.8,然后参考下面的示例
pyi:
def test_dict() -> dict: ...
C:
PikaObj* Test_test_dict(PikaObj* self) {
PikaObj* dict = newNormalObj(New_PikaStdData_Dict);
PikaStdData_Dict___init__(dict);
Arg* para1 = arg_newInt(1);
Arg* para2 = arg_newInt(2);
PikaStdData_Dict_set(dict, "para1", para1);
PikaStdData_Dict_set(dict, "para2", para2);
arg_deinit(para1);
arg_deinit(para2);
return dict;
}
离线