[redland-dev] Librdf Parser API (str, len)

Dave Beckett dave.beckett at bristol.ac.uk
Mon Aug 2 14:28:17 BST 2004


On Tue, 27 Jul 2004 13:24:29 -0700, Steve Shepard <steveshepard at mac.com> wrote:

> The librdf parser API provides
> 
> REDLAND_API int librdf_parser_parse_string_into_model(librdf_parser* 
> parser, const unsigned char *string, librdf_uri* base_uri, 
> librdf_model* model);
> 
> for in-memory parsing.  The problem is that it requires a 
> null-terminated string.  How about a variant
> 
> REDLAND_API int librdf_parser_parse_string_into_model(librdf_parser* 
> parser, const unsigned char *string, size_t strlen, librdf_uri* 
> base_uri, librdf_model* model);
> 
> This is useful when
> 
> * you don't have a null terminated string (as often happens when you 
> are parsing chunks of a larger file).
> 
> * you only want to parse a section of a larger const string.
> 
> Both raptor and libxml provide API for this.

Yes, they do.

It seems like a good idea and quite simple, so I'll add it with a
slightly different name, to match the other calls:
librdf_parser_parse_counted_string_into_model

Dave



More information about the redland-dev mailing list