lucene-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Querna <c...@force-elite.com>
Subject Re: Directory interface
Date Sun, 05 Jun 2005 19:05:09 GMT
Garrett Rooney wrote:

> The current interface exposed by Lucene4c requires the user to pass in 
> a path when a directory is needed, as opposed to using an actual 
> directory object.
>
> Advantage: Less code to write, no need to create yet another object 
> when you want to access a local directory.
>
> Disavantage: No way to use something other than what amounts to an 
> FSDirectory under the hood.  Now most of the time what you want is an 
> FSDirectory, but there's nothing that requires that to be the case, 
> and other directory implementations do exist in the Java code that we 
> could wrap, not to mention the fact that we could provide our own 
> interface for implementing one in C.

why can't we have a simple struct that wraps the FSDirectory?

All it needs is an int to identify each Directory object type, and 
either a void* or Union that we can cast.  Yes, its not super pretty, 
but it means one API..... I would suggest not even making this structure 
public.

-Paul

Mime
View raw message