package ocp-ocamlres

  1. Overview
  2. Docs
Manipulation, injection and extraction of embedded resources

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.4.tar.gz
sha256=658c2990e027e1e43a16290fd431f08c96b8630d91ac2b98003a9bc027179679
md5=725eb557e659c6febf8dc3044b323bd8

doc/ocplib-ocamlres.runtime/OCamlRes/Res/index.html

Module OCamlRes.ResSource

Resource store creation and access.

Sourcetype 'a node =
  1. | Dir of string * 'a node list
  2. | File of string * 'a
  3. | Error of string

A resource: a directory of named sub-resources, a file, or an error token (useful to write more resilient treatments).

Sourcetype 'a root = 'a node list

A ressource store (a list of toplevel resources)

Sourceval merge : 'a root -> 'a root -> 'a root

Merges two resource stores

Sourceval find : Path.t -> 'a root -> 'a

Find a resource from its path or raise Not_found.

Sourceval find_dir : Path.t -> 'a root -> 'a root

Find a directory (as a root) from its path or raise Not_found.

Sourceval add : Path.t -> 'a -> 'a root -> 'a root

Build a new root with an added file.

Sourceval map : ('a -> 'b) -> 'a root -> 'b root

Transforms the data of a tee, potentially changing their type.

Sourceval add_prefix : Path.dirs -> 'a node -> 'a node

Add a prefix directory to a node.

OCaml

Innovation. Community. Security.