X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Futils.mli;h=5fabcfb9b1d8e5fe6e114ed6ba17b68d999d1d12;hb=3ed50d510dbab127125a8af9f72554c2dec72ef5;hp=0f6175140bac7e92577893c841365aea961cf71a;hpb=3e80e1ab9b032346a0961c3e925f1ef8adca1cc3;p=goals.git diff --git a/src/utils.mli b/src/utils.mli index 0f61751..5fabcfb 100644 --- a/src/utils.mli +++ b/src/utils.mli @@ -20,6 +20,12 @@ val failwithf : ('a, unit, string, 'b) format4 -> 'a (** Like [failwith] but supports printf-like arguments. *) +val (//) : string -> string -> string +(** The {!Filename.concat} function. *) + +val is_directory : string -> bool +(** Return true iff parameter is a directory. *) + val filter_map : ('a -> 'b option) -> 'a list -> 'b list (** [filter_map f l] applies [f] to every element of [l], filters out the [None] elements and returns the list of the arguments of @@ -28,3 +34,12 @@ val filter_map : ('a -> 'b option) -> 'a list -> 'b list val string_find : string -> string -> int (** [string_find str sub] finds the index of [sub] in [str]. If not found, returns -1. *) + +val isspace : char -> bool +val triml : ?test:(char -> bool) -> string -> string +val trimr : ?test:(char -> bool) -> string -> string +val trim : ?test:(char -> bool) -> string -> string +(** Trim strings at left, right or both. *) + +val absolute_path : string -> string +(** Convert any path into an absolute path. *)