[Xapian-devel] C# bindings and string typed return values

Olly Betts olly at survex.com
Tue Apr 5 04:33:57 BST 2011


On Thu, Mar 31, 2011 at 02:52:52PM +0100, James Aylett wrote:
> On 31 Mar 2011, at 13:38, Greg wrote:
> > On a slightly different topic I was trying to implement a 'Relevant
> > Items' search using ESet and RSet one snag I came upon was that the
> > Query constructor in C#, namely the Query constructor that has the
> > Query.op parameter expects SWIGTYPE_p_std__vectorT_Xapian__Query_t
> > type next which I'm assuming is supposed to be an array of Queries.
> > However I can't really create anything of a kind, I've seen multiple
> > examples in perl and python but those seem to have bindings that allow
> > passing the iterators etc.
>
> The python bindings have some specific code to handle this case
> smoothly; I suspect that the C# ones as yet do not. I believe it
> "just" needs an appropriate SWIG typemap implementing so that suitable
> C# lists can be converted into a vector<Xapian::Query> before passing
> to the internal C++ constructor.

For C#, you'll probably want one for a container of Xapian::Query and
one for a container of strings - in Python we just have a single version
which takes any mixture of strings and Query objects, which isn't going
to work for a strongly typed language.

> (For anyone who's applying for the GSoC "improve existing bindings"
> project idea, this is exactly the sort of thing we'd like to add
> support for!)

Indeed.  Any mention of SWIGTYPE in the C# API is something to address.

Cheers,
    Olly



More information about the Xapian-devel mailing list