Eneboo - Documentación para desarrolladores
Clases | 'typedefs' | Funciones
Referencia del Archivo src/libdigidoc/libxml2/include/libxml/uri.h
#include <libxml/xmlversion.h>
#include <libxml/tree.h>

Ir al código fuente de este archivo.

Clases

struct  _xmlURI

'typedefs'

typedef struct _xmlURI xmlURI
typedef xmlURIxmlURIPtr

Funciones

XMLPUBFUN xmlURIPtr XMLCALL xmlCreateURI (void)
XMLPUBFUN xmlChar *XMLCALL xmlBuildURI (const xmlChar *URI, const xmlChar *base)
XMLPUBFUN xmlChar *XMLCALL xmlBuildRelativeURI (const xmlChar *URI, const xmlChar *base)
XMLPUBFUN xmlURIPtr XMLCALL xmlParseURI (const char *str)
XMLPUBFUN xmlURIPtr XMLCALL xmlParseURIRaw (const char *str, int raw)
XMLPUBFUN int XMLCALL xmlParseURIReference (xmlURIPtr uri, const char *str)
XMLPUBFUN xmlChar *XMLCALL xmlSaveUri (xmlURIPtr uri)
XMLPUBFUN void XMLCALL xmlPrintURI (FILE *stream, xmlURIPtr uri)
XMLPUBFUN xmlChar *XMLCALL xmlURIEscapeStr (const xmlChar *str, const xmlChar *list)
XMLPUBFUN char *XMLCALL xmlURIUnescapeString (const char *str, int len, char *target)
XMLPUBFUN int XMLCALL xmlNormalizeURIPath (char *path)
XMLPUBFUN xmlChar *XMLCALL xmlURIEscape (const xmlChar *str)
XMLPUBFUN void XMLCALL xmlFreeURI (xmlURIPtr uri)
XMLPUBFUN xmlChar *XMLCALL xmlCanonicPath (const xmlChar *path)
XMLPUBFUN xmlChar *XMLCALL xmlPathToURI (const xmlChar *path)

Documentación de los 'typedefs'

typedef struct _xmlURI xmlURI

Summary: library of generic URI related routines Description: library of generic URI related routines Implements RFC 2396

Copy: See Copyright for the status of this software.

Author: Daniel Veillard xmlURI:

A parsed URI reference. This is a struct containing the various fields as described in RFC 2396 but separated for further processing.

Note: query is a deprecated field which is incorrectly unescaped. query_raw takes precedence over query if the former is set. See: http://mail.gnome.org/archives/xml/2007-April/thread.html#00127

typedef xmlURI* xmlURIPtr

Documentación de las funciones

XMLPUBFUN xmlChar* XMLCALL xmlBuildRelativeURI ( const xmlChar URI,
const xmlChar base 
)

xmlBuildRelativeURI: : the URI reference under consideration : the base value

Expresses the URI of the reference in terms relative to the base. Some examples of this operation include: base = "http://site1.com/docs/book1.html" URI input URI returned docs/pic1.gif pic1.gif docs/img/pic1.gif img/pic1.gif img/pic1.gif ../img/pic1.gif http://site1.com/docs/pic1.gif pic1.gif http://site2.com/docs/pic1.gif http://site2.com/docs/pic1.gif

base = "docs/book1.html" URI input URI returned docs/pic1.gif pic1.gif docs/img/pic1.gif img/pic1.gif img/pic1.gif ../img/pic1.gif http://site1.com/docs/pic1.gif http://site1.com/docs/pic1.gif

Note: if the URI reference is really wierd or complicated, it may be worthwhile to first convert it into a "nice" one by calling xmlBuildURI (using 'base') before calling this routine, since this routine (for reasonable efficiency) assumes URI has already been through some validation.

Returns a new URI string (to be freed by the caller) or NULL in case error.

XMLPUBFUN xmlChar* XMLCALL xmlBuildURI ( const xmlChar URI,
const xmlChar base 
)

xmlBuildURI: : the URI instance found in the document : the base value

Computes he final URI of the reference done by checking that the given URI is valid, and building the final URI using the base URI. This is processed according to section 5.2 of the RFC 2396

5.2. Resolving Relative References to Absolute Form

Returns a new URI string (to be freed by the caller) or NULL in case of error.

XMLPUBFUN xmlChar* XMLCALL xmlCanonicPath ( const xmlChar path)
XMLPUBFUN xmlURIPtr XMLCALL xmlCreateURI ( void  )

xmlCreateURI:

Simply creates an empty xmlURI

Returns the new structure or NULL in case of error

XMLPUBFUN void XMLCALL xmlFreeURI ( xmlURIPtr  uri)

xmlFreeURI: : pointer to an xmlURI

Free up the xmlURI struct

XMLPUBFUN int XMLCALL xmlNormalizeURIPath ( char *  path)

xmlNormalizeURIPath: : pointer to the path string

Applies the 5 normalization steps to a path string--that is, RFC 2396 Section 5.2, steps 6.c through 6.g.

Normalization occurs directly on the string, no new allocation is done

Returns 0 or an error code

XMLPUBFUN xmlURIPtr XMLCALL xmlParseURI ( const char *  str)

xmlParseURI: : the URI string to analyze

Parse an URI based on RFC 3986

URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]

Returns a newly built xmlURIPtr or NULL in case of error

XMLPUBFUN xmlURIPtr XMLCALL xmlParseURIRaw ( const char *  str,
int  raw 
)

xmlParseURIRaw: : the URI string to analyze : if 1 unescaping of URI pieces are disabled

Parse an URI but allows to keep intact the original fragments.

URI-reference = URI / relative-ref

Returns a newly built xmlURIPtr or NULL in case of error

XMLPUBFUN int XMLCALL xmlParseURIReference ( xmlURIPtr  uri,
const char *  str 
)

xmlParseURIReference: : pointer to an URI structure : the string to analyze

Parse an URI reference string based on RFC 3986 and fills in the appropriate fields of the structure

URI-reference = URI / relative-ref

Returns 0 or the error code

XMLPUBFUN xmlChar* XMLCALL xmlPathToURI ( const xmlChar path)

xmlPathToURI: : the resource locator in a filesystem notation

Constructs an URI expressing the existing path

Returns a new URI, or a duplicate of the path parameter if the construction fails. The caller is responsible for freeing the memory occupied by the returned string. If there is insufficient memory available, or the argument is NULL, the function returns NULL.

XMLPUBFUN void XMLCALL xmlPrintURI ( FILE *  stream,
xmlURIPtr  uri 
)

xmlPrintURI: : a FILE* for the output : pointer to an xmlURI

Prints the URI in the stream .

XMLPUBFUN xmlChar* XMLCALL xmlSaveUri ( xmlURIPtr  uri)

xmlSaveUri: : pointer to an xmlURI

Save the URI as an escaped string

Returns a new string (to be deallocated by caller)

XMLPUBFUN xmlChar* XMLCALL xmlURIEscape ( const xmlChar str)

xmlURIEscape: : the string of the URI to escape

Escaping routine, does not do validity checks ! It will try to escape the chars needing this, but this is heuristic based it's impossible to be sure.

Returns an copy of the string, but escaped

25 May 2001 Uses xmlParseURI and xmlURIEscapeStr to try to escape correctly according to RFC2396.

  • Carl Douglas
XMLPUBFUN xmlChar* XMLCALL xmlURIEscapeStr ( const xmlChar str,
const xmlChar list 
)

xmlURIEscapeStr: : string to escape : exception list string of chars not to escape

This routine escapes a string to hex, ignoring reserved characters (a-z) and the characters in the exception list.

Returns a new escaped string or NULL in case of error.

XMLPUBFUN char* XMLCALL xmlURIUnescapeString ( const char *  str,
int  len,
char *  target 
)

xmlURIUnescapeString: : the string to unescape : the length in bytes to unescape (or <= 0 to indicate full string) : optional destination buffer

Unescaping routine, but does not check that the string is an URI. The output is a direct unsigned char translation of XX values (no encoding) Note that the length of the result can only be smaller or same size as the input string.

Returns a copy of the string, but unescaped, will return NULL only in case of error

 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'