Module Mpd.Utils

val remove_trailing_new_line : string -> string

Remove new line char at the end of a string.

val remove_new_lines : string -> string

Remove all new line characters in a string.

val split_lines : string -> string list

Split multiline string into a list of strings

type item_id =
| Simple of int
| Num_on_num of int * int

Type that can save the id of an element which can be an int or two int

val num_on_num_parse : string -> item_id

Split string like "8/14" to 8 and 14, returns (-1, -1) if it fails. * is used in track and disc tab of the song data

type pair = {
key : string;
value : string;
}

Create a type used when splitting a line which has the form key: value . * This type is used by Mpd.Utils.read_key_val.

val read_key_val : string -> pair

Split a line with the form "k: v" in the value of type pair

val values_of_pairs : string list -> string list

Returns all the values of a list of strings that have the key/value form.

val bool_of_int_str : string -> bool

Get a boolean value from a string number. The string "0" is false while all * other string is true.

val read_file_paths : string -> string list

Get the file path from the ouput of the command "listplaylist name"

val read_list_playlists : string -> string list

Get playlists list from output of the command "listplaylists".

exception EMusic_database of string
val parse_count_response : string -> string option -> (int * float * string) list

Get the count list from the Mpd count command.

val print_data : string -> unit
val print_data_lwt : string -> unit Lwt.t