package apero-core

  1. Overview
  2. Docs
type t
val of_string : string -> t

of_string s returns s as a Path if it's valid. Otherwise it raises an Exception. Note that the Path's string is sanitized (i.e. it's trimmed meaningless '/' are removed)

val of_string_opt : string -> t option

of_string s returns s as a Path if it's valid. Otherwise it raises an Exception. Note that the Path's string is sanitized (i.e. it's trimmed meaningless '/' are removed)

of_string_opt s returns Some p if s is a valid path. Otherwise returns None. Note that the Path's string is sanitized (i.e. it's trimmed and meaningless '/' are removed)

val to_string : t -> string

of_string_opt s returns Some p if s is a valid path. Otherwise returns None. Note that the Path's string is sanitized (i.e. it's trimmed and meaningless '/' are removed)

to_string path returns the path as a string.

val length : t -> int

length p returns the number of characters of path p

val compare : t -> t -> int

length p returns the number of characters of path p

The comparison function for paths, with the same specification as Pervasives.compare

val equal : t -> t -> bool

The comparison function for paths, with the same specification as Pervasives.compare

The equal function for paths.

val is_relative : t -> bool

is_relative p return true if the Path p is relative (i.e. it's first character is not '/')

val add_prefix : prefix:t -> t -> t

is_relative p return true if the Path p is relative (i.e. it's first character is not '/')

add_prefix prefix p return a new Path made of prefix/p

val is_prefix : affix:t -> t -> bool

add_prefix prefix p return a new Path made of prefix/p

is_prefix affix p returns true if affix is a prefix of p

val remove_prefix : int -> t -> t

is_prefix affix p returns true if affix is a prefix of p

remove_prefix l p removes the l first characters from Path p and returns the remaining as a non-absolute Path