Subversion
Functions
URI/URL conversion

URI/URL stuff. More...

Functions

svn_boolean_t svn_path_is_url (const char *path)
 Return TRUE iff path looks like a valid absolute URL.
 
svn_boolean_t svn_path_is_uri_safe (const char *path)
 Return TRUE iff path is URI-safe, FALSE otherwise.
 
const char * svn_path_uri_encode (const char *path, apr_pool_t *pool)
 Return a URI-encoded copy of path, allocated in pool. More...
 
const char * svn_path_uri_decode (const char *path, apr_pool_t *pool)
 Return a URI-decoded copy of path, allocated in pool.
 
const char * svn_path_url_add_component2 (const char *url, const char *component, apr_pool_t *pool)
 Extend url by component, URI-encoding that component before adding it to the url; return the new url, allocated in pool. More...
 
const char * svn_path_url_add_component (const char *url, const char *component, apr_pool_t *pool)
 Like svn_path_url_add_component2(), but allows path components that end with a trailing '/'. More...
 
const char * svn_path_uri_from_iri (const char *iri, apr_pool_t *pool)
 Convert iri (Internationalized URI) to an URI. More...
 
const char * svn_path_uri_autoescape (const char *uri, apr_pool_t *pool)
 URI-encode certain characters in uri that are not valid in an URI, but doesn't have any special meaning in uri at their positions. More...
 

Detailed Description

URI/URL stuff.

Function Documentation

◆ svn_path_uri_autoescape()

const char* svn_path_uri_autoescape ( const char *  uri,
apr_pool_t *  pool 
)

URI-encode certain characters in uri that are not valid in an URI, but doesn't have any special meaning in uri at their positions.

If no characters need escaping, just return uri.

Note
Currently, this function escapes <, >, ", space, {, }, |, \, ^, and `. This may be extended in the future to do context-dependent escaping.
Since
New in 1.1.

◆ svn_path_uri_encode()

const char* svn_path_uri_encode ( const char *  path,
apr_pool_t *  pool 
)

Return a URI-encoded copy of path, allocated in pool.

(path can be an arbitrary UTF-8 string and does not have to be a canonical path.)

◆ svn_path_uri_from_iri()

const char* svn_path_uri_from_iri ( const char *  iri,
apr_pool_t *  pool 
)

Convert iri (Internationalized URI) to an URI.

The return value may be the same as iri if it was already a URI. Else, allocate the return value in pool.

Since
New in 1.1.

◆ svn_path_url_add_component()

const char* svn_path_url_add_component ( const char *  url,
const char *  component,
apr_pool_t *  pool 
)

Like svn_path_url_add_component2(), but allows path components that end with a trailing '/'.

Deprecated:
Provided for backward compatibility with the 1.5 API.

◆ svn_path_url_add_component2()

const char* svn_path_url_add_component2 ( const char *  url,
const char *  component,
apr_pool_t *  pool 
)

Extend url by component, URI-encoding that component before adding it to the url; return the new url, allocated in pool.

If component is NULL, just return a copy of url, allocated in pool.

component need not be a single path segment, but if it contains multiple segments, they must be separated by '/'. component should not begin with '/', however; if it does, the behavior is undefined.

url must be in canonical format; it may not have a trailing '/'.

Note
To add a component that is already URI-encoded, use svn_path_join(url, component, pool) instead.
gstein suggests this for when component begins with '/':
  "replace the path entirely
   https://example.com:4444/base/path joined with /leading/slash,
   should return: https://example.com:4444/leading/slash
   per the RFCs on combining URIs"

  We may implement that someday, which is why leading '/' is
  merely undefined right now.
Since
New in 1.6.