package chamo

  1. Overview
  2. Docs

Generic bookmark system.

type 'a bookmarks
val create_from_ocf_wrappers : ?doc:string -> 'a Ocf.wrapper -> 'a bookmarks

create_from_ocf_wappers wrappers create a bookmarks structure. The given wrappers are used to store the data of bookmarks in a formatted file.

  • parameter doc

    can be used to describe the bookmarks in the file.

val create : ?doc:string -> (string -> 'a) -> ('a -> string) -> 'a bookmarks

Same as create_from_ocf_wrappers, the wrappers being built from the given data_of_string and string_of_data functions.

val get : 'a bookmarks -> string -> 'a

get bk name retrieve the data associated to the given name.

  • raises Not_found

    if no data is associated to the given name.

val set : 'a bookmarks -> string -> 'a -> unit

set bk name data creates or modify a bookmark by associating the given data to the given name.

val remove : 'a bookmarks -> string -> unit

remove bk name removes the bookmarks with the given name.

val list : 'a bookmarks -> (string * 'a) list

list bk returns all the bookmarks as a list of (name, data).

val store : 'a bookmarks -> string -> unit

store bk file stores the bookmarks bk in the given file.

  • raises Sys_error

    if an error occurs while storing the file.

val load : 'a bookmarks -> string -> unit

load bk file loads fills the bookmarks structure bk from the given file. All previous bookmarks in the structure are removed.

  • raises Sys_error

    if an error occurs while reading the file.

OCaml

Innovation. Community. Security.