Top | ![]() |
![]() |
![]() |
![]() |
librdf_uri * | librdf_new_uri () |
librdf_uri * | librdf_new_uri2 () |
librdf_uri * | librdf_new_uri_from_uri () |
librdf_uri * | librdf_new_uri_from_uri_local_name () |
void | librdf_free_uri () |
unsigned char * | librdf_uri_as_string () |
unsigned char * | librdf_uri_as_counted_string () |
void | librdf_uri_print () |
unsigned char * | librdf_uri_to_string () |
unsigned char * | librdf_uri_to_counted_string () |
int | librdf_uri_equals () |
int | librdf_uri_is_file_uri () |
const char * | librdf_uri_to_filename () |
librdf_uri * | librdf_new_uri_normalised_to_base () |
librdf_uri * | librdf_new_uri_relative_to_base () |
librdf_uri * | librdf_new_uri_from_filename () |
int | librdf_uri_compare () |
int | (*librdf_uri_filter_func) () |
A class for absolute URIs and relative URI computation utility functions. Only absolute URIs are provided, with no current access to internals of URIs such as URI scheme, path, authority. Relative URIs can be generated against some base or turned to and from local filenames.
librdf_uri * librdf_new_uri (librdf_world *world
,const unsigned char *uri_string
);
Constructor - create a new librdf_uri object from a URI string.
A new URI is constructed from a copy of the string. If the string is a NULL pointer or empty (0 length) then the result is NULL.
librdf_uri * librdf_new_uri2 (librdf_world *world
,const unsigned char *uri_string
,size_t length
);
Constructor - create a new librdf_uri object from a counted URI string.
A new URI is constructed from a copy of the string. If the string is a NULL pointer or 0 length or empty (first byte is 0) then the result is NULL.
librdf_uri *
librdf_new_uri_from_uri (librdf_uri *old_uri
);
Copy constructor - create a new librdf_uri object from an existing librdf_uri object.
librdf_uri * librdf_new_uri_from_uri_local_name (librdf_uri *old_uri
,const unsigned char *local_name
);
Copy constructor - create a new librdf_uri object from an existing librdf_uri object and a local name.
void
librdf_free_uri (librdf_uri *uri
);
Destructor - destroy a librdf_uri object.
unsigned char *
librdf_uri_as_string (librdf_uri *uri
);
Get a pointer to the string representation of the URI.
Returns a shared pointer to the URI string representation. Note: does not allocate a new string so the caller must not free it.
unsigned char * librdf_uri_as_counted_string (librdf_uri *uri
,size_t *len_p
);
Get a pointer to the string representation of the URI with length.
Returns a shared pointer to the URI string representation. Note: does not allocate a new string so the caller must not free it.
void librdf_uri_print (librdf_uri *uri
,FILE *fh
);
Print the URI to the given file handle.
unsigned char *
librdf_uri_to_string (librdf_uri *uri
);
Format the URI as a string.
Note: this method allocates a new string since this is a _to_ method and the caller must free the resulting memory.
unsigned char * librdf_uri_to_counted_string (librdf_uri *uri
,size_t *len_p
);
Format the URI as a counted string.
Note: this method allocates a new string since this is a _to_ method and the caller must free the resulting memory.
int librdf_uri_equals (librdf_uri *first_uri
,librdf_uri *second_uri
);
Compare two librdf_uri objects for equality.
int
librdf_uri_is_file_uri (librdf_uri *uri
);
Test if a URI points to a filename.
const char *
librdf_uri_to_filename (librdf_uri *uri
);
Return pointer to filename of URI.
Returns a pointer to a newly allocated buffer that the caller must free. This will fail if the URI is not a file: URI. This can be checked with librdf_uri_is_file_uri
librdf_uri * librdf_new_uri_normalised_to_base (const unsigned char *uri_string
,librdf_uri *source_uri
,librdf_uri *base_uri
);
Constructor - create a new librdf_uri object from a URI string stripped of the source URI, made relative to the base URI.
librdf_uri * librdf_new_uri_relative_to_base (librdf_uri *base_uri
,const unsigned char *uri_string
);
Constructor - create a new librdf_uri object from a URI string relative to a base URI.
An empty uri_string or NULL is equivalent to librdf_new_uri_from_uri(base_uri)
librdf_uri * librdf_new_uri_from_filename (librdf_world *world
,const char *filename
);
Constructor - create a new librdf_uri object from a filename.
int librdf_uri_compare (librdf_uri *uri1
,librdf_uri *uri2
);
Compare two librdf_uri objects lexicographically.
A NULL URI is always less than (never equal to) a non-NULL URI.
int (*librdf_uri_filter_func) (void *user_data
,librdf_uri *uri
);
Callback function for librdf_parser_set_uri_filter()