Skip to content
Snippets Groups Projects
Commit 9e2f1e93 authored by Andre Maroneze's avatar Andre Maroneze
Browse files

[Filepath] add Normalized.concats

parent 7979b5b9
No related branches found
No related tags found
No related merge requests found
...@@ -278,6 +278,9 @@ module Normalized = struct ...@@ -278,6 +278,9 @@ module Normalized = struct
let of_string ?existence ?base_name s = normalize ?existence ?base_name s let of_string ?existence ?base_name s = normalize ?existence ?base_name s
let concat ?existence t s = normalize ?existence (t ^ "/" ^ 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_pretty_string s = pretty s
let to_string_list l = l let to_string_list l = l
let equal : t -> t -> bool = (=) let equal : t -> t -> bool = (=)
......
...@@ -82,6 +82,14 @@ module Normalized: sig ...@@ -82,6 +82,14 @@ module Normalized: sig
*) *)
val concat: ?existence:existence -> t -> string -> t 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, (** [to_pretty_string p] returns [p] prettified,
that is, a relative path-like string. that is, a relative path-like string.
Note that this prettified string may contain symbolic dirs and is thus Note that this prettified string may contain symbolic dirs and is thus
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment