Gtk2HsContentsIndex
System.Gnome.VFS.URI
Maintainergtk2hs-devel@lists.sourceforge.net Stability : alpha Portability : portable (depends on GHC)
Contents
Types
Operations
Description
Synopsis
data URI
data ToplevelURI
type TextURI = String
data URIHideOptions
= URIHideNone
| URIHideUserName
| URIHidePassword
| URIHideHostName
| URIHideHostPort
| URIHideToplevelMethod
| URIHideFragmentIdentifier
uriFromString :: TextURI -> Maybe URI
uriResolveRelative :: URI -> String -> Maybe URI
uriResolveSymbolicLink :: URI -> String -> Maybe URI
uriAppendString :: URI -> String -> Maybe URI
uriAppendPath :: URI -> FilePath -> Maybe URI
uriAppendFileName :: URI -> FilePath -> Maybe URI
uriToString :: URI -> URIHideOptions -> TextURI
uriIsLocal :: URI -> IO Bool
uriHasParent :: URI -> Bool
uriGetParent :: URI -> Maybe URI
uriGetToplevel :: URI -> ToplevelURI
uriGetHostName :: URI -> Maybe String
uriGetScheme :: URI -> Maybe String
uriGetHostPort :: URI -> Word
uriGetUserName :: URI -> Maybe String
uriGetPassword :: URI -> Maybe String
uriSetHostName :: URI -> Maybe String -> URI
uriSetHostPort :: URI -> Word -> URI
uriSetUserName :: URI -> Maybe String -> URI
uriSetPassword :: URI -> Maybe String -> URI
uriEqual :: URI -> URI -> Bool
uriIsParent :: URI -> URI -> Bool -> Bool
uriGetPath :: URI -> Maybe FilePath
uriGetFragmentIdentifier :: URI -> Maybe String
uriExtractDirname :: URI -> Maybe FilePath
uriExtractShortName :: URI -> String
uriExtractShortPathName :: URI -> String
uriListParse :: String -> [URI]
uriMakeFullFromRelative :: String -> String -> Maybe String
Types
data URI
A URI is a semi-textual representation of a uniform resource identifier. It contains the information about a resource location encoded as canononicalized text, but also holds extra information about the context in which the URI is used.
data ToplevelURI
The toplevel URI element used to access resources stored on a remote server.
type TextURI = String
A string that can be passed to uriFromString to create a valid URI.
data URIHideOptions
Flags specifying which fields of a URI should be hidden when converted to a string using uriToString.
Constructors
URIHideNone
URIHideUserName
URIHidePassword
URIHideHostName
URIHideHostPort
URIHideToplevelMethod
URIHideFragmentIdentifier
show/hide Instances
Operations
uriFromString :: TextURI -> Maybe URI
Create a new URI from textURI. Unsupported and unsafe methods are not allowed and will result in Nothing being returned. URL transforms are allowed.
uriResolveRelative
:: URIbase - the base URI
-> StringrelativeReference - a string representing a possibly relative URI reference
-> Maybe URIa new URI referring to relativeReference, or Nothing if relativeReference is malformed.

Create a new uri from relativeReference, relative to base. The resolution algorithm in some aspects follows RFC 2396, section 5.2, but is not identical due to some extra assumptions GnomeVFS makes about URIs.

If relative_reference begins with a valid scheme identifier followed by ':', it is assumed to refer to an absolute URI, and a URI is created from it using uriFromString.

Otherwise, depending on its precise syntax, it inherits some aspects of the parent URI, but the parents' fragment and query components are ignored.

If relative_reference begins with "//", it only inherits the base scheme; if it begins with '/' (i.e., it is an absolute path reference), it inherits everything except the base path. Otherwise, it replaces the part of base after the last '/'.

Note: This function should not be used by application authors unless they expect very distinct semantics. Instead, authors should use uriAppendFileName, uriAppendPath, uriAppendString or uriResolveSymbolicLink.

uriResolveSymbolicLink :: URI -> String -> Maybe URI

Create a new uri from symbolicLink, relative to base.

If symbolic_link begins with a '/', it replaces the path of base, otherwise it is appended after the last '/' character of base.

uriAppendString
:: URIuri - the base URI
-> StringuriFragment - an escaped URI fragment
-> Maybe URIthe new URI

Create a new URI obtained by appending uriFragment to uri. This will take care of adding an appropriate directory separator between the end of uri and the start of uriFragment if necessary.

This function will return Nothing if the resulting URI is not valid.

uriAppendPath
:: URIuri - the base URI
-> FilePathpath - a non-escaped file path
-> Maybe URIthe new URI

Create a new uri obtained by appending path to uri. This will take care of adding an appropriate directory separator between the end of uri and the start of path if necessary, as well as escaping path as necessary.

This function will return Nothing if the resulting URI is not valid.

uriAppendFileName :: URI -> FilePath -> Maybe URI

Create a new URI obtained by appending fileName to uri. This will take care of adding an appropriate directory separator between the end of uri and the start of fileName if necessary. fileName might, for instance, be the result of a call to readDirStream.

This function will return Nothing if the resulting URI is not valid.

uriToString
:: URIuri - a URI
-> URIHideOptionshideOptions - the URI elements that should not be included in the resulting string
-> TextURIthe resulting string

Translate uri into a printable string. The string will not contain the URI elements specified by hideOptions.

A file: URI on Win32 might look like file:///x:/foo/bar.txt. Note that the part after file:// is not a legal file name, you need to remove the / in front of the drive letter. This function does that automatically if hideOptions specifies that the toplevel method, user name, password, host name and host port should be hidden.

On the other hand, a file: URI for a UNC path looks like file:////server/share/foo/bar.txt, and in that case the part after file:// is the correct file name.

uriIsLocal
:: URIuri -
-> IO BoolTrue if uri is local, False otherwise

Check if uri is a local URI. Note that the return value of this function entirely depends on the method associated with the URI. It is up to the method author to distinguish between remote URIs and URIs referring to entities on the local computer.

Warning, this can be slow, as it does I/O to detect things like NFS mounts.

uriHasParent
:: URIuri -
-> BoolTrue if uri has a parent, False otherwise
Check whether uri has a parent or not.
uriGetParent
:: URIuri -
-> Maybe URIthe parent URI, or Nothing if uri has no parent
Retrieve uri's parent URI.
uriGetToplevel
:: URIuri -
-> ToplevelURIthe toplevel URI
Retrieve uri's toplevel URI.
uriGetHostName
:: URIuri -
-> Maybe Stringthe hostname, or Nothing if uri has no hostname
Retrieve the hostname for uri.
uriGetScheme
:: URIuri -
-> Maybe Stringthe scheme, or Nothing if uri has no scheme
Retrieve the scheme for uri.
uriGetHostPort
:: URIuri -
-> Wordthe host port, or 0 if the default port value for the specified toplevel access method is used
Retrieve the host port for uri.
uriGetUserName
:: URIuri -
-> Maybe Stringthe user name, or Nothing if uri has no user name
Retrieve the user name for uri.
uriGetPassword
:: URIuri -
-> Maybe Stringthe password, or Nothing if uri has no password
Retrieve the password for uri.
uriSetHostName
:: URIuri -
-> Maybe StringhostName - the new hostname
-> URIthe resulting URI
Create a new URI using uri, replacing the host name by hostName.
uriSetHostPort
:: URIuri -
-> WordhostPort - the new host port
-> URIthe resulting URI

Create a new URI using uri, replacing the host port by hostPort.

If hostPort is 0, use the default port for uri's toplevel access method.

uriSetUserName
:: URIuri -
-> Maybe StringuserName - the new user name
-> URIthe resulting URI
Create a new URI using uri, replacing the user name by userName.
uriSetPassword
:: URIuri -
-> Maybe Stringpassword - the new password
-> URIthe resulting URI
Create a new URI using uri, replacing the password by password.
uriEqual
:: URIa -
-> URIb -
-> BoolTrue if the URIs are the same, False otherwise.
Compare two URIs for equality.
uriIsParent
:: URIpossibleParent -
-> URIpossibleChild -
-> Boolrecursive - True if parents should be checked recursively, False otherwise
-> BoolTrue if possibleChild is contained in possibleParent, otherwise False
Check if possibleChild is contained in possibleParent. If recursive is False, just try the immediate parent; otherwise search up through the heirarchy.
uriGetPath
:: URIuri -
-> Maybe FilePaththe path name, or Nothing if uri has no path name
Retrieve the path name for uri.
uriGetFragmentIdentifier
:: URIuri -
-> Maybe Stringthe fragment identifier, or Nothing if uri has no fragment identifier
Retrieve the fragment identifier for uri.
uriExtractDirname
:: URIuri -
-> Maybe FilePaththe directory name, or Nothing if uri has no directory name
Extract the name of the directory in which the file pointed to by uri is stored as a string. The string will end with a directory separator.
uriExtractShortName
:: URIuri -
-> String

Retrieve base file name for uri, ignoring any trailing path separators. This matches the XPG definition of basename, but not basename. This is often useful when you want the name of something that's pointed to by a URI, and don't care whether the uri has a directory or file form. If uri points to the root of a domain, returns the host name. If there's no host name, returns the path separator.

See also: uriExtractShortPathName.

uriExtractShortPathName
:: URIuri -
-> String

Retrieve base file name for uri, ignoring any trailing path separators. This matches the XPG definition of basename, but not basename. This is often useful when you want the name of something that's pointed to by a URI, and don't care whether the uri has a directory or file form. If uri points to the root of any domain, returns the path separator.

See also: uriExtractShortName.

uriListParse
:: StringuriList - a list of URIs, separated by newlines
-> [URI]the list of URIs
Extracts a list of URIs from a standard text/uri-list, such as one would get on a drop operation.
uriMakeFullFromRelative
:: StringbaseURI -
-> StringrelativeURI -
-> Maybe Stringthe resulting URI
Returns a full URI given a full base URI, and a secondary URI which may be relative.
Produced by Haddock version 0.8