package ocp-ocamlres

  1. Overview
  2. Docs

Module OCamlRes.PathSource

Paths inside resource stores.

Sourcetype t = dirs * name option

A path is a list of directory names and optionally a file name which is itself decomposed into a basename and an optional extension.

Sourceand dirs = string list
Sourceand name = string * ext option
Sourceand ext = string
Sourceval split_ext : string -> string * ext option

Splits the part before and after the first dot after the last slash (if any).

Sourceval split_base : string -> string * string option

Splits the part before and after the last slash (if any).

Sourceval split_dirs : string -> dirs

Splits a string using slashes as separator.

Sourceval shorten : t -> t

Applies ".."s and drops prefix ".."s and "."s.

Sourceval name_of_string : string -> name

Alias for split_ext.

Sourceval string_of_name : name -> string

Inverse of split_ext.

Sourceval of_string : string -> t

Turns a Unix-like path string into a t.

Sourceval to_string : t -> string

Turns a t into a Unix-like formatted path string.

OCaml

Innovation. Community. Security.