Metadb.Path
A minimal library for manipulating typed representations of paths
val mk_root : string -> root
Constructor for creating a root path, if debug
is set to true, mk_root
will check that input is well-formed. Raise InvalidRootType
otherwise
val mk_rel : string -> rel
Constructor for creating a relative path, if debug
is set to true, mk_rel
will check that input is well-formed. Raise InvalidRelType
otherwise
val mk_name : string -> name
Constructor for creating a name, if debug
is set to true, mk_name
will check that input is well-formed. Raise InvalidNameType
otherwise
val string_of_root : root -> string
Convert a root path to a string
val string_of_rel : rel -> string
Convert a relative path to a string
val string_of_name : name -> string
Convert a name to a string
merge root names
is the same as merge
but a relative path is given as a list of names
add_file_ext ext path
wiil add the file extension ext
to the leaf of path
, that is path'.'ext
remove_file_ext ext path
removes the file extension from the file name
strip_root root path
will drop the initial substring root
from path
, thus inversing merge
hidden path
will return true if the leaf of path
is a hidden file, that is starts with '.'
val pp_root : Stdlib.Format.formatter -> root -> unit
Pretty print path
val pp_rel : Stdlib.Format.formatter -> rel -> unit