package ocp-ocamlres

  1. Overview
  2. Docs

Module OCamlResSubFormats.IntSource

A probably useless subformat, for demonstration purposes

Sourcetype t = int

The generation-time intermediate representation of data.

Sourceval from_raw : OCamlRes.Path.t -> string -> t

A parser as used by the scanner to obtain the in-memory resources from files.

Sourceval to_raw : OCamlRes.Path.t -> t -> string

A dumper to reconstitute the files from the in-memory resources.

Sourceval pprint : OCamlRes.Path.t -> t -> PPrint.document

Takes the path to the resource in the resource tree, and its value to pretty print. Returns the OCaml representation of the value.

Sourceval pprint_header : OCamlRes.Path.t -> t -> PPrint.document option

Provides an optional piece of OCaml code to put before the resource store definition, for instance a type definition.

Provides an optional piece of OCaml code to put after the resource store definition, for instance a type definition.

Sourceval name : OCamlRes.Path.t -> t -> string

A name used to identify the subformat.

Sourceval type_name : OCamlRes.Path.t -> t -> string

The run-time OCaml type name (that describes the type of values generated by pprint). Used to annotate the generated source where needed. The common usecase is when this function returns the same type as the static t type.

Sourceval mod_name : OCamlRes.Path.t -> t -> string

The name of the subformat module at run-time. If the static type t is the same as the runtime type returned by type_abbrv, this is simply the path to the module used for generation.

OCaml

Innovation. Community. Security.