【发布时间】:2017-09-10 20:47:50
【问题描述】:
我已经为 libpostal 库 (link to LibPostalNet) 创建了一个 c# 绑定。
我使用 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 的字符串数组。
你能帮我解决这个问题吗?
【问题讨论】:
标签: c# c++ .net binding cppsharp