package ocp-ocamlres
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=658c2990e027e1e43a16290fd431f08c96b8630d91ac2b98003a9bc027179679
md5=725eb557e659c6febf8dc3044b323bd8
doc/ocplib-ocamlres/OCamlResFormats/index.html
Module OCamlResFormats
Source
Formatters for the main resource tree structure
Format modules essentially wrap an output function which takes a resource tree as input and produces an output.
type ocaml_format_params = {
width : int;
(*Maximum line width
*)out_channel : out_channel;
(*Specify the output
*)
}
See OCaml
module OCaml
(SF : OCamlResSubFormats.SubFormat) :
Format with type data = SF.t and type params = ocaml_format_params
This format produces OCaml source code with OCaml submodules for directories and OCaml value definitions for files. It is parametric in the type of leaves and the pretty printing function. It is used by the command line tool as instanciated in OCamlResRegistry
.
type res_format_params = {
width : int;
(*Maximum line width
*)out_channel : out_channel;
(*Specify the output
*)use_variants_for_leaves : bool;
(*If
*)true
, box resources in variants, iffalse
, use an ad-hoc sum typeuse_variants_for_nodes : bool;
(*Use variants instead of constructors from
*)'a OCamlRes.Res.node
, to make linking to theOCamlRes
module optional.
}
See Res
module Res
(SF : OCamlResSubFormats.SubFormat) :
Format with type data = SF.t and type params = res_format_params
Produces OCaml source contaiming a single root
value which contains an OCamlRes tree to be used at runtime through the OCamlRes module.
module Files
(SF : OCamlResSubFormats.SubFormat) :
Format with type data = SF.t and type params = files_format_params
Reproduces the original scanned files (or creates new ones in case of a forged resource store).