Redland RDF Library Manual | ||||
---|---|---|---|---|
Top | Description |
typedef librdf_uri; librdf_uri * librdf_new_uri (librdf_world *world
,const unsigned char *uri_string
); librdf_uri * librdf_new_uri2 (librdf_world *world
,const unsigned char *uri_string
,size_t length
); librdf_uri * librdf_new_uri_from_uri (librdf_uri *old_uri
); librdf_uri * librdf_new_uri_from_uri_local_name (librdf_uri *old_uri
,const unsigned char *local_name
); void librdf_free_uri (librdf_uri *uri
); unsigned char * librdf_uri_as_string (librdf_uri *uri
); unsigned char * librdf_uri_as_counted_string (librdf_uri *uri
,size_t *len_p
); void librdf_uri_print (librdf_uri *uri
,FILE *fh
); unsigned char * librdf_uri_to_string (librdf_uri *uri
); unsigned char * librdf_uri_to_counted_string (librdf_uri *uri
,size_t *len_p
); int librdf_uri_equals (librdf_uri *first_uri
,librdf_uri *second_uri
); int librdf_uri_is_file_uri (librdf_uri *uri
); const char * librdf_uri_to_filename (librdf_uri *uri
); librdf_uri * librdf_new_uri_normalised_to_base (const unsigned char *uri_string
,librdf_uri *source_uri
,librdf_uri *base_uri
); librdf_uri * librdf_new_uri_relative_to_base (librdf_uri *base_uri
,const unsigned char *uri_string
); librdf_uri * librdf_new_uri_from_filename (librdf_world *world
,const char *filename
); int librdf_uri_compare (librdf_uri *uri1
,librdf_uri *uri2
); int (*librdf_uri_filter_func) (void *user_data
,librdf_uri *uri
);
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.
|
redland world object |
|
URI in string form |
Returns : |
a new librdf_uri object or NULL on failure |
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.
|
redland world object |
|
URI in string form |
|
length of string |
Returns : |
a new librdf_uri object or NULL on failure |
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 object |
Returns : |
a new librdf_uri object or NULL on failure |
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.
|
librdf_uri object |
|
local name to append to URI |
Returns : |
a new librdf_uri object or NULL on failure |
void librdf_free_uri (librdf_uri *uri
);
Destructor - destroy a librdf_uri object.
|
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.
|
librdf_uri object |
Returns : |
string representation of URI |
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.
|
librdf_uri object |
|
pointer to location to store length |
Returns : |
string representation of URI |
void librdf_uri_print (librdf_uri *uri
,FILE *fh
);
Print the URI to the given file handle.
|
librdf_uri object |
|
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.
|
librdf_uri object |
Returns : |
string representation of the URI or NULL on failure |
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.
|
librdf_uri object |
|
pointer to location to store length |
Returns : |
string representation of the URI or NULL on failure |
int librdf_uri_equals (librdf_uri *first_uri
,librdf_uri *second_uri
);
Compare two librdf_uri objects for equality.
|
librdf_uri object 1 |
|
librdf_uri object 2 |
Returns : |
non 0 if the objects are equal |
int librdf_uri_is_file_uri (librdf_uri *uri
);
Test if a URI points to a filename.
|
librdf_uri object |
Returns : |
Non zero if the URI points to a file |
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 object |
Returns : |
pointer to filename or NULL on failure |
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.
|
URI in string form |
|
source URI to remove |
|
base URI to add |
Returns : |
a new librdf_uri object or NULL on failure |
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)
|
absolute base URI |
|
relative URI string |
Returns : |
a new librdf_uri object or NULL on failure |
librdf_uri * librdf_new_uri_from_filename (librdf_world *world
,const char *filename
);
Constructor - create a new librdf_uri object from a filename.
|
Redland librdf_world object |
|
filename |
Returns : |
a new librdf_uri object or NULL on failure |
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.
|
librdf_uri object 1 or NULL |
|
librdf_uri object 2 or NULL |
Returns : |
<0 if uri1 is less than uri2 , 0 if equal, >0 if uri1 is greater than uri2
|
int (*librdf_uri_filter_func) (void *user_data
,librdf_uri *uri
);
Callback function for librdf_parser_set_uri_filter()
|
user data |
|
librdf_uri URI to check |
Returns : |
non-0 to filter the URI |