Top |
raptor_serializer * raptor_new_serializer (raptor_world *world
,const char *name
);
Constructor - create a new raptor_serializer object.
void
raptor_free_serializer (raptor_serializer *rdf_serializer
);
Destructor - destroy a raptor_serializer object.
int raptor_serializer_start_to_iostream (raptor_serializer *rdf_serializer
,raptor_uri *uri
,raptor_iostream *iostream
);
Start serialization to an iostream with given base URI
The passed in iostream
does not become owned by the serializer
and can be used by the caller after serializing is done. It
must be destroyed by the caller.
rdf_serializer |
||
uri |
base URI or NULL if no base URI is required |
|
iostream |
raptor_iostream to write serialization to |
int raptor_serializer_start_to_filename (raptor_serializer *rdf_serializer
,const char *filename
);
Start serializing to a filename.
int raptor_serializer_start_to_string (raptor_serializer *rdf_serializer
,raptor_uri *uri
,void **string_p
,size_t *length_p
);
Start serializing to a string.
int raptor_serializer_start_to_file_handle (raptor_serializer *rdf_serializer
,raptor_uri *uri
,FILE *fh
);
Start serializing to a FILE*.
NOTE: This does not fclose the handle when it is finished.
int raptor_serializer_set_namespace (raptor_serializer *rdf_serializer
,raptor_uri *uri
,const char *prefix
);
set a namespace uri/prefix mapping for serializing.
int raptor_serializer_set_namespace_from_namespace (raptor_serializer *rdf_serializer
,raptor_namespace *nspace
);
Set a namespace uri/prefix mapping for serializing from an existing namespace.
int raptor_serializer_serialize_statement (raptor_serializer *rdf_serializer
,raptor_statement *statement
);
Serialize a statement.
int
raptor_serializer_serialize_end (raptor_serializer *rdf_serializer
);
End a serialization.
int
raptor_serializer_flush (raptor_serializer *rdf_serializer
);
Flush the current serializer output and free any pending state
In serializers that can generate blocks of content, this causes the writing of any current pending block. For example in Turtle this may write all pending triples.
const raptor_syntax_description *
raptor_serializer_get_description (raptor_serializer *rdf_serializer
);
Get description of the syntaxes of the serializer.
The returned description is static and lives as long as the raptor library (raptor world).
raptor_iostream *
raptor_serializer_get_iostream (raptor_serializer *serializer
);
Get the current serializer iostream.
raptor_locator *
raptor_serializer_get_locator (raptor_serializer *rdf_serializer
);
Get the serializer raptor locator object.
int raptor_serializer_set_option (raptor_serializer *serializer
,raptor_option option
,const char *string
,int integer
);
Set serializer option.
If string
is not NULL and the option type is numeric, the string
value is converted to an integer and used in preference to integer
.
If string
is NULL and the option type is not numeric, an error is
returned.
The string
values used are copied.
The allowed options are available via
raptor_world_get_option_description()
.
serializer |
raptor_serializer serializer object |
|
option |
option to set from enumerated raptor_option values |
|
string |
string option value (or NULL) |
|
integer |
integer option value |
int raptor_serializer_get_option (raptor_serializer *serializer
,raptor_option option
,char **string_p
,int *integer_p
);
Get serializer option.
Any string value returned in *string_p
is shared and must
be copied by the caller.
The allowed options are available via
raptor_world_get_option_description()
.
serializer |
raptor_serializer serializer object |
|
option |
option to get value |
|
string_p |
pointer to where to store string value |
|
integer_p |
pointer to where to store integer value |
raptor_world *
raptor_serializer_get_world (raptor_serializer *rdf_serializer
);
Get the raptor_world object associated with a serializer.