]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/interface/uriManager.ml.implementazione_banale
Initial revision
[helm.git] / helm / interface / uriManager.ml.implementazione_banale
diff --git a/helm/interface/uriManager.ml.implementazione_banale b/helm/interface/uriManager.ml.implementazione_banale
new file mode 100644 (file)
index 0000000..cd0d71f
--- /dev/null
@@ -0,0 +1,18 @@
+type uri = string;;
+
+let eq uri1 uri2 =
+ uri1 = uri2
+;;
+
+let string_of_uri uri = uri;;
+let uri_of_string str = str;;
+
+let name_of_uri uri =
+ let l = Str.split (Str.regexp "/") uri in
+  let name_suf = List.nth l (List.length l - 1) in
+   List.hd (Str.split (Str.regexp "\.") name_suf)
+;;
+
+let depth_of_uri uri =
+ List.length (Str.split (Str.regexp "/") uri) - 2
+;;