diff --git a/src/libraries/utils/filepath.ml b/src/libraries/utils/filepath.ml index 3689f5a2ef24f4fb75fffb52e171919c0f9f1b91..959969454f5dc529b6b9a3b84eeaf984e2719532 100644 --- a/src/libraries/utils/filepath.ml +++ b/src/libraries/utils/filepath.ml @@ -278,6 +278,9 @@ module Normalized = struct let of_string ?existence ?base_name s = normalize ?existence ?base_name s let concat ?existence t s = normalize ?existence (t ^ "/" ^ s) + let concats ?existence t sl = + let s' = List.fold_left (fun acc s -> acc ^ "/" ^ s) "" sl in + normalize ?existence (t ^ s') let to_pretty_string s = pretty s let to_string_list l = l let equal : t -> t -> bool = (=) diff --git a/src/libraries/utils/filepath.mli b/src/libraries/utils/filepath.mli index 451937d4da7487ce520fa3fd0f9ffd9f64eb59c2..0813cca428b53f3175dc0e53508a9175e8b8d034 100644 --- a/src/libraries/utils/filepath.mli +++ b/src/libraries/utils/filepath.mli @@ -82,6 +82,14 @@ module Normalized: sig *) val concat: ?existence:existence -> t -> string -> t + (** + [concats ~existence dir paths] concatenates a list of paths, as per + the [concat] function. + + @since Frama-C+dev + *) + val concats: ?existence:existence -> t -> string list -> t + (** [to_pretty_string p] returns [p] prettified, that is, a relative path-like string. Note that this prettified string may contain symbolic dirs and is thus