let buri_of_uri uri = uri.(Array.length uri - 3);;
let depth_of_uri uri = Array.length uri - 2;;
-(*CSC: ora e' diventato poco efficiente, migliorare *)
-let relative_depth curi uri cookingsno =
- let rec length_of_current_prefix l1 l2 =
- match (l1, l2) with
- (he1::tl1, he2::tl2) when he1 == he2 ->
- 1 + length_of_current_prefix tl1 tl2
- | (_,_) -> 0
- in
- depth_of_uri uri -
- length_of_current_prefix
- (Array.to_list (Array.sub curi 0 (Array.length curi - (2 + cookingsno))))
- (Array.to_list (Array.sub uri 0 (Array.length uri - 2)))
- (*CSC: vecchio codice da eliminare
- if eq curi uri then 0
- else
- depth_of_uri uri -
- length_of_current_prefix (Array.to_list curi) (Array.to_list uri)
- *)
-;;
-
module OrderedStrings =
struct
type t = string
val buri_of_uri : uri -> string (* base uri only *)
val depth_of_uri : uri -> int (* length of the path *)
-(* relative_depth curi uri cookingsno *)
-(* is the number of times to cook uri to use it when the current uri is curi *)
-(* cooked cookingsno times *)
-val relative_depth : uri -> uri -> int -> int
-
(* given an uri, returns the uri of the corresponding cic file, *)
(* i.e. removes the [.types][.ann] suffix *)
val cicuri_of_uri : uri -> uri