|
@@ -13,9 +13,18 @@ data Parameter = Parameter String String deriving (Eq, Ord, Read, Show)
|
|
|
data URI = URI {account :: Account, path :: Path, revision :: Revision, parameters :: [Parameter]}
|
|
|
deriving (Eq, Ord)
|
|
|
|
|
|
+{- |
|
|
|
+Returns the entire path of the URI.
|
|
|
+-}
|
|
|
fullPath :: URI -> String
|
|
|
fullPath URI{path=Path p} = intercalate "/" $ map uriEncode p
|
|
|
|
|
|
+{- |
|
|
|
+Returns the entire path of the URI, except for the leading slash (/).
|
|
|
+-}
|
|
|
+relativePath :: URI -> String
|
|
|
+relativePath URI{path=Path p} = intercalate "/" . map uriEncode $ drop 1 p
|
|
|
+
|
|
|
fullURI :: URI -> String
|
|
|
fullURI u@(URI{account=a, revision=r, parameters=pp}) =
|
|
|
concat $ ["FCMTP://", s . fullAccount $ a, fullPath u] ++ (
|