Module Cam_misc (.ml)


module Cam_misc: sig .. end
Utils

val map_opt : ('a -> 'b) -> 'a option -> 'b option
val chop_n_char : int -> string -> string
val my_int_of_string : string -> int
Same as int_of_string but support strings beginning with '+'.
val list_remove_doubles : ?pred:('a -> 'a -> bool) -> 'a list -> 'a list
list_remove_doubles ?pred l remove doubles in the given list l, according to the optional equality function pred. Default equality function is (=).
Author(s): Maxence Guesdon
Version: 1.0
val add_shortcut : < connect : < destroy : callback:(unit -> unit) -> GtkSignal.id; .. >;
event : GObj.event_ops; get_oid : int; .. > ->
(string * ((unit -> bool) option * (unit -> unit))) list ->
(Okey.modifier list * Gdk.keysym) * string -> unit
val file_of_string : file:string -> string -> unit
file_of_string ~file str creates a file named filename whose content is str.
Author(s): Fabrice Lefessant
Version: 1.1
Raises Sys_error if the file could not be opened.
val select_in_list : ?ok:string ->
?cancel:string ->
?allow_empty:bool ->
?value_in_list:bool ->
title:string -> choices:string list -> string -> string option
val remove_char : string -> char -> string
remove_char s c returns the given string s without character c.
val treat_gtk_events : unit -> unit
Handle all pending GTK events.
val get_wm_window_position_offset : unit -> int * int
Return the offset of position due to the window manager's decoration.
val subdirs : string -> string list
subdirs path returns the list of subdirectories of the given directory name. Returned names are relative to the given path.
Author(s): Maxence Guesdon
Version: 0.1
Raises Unix_error if an error occurs.
val line_of_char : string -> int -> int
line_of_char file char gets the line number (0-based) in a file from a character number.
val replace_in_string : pat:string -> subs:string -> s:string -> string
replace_in_string ~pat ~subs ~s replaces all occurences of pattern pat by subs in string s.
Author(s): Maxence Guesdon
Version: 1.0
val escape_menu_label : string -> string
escape_menu_label string returns a the string where all '_' have been escaped to be displayed correctly in Lablgtk menus.
val utf8_index_of_char : string -> int -> int
utf8_index_of_char string n returns the position of the first byte the nth character in the given UTF-8 string.
Raises Not_found if there is no such character.
val utf8_char_of_index : string -> int -> int
utf8_char_of_index string i returns the number of characters found from the beginning of the UTF-8 string to position i (included).
Raises Invalid_argument if the given position is out of the string bounds.
val utf8_string_length : string -> int
utf8_string_length string returns the number of utf8 characters in the given string.
val utf8_char_of_code : int -> string
utf8_char_of_code code returns the string representing the UTF-8 character with the given code.
Raises Failure if the code is out of range. Only 4 bytes UTF-8 is supported by now.