package ocp-ocamlres

  1. Overview
  2. Docs

Formatters for the main resource tree structure

module type Format = sig ... end

Format modules essentially wrap an output function which takes a resource tree as input and produces an output.

type ocaml_format_params = {
  1. width : int;
    (*

    Maximum line width

    *)
  2. out_channel : out_channel;
    (*

    Specify the output

    *)
}

See OCaml

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 = {
  1. width : int;
    (*

    Maximum line width

    *)
  2. out_channel : out_channel;
    (*

    Specify the output

    *)
  3. use_variants_for_leaves : bool;
    (*

    If true, box resources in variants, if false, use an ad-hoc sum type

    *)
  4. use_variants_for_nodes : bool;
    (*

    Use variants instead of constructors from 'a OCamlRes.Res.node, to make linking to the OCamlRes module optional.

    *)
}

See Res

Produces OCaml source contaiming a single root value which contains an OCamlRes tree to be used at runtime through the OCamlRes module.

type files_format_params = {
  1. base_output_dir : string;
    (*

    The root in the filesystem for the extraction

    *)
}

See Files

Reproduces the original scanned files (or creates new ones in case of a forged resource store).