我为 libpostal 库创建了 ac# 绑定(指向 LibPostalNet 的链接)。
我使用 CppSharp 创建绑定。它有效,但我不知道如何转换此代码:
typedef struct libpostal_address_parser_response
{
size_t num_components;
char** components;
char** labels;
}
libpostal_address_parser_response_t;
CppSharp 以这种方式转换代码:
public sbyte** Components
{
get
{
return (sbyte**)((global::LibPostalNet.LibpostalAddressParserResponse.__Internal*)__Instance)->components;
}
set
{
((global::LibPostalNet.LibpostalAddressParserResponse.__Internal*)__Instance)->components = (global::System.IntPtr)value;
}
}
public sbyte** Labels
{
get
{
return (sbyte**)((global::LibPostalNet.LibpostalAddressParserResponse.__Internal*)__Instance)->labels;
}
set
{
((global::LibPostalNet.LibpostalAddressParserResponse.__Internal*)__Instance)->labels = (global::System.IntPtr)value;
}
}
代码应该返回一个长度为 num_components 的字符串数组。
你能帮我解决这个问题吗?