Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
Entry point for using GIO functionality.
- newtype Vfs = Vfs (ManagedPtr Vfs)
- class GObject o => IsVfs o
- toVfs :: IsVfs o => o -> IO Vfs
- noVfs :: Maybe Vfs
- vfsGetDefault :: (HasCallStack, MonadIO m) => m Vfs
- data VfsGetFileForPathMethodInfo
- vfsGetFileForPath :: (HasCallStack, MonadIO m, IsVfs a) => a -> Text -> m File
- data VfsGetFileForUriMethodInfo
- vfsGetFileForUri :: (HasCallStack, MonadIO m, IsVfs a) => a -> Text -> m File
- vfsGetLocal :: (HasCallStack, MonadIO m) => m Vfs
- data VfsGetSupportedUriSchemesMethodInfo
- vfsGetSupportedUriSchemes :: (HasCallStack, MonadIO m, IsVfs a) => a -> m [Text]
- data VfsIsActiveMethodInfo
- vfsIsActive :: (HasCallStack, MonadIO m, IsVfs a) => a -> m Bool
- data VfsParseNameMethodInfo
- vfsParseName :: (HasCallStack, MonadIO m, IsVfs a) => a -> Text -> m File
- data VfsRegisterUriSchemeMethodInfo
- vfsRegisterUriScheme :: (HasCallStack, MonadIO m, IsVfs a) => a -> Text -> Maybe VfsFileLookupFunc -> Maybe VfsFileLookupFunc -> m Bool
- data VfsUnregisterUriSchemeMethodInfo
- vfsUnregisterUriScheme :: (HasCallStack, MonadIO m, IsVfs a) => a -> Text -> m Bool
Exported types
Vfs (ManagedPtr Vfs) |
GObject Vfs Source # | |
IsObject Vfs Source # | |
IsVfs Vfs Source # | |
((~) * info (ResolveVfsMethod t Vfs), MethodInfo * info Vfs p) => IsLabel t (Vfs -> p) Source # | |
((~) * info (ResolveVfsMethod t Vfs), MethodInfo * info Vfs p) => IsLabelProxy t (Vfs -> p) Source # | |
HasAttributeList * Vfs Source # | |
type AttributeList Vfs Source # | |
type SignalList Vfs Source # | |
Methods
getDefault
:: (HasCallStack, MonadIO m) | |
=> m Vfs | Returns: a |
Gets the default Vfs
for the system.
getFileForPath
data VfsGetFileForPathMethodInfo Source #
((~) * signature (Text -> m File), MonadIO m, IsVfs a) => MethodInfo * VfsGetFileForPathMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsVfs a) | |
=> a |
|
-> Text |
|
-> m File | Returns: a |
Gets a File
for path
.
getFileForUri
data VfsGetFileForUriMethodInfo Source #
((~) * signature (Text -> m File), MonadIO m, IsVfs a) => MethodInfo * VfsGetFileForUriMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsVfs a) | |
=> a |
|
-> Text |
|
-> m File | Returns: a |
Gets a File
for uri
.
This operation never fails, but the returned object might not support any I/O operation if the URI is malformed or if the URI scheme is not supported.
getLocal
:: (HasCallStack, MonadIO m) | |
=> m Vfs | Returns: a |
Gets the local Vfs
for the system.
getSupportedUriSchemes
data VfsGetSupportedUriSchemesMethodInfo Source #
((~) * signature (m [Text]), MonadIO m, IsVfs a) => MethodInfo * VfsGetSupportedUriSchemesMethodInfo a signature Source # | |
vfsGetSupportedUriSchemes Source #
:: (HasCallStack, MonadIO m, IsVfs a) | |
=> a |
|
-> m [Text] | Returns: a |
Gets a list of URI schemes supported by vfs
.
isActive
data VfsIsActiveMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsVfs a) => MethodInfo * VfsIsActiveMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsVfs a) | |
=> a |
|
-> m Bool | Returns: |
Checks if the VFS is active.
parseName
data VfsParseNameMethodInfo Source #
((~) * signature (Text -> m File), MonadIO m, IsVfs a) => MethodInfo * VfsParseNameMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsVfs a) | |
=> a |
|
-> Text |
|
-> m File | Returns: a |
This operation never fails, but the returned object might
not support any I/O operations if the parseName
cannot
be parsed by the Vfs
module.
registerUriScheme
data VfsRegisterUriSchemeMethodInfo Source #
((~) * signature (Text -> Maybe VfsFileLookupFunc -> Maybe VfsFileLookupFunc -> m Bool), MonadIO m, IsVfs a) => MethodInfo * VfsRegisterUriSchemeMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsVfs a) | |
=> a |
|
-> Text |
|
-> Maybe VfsFileLookupFunc |
|
-> Maybe VfsFileLookupFunc |
|
-> m Bool | Returns: |
Registers uriFunc
and parseNameFunc
as the File
URI and parse name
lookup functions for URIs with a scheme matching scheme
.
Note that scheme
is registered only within the running application, as
opposed to desktop-wide as it happens with GVfs backends.
When a File
is requested with an URI containing scheme
(e.g. through
fileNewForUri
), uriFunc
will be called to allow a custom
constructor. The implementation of uriFunc
should not be blocking, and
must not call vfsRegisterUriScheme
or vfsUnregisterUriScheme
.
When fileParseName
is called with a parse name obtained from such file,
parseNameFunc
will be called to allow the File
to be created again. In
that case, it's responsibility of parseNameFunc
to make sure the parse
name matches what the custom File
implementation returned when
fileGetParseName
was previously called. The implementation of
parseNameFunc
should not be blocking, and must not call
vfsRegisterUriScheme
or vfsUnregisterUriScheme
.
It's an error to call this function twice with the same scheme. To unregister
a custom URI scheme, use vfsUnregisterUriScheme
.
Since: 2.50
unregisterUriScheme
data VfsUnregisterUriSchemeMethodInfo Source #
((~) * signature (Text -> m Bool), MonadIO m, IsVfs a) => MethodInfo * VfsUnregisterUriSchemeMethodInfo a signature Source # | |
vfsUnregisterUriScheme Source #
:: (HasCallStack, MonadIO m, IsVfs a) | |
=> a |
|
-> Text |
|
-> m Bool | Returns: |
Unregisters the URI handler for scheme
previously registered with
vfsRegisterUriScheme
.
Since: 2.50