package frama-c

  1. Overview
  2. Docs

doc/frama-c.kernel/Frama_c_kernel/Rich_text/Buffer/index.html

Module Rich_text.Buffer

val create : ?indent:int -> ?margin:int -> unit -> buffer

Create a buffer.

The right-margin is set to ~margin and maximum indentation to ~indent. Default values are those of Format.make_formatter, which are ~indent:68 and ~margin:78 in OCaml 4.05.

val reset : buffer -> unit

Reset the buffer to its initial empty state.

val contents : ?trim:bool -> buffer -> t

Buffer contents, with its semantic tags.

  • parameter trim

    if set to true, remove leading and trailing whitespaces (including tabulations, line feed and carriage returns)

val add_char : buffer -> char -> unit

Buffer-like

val add_string : buffer -> string -> unit

Buffer-like

Buffer-like

val add_substring : buffer -> string -> int -> int -> unit

Buffer-like

Buffer-like

val bprintf : buffer -> ('a, Format.formatter, unit) format -> 'a

Pretty printing into the buffer. Similar to Format.fprintf.

val kbprintf : (Format.formatter -> 'a) -> buffer -> ('b, Format.formatter, unit, 'a) format4 -> 'b

Same as bprintf above, but instead of returning immediately, passes a formatter to the continuation given as first argument at the end of printing.