package orsetto
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=bb2af4d8b376b2d60fa996bd4d3b90d9f3559455672540f6d7c3598af81d483b
md5=f7bfa83013801b42fcdba607af2f012b
doc/orsetto.cf/Cf_uri/index.html
Module Cf_uri
General syntax of the Uniform Resource Identifier (URI)
Overview
This module implements operations on the general syntax of Uniform Resource Identifiers (URI) according to RFC 3986, as well as convenience functions for manipulating their components. Some functions are also provided for conversion to and from strings for presentation.
Types
The private types below comprise the structure of generic URI values in syntax-normalized form (see RFC 3986, section 6.2.2).
The extensible sum type of "host" components of hierarchical URI's. Values of the cases of this type defined in this module are syntax-normalized. In particular, the ASCII letter characters present in "scheme" and "host" components are always lower case (except for the 'zoneid' field in IPv6 addresses).
Host name (RFC 3986).
IPv4 address literal (RFC 3986)
IPv6 address literal with optional zone identifier (RFC 3986,6874)
Future IP address literal (RFC 3986)
class type virtual basis = object ... endThe virtual class type inherited by all URI subtypes.
class type relative = object ... endThe class type of relative URI references.
class type absolute = object ... endThe class type of absolute URI bases.
class type generic = object ... endThe class type of generic URI.
The private higher-order type of URI object containers.
The private type of URI references.
Scanners
These functions comprise a parser for the generic URI syntax defined in RFC 3986 (updated by errata and by RFC 6874).
Fields containing percent-encoded text are decoded first, then other syntax normalization functions are applied, e.g. case normalization, path segment list normalization, et cetera.
val scan_registry_name : string Cf_scan.ASCII.tUse scan_registry_name to scan the "registry name" part of a host.
val scan_ipv4_address : string Cf_scan.ASCII.tUse scan_ipv4_address to scan an IPv4 address literal.
val scan_ipv6_address : string Cf_scan.ASCII.tUse scan_ipv6_address to scan an IPv6 address literal.
val scan_host : host Cf_scan.ASCII.tUse scan_host to scan the "host" part of a URI authority.
val scan_authority : authority Cf_scan.ASCII.tUse scan_authority to scan the "authority" part of a URI hierarchy.
val scan_generic : t Cf_scan.ASCII.tUse scan_generic to scan a generic URI.
val scan_reference : reference Cf_scan.ASCII.tUse scan_reference to scan a URI reference.
val of_string : string -> tUse of_string s to decompose s into its URI structural value. Raises Invalid_argument if s is not valid generic URI syntax.
Emitters
These functions comprise a formatter that conforms to the generic URI syntax defined in RFC 3986 (updated by errata and by RFC 6874).
Unreserved characters are not percent-encoded. Reserved characters are only percent-encoded when the fields in which they appear are delimited by them.
val emit_host : host Cf_emit.To_buffer.tUse emit_host b name to emit the "host" part of a URI authority.
val emit_authority : authority Cf_emit.To_buffer.tUse emit_authority b authority to emit the "authority" part of a URI hierarchy.
val emit_generic : t Cf_emit.To_buffer.tUse emit_generic b uri to emit a generic URI.
val emit_reference : reference Cf_emit.To_buffer.tUse emit_reference b reference to emit a URI reference.
val to_string : t -> stringUse to_string uri to compose uri into its textual form.
Miscellaneous Functions
Use resolve_aux b r to resolve r according to the base b.
Use percent_decode s to transform the sequence s by decoding all the "percent-encoded" characters. Evaluation raises Failure if a '%' character appears without two hexadecimal digits immediately following.
Use percent_encode ?allow s to transform the sequence s into the equivalent "percent-encoded" sequence. Use ~allow to provide a function that returns true for those reserved characters to be left decoded in the resulting sequence. Unreserved characters are never percent encoded.