Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
GI.Gio.Objects.FileOutputStream
Description
GFileOutputStream
provides output streams that write their
content to a file.
GFileOutputStream
implements Seekable
, which allows the output
stream to jump to arbitrary positions in the file and to truncate
the file, provided the filesystem of the file supports these
operations.
To find the position of a file output stream, use seekableTell
.
To find out if a file output stream supports seeking, use
seekableCanSeek
.To position a file output stream, use
seekableSeek
. To find out if a file output stream supports
truncating, use seekableCanTruncate
. To truncate a file output
stream, use seekableTruncate
.
Synopsis
- newtype FileOutputStream = FileOutputStream (ManagedPtr FileOutputStream)
- class (GObject o, IsDescendantOf FileOutputStream o) => IsFileOutputStream o
- toFileOutputStream :: (MonadIO m, IsFileOutputStream o) => o -> m FileOutputStream
- type family ResolveFileOutputStreamMethod (t :: Symbol) o where ...
- data FileOutputStreamGetEtagMethodInfo
- fileOutputStreamGetEtag :: (HasCallStack, MonadIO m, IsFileOutputStream a) => a -> m (Maybe Text)
- data FileOutputStreamQueryInfoMethodInfo
- fileOutputStreamQueryInfo :: (HasCallStack, MonadIO m, IsFileOutputStream a, IsCancellable b) => a -> Text -> Maybe b -> m FileInfo
- data FileOutputStreamQueryInfoAsyncMethodInfo
- fileOutputStreamQueryInfoAsync :: (HasCallStack, MonadIO m, IsFileOutputStream a, IsCancellable b) => a -> Text -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- data FileOutputStreamQueryInfoFinishMethodInfo
- fileOutputStreamQueryInfoFinish :: (HasCallStack, MonadIO m, IsFileOutputStream a, IsAsyncResult b) => a -> b -> m FileInfo
Exported types
newtype FileOutputStream Source #
Memory-managed wrapper type.
Constructors
FileOutputStream (ManagedPtr FileOutputStream) |
Instances
class (GObject o, IsDescendantOf FileOutputStream o) => IsFileOutputStream o Source #
Type class for types which can be safely cast to FileOutputStream
, for instance with toFileOutputStream
.
Instances
(GObject o, IsDescendantOf FileOutputStream o) => IsFileOutputStream o Source # | |
Defined in GI.Gio.Objects.FileOutputStream |
toFileOutputStream :: (MonadIO m, IsFileOutputStream o) => o -> m FileOutputStream Source #
Cast to FileOutputStream
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, canSeek, canTruncate, clearPending, close, closeAsync, closeFinish, flush, flushAsync, flushFinish, forceFloating, freezeNotify, getv, hasPending, isClosed, isClosing, isFloating, notify, notifyByPspec, queryInfo, queryInfoAsync, queryInfoFinish, ref, refSink, runDispose, seek, splice, spliceAsync, spliceFinish, stealData, stealQdata, tell, thawNotify, truncate, unref, watchClosure, write, writeAll, writeAllAsync, writeAllFinish, writeAsync, writeBytes, writeBytesAsync, writeBytesFinish, writeFinish, writev, writevAll, writevAllAsync, writevAllFinish, writevAsync, writevFinish.
Getters
getData, getEtag, getProperty, getQdata.
Setters
type family ResolveFileOutputStreamMethod (t :: Symbol) o where ... Source #
Equations
getEtag
data FileOutputStreamGetEtagMethodInfo Source #
Instances
(signature ~ m (Maybe Text), MonadIO m, IsFileOutputStream a) => OverloadedMethod FileOutputStreamGetEtagMethodInfo a signature Source # | |
Defined in GI.Gio.Objects.FileOutputStream Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo FileOutputStreamGetEtagMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Objects.FileOutputStream Methods |
fileOutputStreamGetEtag Source #
Arguments
:: (HasCallStack, MonadIO m, IsFileOutputStream a) | |
=> a |
|
-> m (Maybe Text) | Returns: the entity tag for the stream. |
Gets the entity tag for the file when it has been written. This must be called after the stream has been written and closed, as the etag can change while writing.
queryInfo
data FileOutputStreamQueryInfoMethodInfo Source #
Instances
(signature ~ (Text -> Maybe b -> m FileInfo), MonadIO m, IsFileOutputStream a, IsCancellable b) => OverloadedMethod FileOutputStreamQueryInfoMethodInfo a signature Source # | |
Defined in GI.Gio.Objects.FileOutputStream Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo FileOutputStreamQueryInfoMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Objects.FileOutputStream Methods |
fileOutputStreamQueryInfo Source #
Arguments
:: (HasCallStack, MonadIO m, IsFileOutputStream a, IsCancellable b) | |
=> a |
|
-> Text |
|
-> Maybe b |
|
-> m FileInfo | Returns: a |
Queries a file output stream for the given attributes
.
This function blocks while querying the stream. For the asynchronous
version of this function, see fileOutputStreamQueryInfoAsync
.
While the stream is blocked, the stream will set the pending flag
internally, and any other operations on the stream will fail with
IOErrorEnumPending
.
Can fail if the stream was already closed (with error
being set to
IOErrorEnumClosed
), the stream has pending operations (with error
being
set to IOErrorEnumPending
), or if querying info is not supported for
the stream's interface (with error
being set to IOErrorEnumNotSupported
). In
all cases of failure, Nothing
will be returned.
If cancellable
is not Nothing
, then the operation can be cancelled by
triggering the cancellable object from another thread. If the operation
was cancelled, the error IOErrorEnumCancelled
will be set, and Nothing
will
be returned.
queryInfoAsync
data FileOutputStreamQueryInfoAsyncMethodInfo Source #
Instances
(signature ~ (Text -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()), MonadIO m, IsFileOutputStream a, IsCancellable b) => OverloadedMethod FileOutputStreamQueryInfoAsyncMethodInfo a signature Source # | |
Defined in GI.Gio.Objects.FileOutputStream Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo FileOutputStreamQueryInfoAsyncMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Objects.FileOutputStream Methods |
fileOutputStreamQueryInfoAsync Source #
Arguments
:: (HasCallStack, MonadIO m, IsFileOutputStream a, IsCancellable b) | |
=> a |
|
-> Text |
|
-> Int32 |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Asynchronously queries the stream
for a FileInfo
. When completed,
callback
will be called with a AsyncResult
which can be used to
finish the operation with fileOutputStreamQueryInfoFinish
.
For the synchronous version of this function, see
fileOutputStreamQueryInfo
.
queryInfoFinish
data FileOutputStreamQueryInfoFinishMethodInfo Source #
Instances
(signature ~ (b -> m FileInfo), MonadIO m, IsFileOutputStream a, IsAsyncResult b) => OverloadedMethod FileOutputStreamQueryInfoFinishMethodInfo a signature Source # | |
Defined in GI.Gio.Objects.FileOutputStream Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo FileOutputStreamQueryInfoFinishMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Objects.FileOutputStream Methods |
fileOutputStreamQueryInfoFinish Source #
Arguments
:: (HasCallStack, MonadIO m, IsFileOutputStream a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m FileInfo | Returns: A |
Finalizes the asynchronous query started
by fileOutputStreamQueryInfoAsync
.