gi-gio
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gio.Objects.FileIOStream

Description

GFileIOStream provides I/O streams that both read and write to the same file handle.

GFileIOStream implements Seekable, which allows the I/O 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 I/O stream, use seekableTell.

To find out if a file I/O stream supports seeking, use seekableCanSeek. To position a file I/O stream, use seekableSeek. To find out if a file I/O stream supports truncating, use seekableCanTruncate. To truncate a file I/O stream, use seekableTruncate.

The default implementation of all the GFileIOStream operations and the implementation of Seekable just call into the same operations on the output stream.

Since: 2.22

Synopsis

Exported types

newtype FileIOStream Source #

Memory-managed wrapper type.

Instances

Instances details
Eq FileIOStream Source # 
Instance details

Defined in GI.Gio.Objects.FileIOStream

GObject FileIOStream Source # 
Instance details

Defined in GI.Gio.Objects.FileIOStream

ManagedPtrNewtype FileIOStream Source # 
Instance details

Defined in GI.Gio.Objects.FileIOStream

TypedObject FileIOStream Source # 
Instance details

Defined in GI.Gio.Objects.FileIOStream

Methods

glibType :: IO GType #

HasParentTypes FileIOStream Source # 
Instance details

Defined in GI.Gio.Objects.FileIOStream

HasAttributeList FileIOStream Source # 
Instance details

Defined in GI.Gio.Objects.FileIOStream

(info ~ ResolveFileIOStreamMethod t FileIOStream, OverloadedMethod info FileIOStream p, HasField t FileIOStream p) => HasField (t :: Symbol) FileIOStream (p :: Type) Source # 
Instance details

Defined in GI.Gio.Objects.FileIOStream

Methods

getField :: FileIOStream -> p #

(info ~ ResolveFileIOStreamMethod t FileIOStream, OverloadedMethodInfo info FileIOStream) => IsLabel t (MethodProxy info FileIOStream) Source # 
Instance details

Defined in GI.Gio.Objects.FileIOStream

(info ~ ResolveFileIOStreamMethod t FileIOStream, OverloadedMethod info FileIOStream p) => IsLabel t (FileIOStream -> p) Source # 
Instance details

Defined in GI.Gio.Objects.FileIOStream

Methods

fromLabel :: FileIOStream -> p #

IsGValue (Maybe FileIOStream) Source #

Convert FileIOStream to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gio.Objects.FileIOStream

type AttributeList FileIOStream Source # 
Instance details

Defined in GI.Gio.Objects.FileIOStream

type ParentTypes FileIOStream Source # 
Instance details

Defined in GI.Gio.Objects.FileIOStream

type SignalList FileIOStream Source # 
Instance details

Defined in GI.Gio.Objects.FileIOStream

class (GObject o, IsDescendantOf FileIOStream o) => IsFileIOStream o Source #

Type class for types which can be safely cast to FileIOStream, for instance with toFileIOStream.

Instances

Instances details
(GObject o, IsDescendantOf FileIOStream o) => IsFileIOStream o Source # 
Instance details

Defined in GI.Gio.Objects.FileIOStream

toFileIOStream :: (MonadIO m, IsFileIOStream o) => o -> m FileIOStream Source #

Cast to FileIOStream, for types for which this is known to be safe. For general casts, use castTo.

Methods

type family ResolveFileIOStreamMethod (t :: Symbol) o where ... Source #

Equations

ResolveFileIOStreamMethod "bindProperty" o = ObjectBindPropertyMethodInfo 
ResolveFileIOStreamMethod "bindPropertyFull" o = ObjectBindPropertyFullMethodInfo 
ResolveFileIOStreamMethod "canSeek" o = SeekableCanSeekMethodInfo 
ResolveFileIOStreamMethod "canTruncate" o = SeekableCanTruncateMethodInfo 
ResolveFileIOStreamMethod "clearPending" o = IOStreamClearPendingMethodInfo 
ResolveFileIOStreamMethod "close" o = IOStreamCloseMethodInfo 
ResolveFileIOStreamMethod "closeAsync" o = IOStreamCloseAsyncMethodInfo 
ResolveFileIOStreamMethod "closeFinish" o = IOStreamCloseFinishMethodInfo 
ResolveFileIOStreamMethod "forceFloating" o = ObjectForceFloatingMethodInfo 
ResolveFileIOStreamMethod "freezeNotify" o = ObjectFreezeNotifyMethodInfo 
ResolveFileIOStreamMethod "getv" o = ObjectGetvMethodInfo 
ResolveFileIOStreamMethod "hasPending" o = IOStreamHasPendingMethodInfo 
ResolveFileIOStreamMethod "isClosed" o = IOStreamIsClosedMethodInfo 
ResolveFileIOStreamMethod "isFloating" o = ObjectIsFloatingMethodInfo 
ResolveFileIOStreamMethod "notify" o = ObjectNotifyMethodInfo 
ResolveFileIOStreamMethod "notifyByPspec" o = ObjectNotifyByPspecMethodInfo 
ResolveFileIOStreamMethod "queryInfo" o = FileIOStreamQueryInfoMethodInfo 
ResolveFileIOStreamMethod "queryInfoAsync" o = FileIOStreamQueryInfoAsyncMethodInfo 
ResolveFileIOStreamMethod "queryInfoFinish" o = FileIOStreamQueryInfoFinishMethodInfo 
ResolveFileIOStreamMethod "ref" o = ObjectRefMethodInfo 
ResolveFileIOStreamMethod "refSink" o = ObjectRefSinkMethodInfo 
ResolveFileIOStreamMethod "runDispose" o = ObjectRunDisposeMethodInfo 
ResolveFileIOStreamMethod "seek" o = SeekableSeekMethodInfo 
ResolveFileIOStreamMethod "spliceAsync" o = IOStreamSpliceAsyncMethodInfo 
ResolveFileIOStreamMethod "stealData" o = ObjectStealDataMethodInfo 
ResolveFileIOStreamMethod "stealQdata" o = ObjectStealQdataMethodInfo 
ResolveFileIOStreamMethod "tell" o = SeekableTellMethodInfo 
ResolveFileIOStreamMethod "thawNotify" o = ObjectThawNotifyMethodInfo 
ResolveFileIOStreamMethod "truncate" o = SeekableTruncateMethodInfo 
ResolveFileIOStreamMethod "unref" o = ObjectUnrefMethodInfo 
ResolveFileIOStreamMethod "watchClosure" o = ObjectWatchClosureMethodInfo 
ResolveFileIOStreamMethod "getData" o = ObjectGetDataMethodInfo 
ResolveFileIOStreamMethod "getEtag" o = FileIOStreamGetEtagMethodInfo 
ResolveFileIOStreamMethod "getInputStream" o = IOStreamGetInputStreamMethodInfo 
ResolveFileIOStreamMethod "getOutputStream" o = IOStreamGetOutputStreamMethodInfo 
ResolveFileIOStreamMethod "getProperty" o = ObjectGetPropertyMethodInfo 
ResolveFileIOStreamMethod "getQdata" o = ObjectGetQdataMethodInfo 
ResolveFileIOStreamMethod "setData" o = ObjectSetDataMethodInfo 
ResolveFileIOStreamMethod "setDataFull" o = ObjectSetDataFullMethodInfo 
ResolveFileIOStreamMethod "setPending" o = IOStreamSetPendingMethodInfo 
ResolveFileIOStreamMethod "setProperty" o = ObjectSetPropertyMethodInfo 
ResolveFileIOStreamMethod l o = MethodResolutionFailed l o :: Type 

getEtag

fileIOStreamGetEtag Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileIOStream a) 
=> a

stream: a FileIOStream.

-> 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.

Since: 2.22

queryInfo

fileIOStreamQueryInfo Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileIOStream a, IsCancellable b) 
=> a

stream: a FileIOStream.

-> Text

attributes: a file attribute query string.

-> Maybe b

cancellable: optional Cancellable object, Nothing to ignore.

-> m FileInfo

Returns: a FileInfo for the stream, or Nothing on error. (Can throw GError)

Queries a file io stream for the given attributes. This function blocks while querying the stream. For the asynchronous version of this function, see fileIOStreamQueryInfoAsync. 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). I 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.

Since: 2.22

queryInfoAsync

fileIOStreamQueryInfoAsync Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileIOStream a, IsCancellable b) 
=> a

stream: a FileIOStream.

-> Text

attributes: a file attribute query string.

-> Int32

ioPriority: the I/O priority of the request

-> Maybe b

cancellable: optional Cancellable object, Nothing to ignore.

-> Maybe AsyncReadyCallback

callback: a AsyncReadyCallback to call when the request is satisfied

-> 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 fileIOStreamQueryInfoFinish.

For the synchronous version of this function, see fileIOStreamQueryInfo.

Since: 2.22

queryInfoFinish

fileIOStreamQueryInfoFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileIOStream a, IsAsyncResult b) 
=> a

stream: a FileIOStream.

-> b

result: a AsyncResult.

-> m FileInfo

Returns: A FileInfo for the finished query. (Can throw GError)

Finalizes the asynchronous query started by fileIOStreamQueryInfoAsync.

Since: 2.22