Module Ed_bookmarks (.ml)


module Ed_bookmarks: sig .. end
Generic bookmark system.

type 'a bookmarks 
val create_from_cf_wrappers : ?desc:string -> 'a Config_file.wrappers -> 'a bookmarks
create_from_cf_wappers wrappers create a bookmarks structure. The given wrappers are used to store the data of bookmarks in a formatted file.
desc : can be used to describe the bookmarks in the file.
val create : ?desc:string -> (string -> 'a) -> ('a -> string) -> 'a bookmarks
Same as Ed_bookmarks.create_from_cf_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.