package ocp-ocamlres

  1. Overview
  2. Docs

Module OCamlResFormatsSource

Formatters for the main resource tree structure

Sourcemodule type Format = sig ... end

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

Sourcetype 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.

Sourcetype 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.

Sourcetype 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).

OCaml

Innovation. Community. Security.