package iri

  1. Overview
  2. Docs

Module IriSource

Sourcetype error
Sourceexception Error of error
Sourceval string_of_error : error -> string
Sourcemodule KV : Map.S with type key = string
Sourcetype query_kv = string KV.t
Sourcetype path =
  1. | Absolute of string list
  2. | Relative of string list
Sourcetype t
Sourceval iri : ?scheme:string -> ?user:string -> ?host:string -> ?port:int -> ?path:path -> ?query_kv:query_kv -> ?query:string -> ?fragment:string -> unit -> t
  • parameter query

    is %-encoded

  • parameter query_kv

    is %-decoded

Sourcemodule Set : Set.S with type elt = t
Sourcemodule Map : Map.S with type key = t
Sourceval is_absolute : t -> bool

true if fragment is None and scheme is not empty.

Sourceval is_relative : t -> bool

true is scheme is empty.

Sourceval compare : ?normalize:bool -> t -> t -> int
  • parameter normalize

    default is false.

Sourceval equal : ?normalize:bool -> t -> t -> bool
  • parameter normalize

    default is false.

Sourceval of_string : ?pctdecode:bool -> ?pos:Lexing.position -> ?normalize:bool -> string -> t

Read an IRI from the given string.

  • parameter normalize

    tells whether to normalize to IRI or not. Default is false when IRI is relative (has no scheme) or true overwise.

  • parameter decode

    tells whether to %-decode strings or not; default is true.

Sourceval to_string : ?pctencode:bool -> t -> string

Return a string representation of the given IRI.

  • parameter pctencode

    is true by default.

Sourceval pp : Format.formatter -> t -> unit

Print the given IRI to the given formatter, using to_string ?pctencode:None.

Sourceval scheme : t -> string
Sourceval with_scheme : t -> string -> t
Sourceval user : t -> string option
Sourceval with_user : t -> string option -> t
Sourceval host : t -> string option
Sourceval with_host : t -> string option -> t
Sourceval port : t -> int option
Sourceval with_port : t -> int option -> t
Sourceval path : t -> path
Sourceval with_path : t -> path -> t
Sourceval path_string : ?pctencode:bool -> t -> string
  • parameter encode

    indicate whether the path elements must be encoded. Default is false.

Sourceval append_path : t -> string list -> t

Append the given (not %-encoded) string list to the path of the given iri and return a new iri with this path.

Sourceval query : t -> string option

Query string is not %-decoded as it is not parsed to name/value pairs

Sourceval query_kv : t -> query_kv

Key/value pairs from the query string. strings are %-decoded.

Sourceval with_query : t -> string option -> t

Return a new iri with the given optional query string. This string must already be %-encoded.

Sourceval with_query_kv : t -> query_kv -> t

Return a new iri with the given list of key/value pairs. The givn string must be %-decoded.

Sourceval query_get : t -> string -> string
Sourceval query_opt : t -> string -> string option
Sourceval query_set : t -> string -> string -> t
Sourceval fragment : t -> string option
Sourceval with_fragment : t -> string option -> t
Sourceval normalize : ?nfkc:bool -> t -> t
Sourceval resolve : ?normalize:bool -> base:t -> t -> t
  • parameter normalize

    tells whether to apply normalization after resolution. Default is true.

Sourceval to_uri : t -> string

Return a correctly pct-encoded URI as a string, from the given IRI.

OCaml

Innovation. Community. Security.