gi-gio-2.0.27: Gio bindings

Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gio.Objects.FileInputStream

Contents

- Exported types
- Methods
  - Overloaded methods
  - queryInfo
  - queryInfoAsync
  - queryInfoFinish

Description

GFileInputStream provides input streams that take their content from a file.

GFileInputStream implements `Seekable`, which allows the input stream to jump to arbitrary positions in the file, provided the filesystem of the file allows it. To find the position of a file input stream, use `seekableTell`. To find out if a file input stream supports seeking, use `seekableCanSeek`. To position a file input stream, use `seekableSeek`.

Synopsis

- newtype FileInputStream = FileInputStream (ManagedPtr FileInputStream)
- class (GObject o, IsDescendantOf FileInputStream o) => IsFileInputStream o
- toFileInputStream :: (MonadIO m, IsFileInputStream o) => o -> m FileInputStream
- fileInputStreamQueryInfo :: (HasCallStack, MonadIO m, IsFileInputStream a, IsCancellable b) => a -> Text -> Maybe b -> m FileInfo
- fileInputStreamQueryInfoAsync :: (HasCallStack, MonadIO m, IsFileInputStream a, IsCancellable b) => a -> Text -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- fileInputStreamQueryInfoFinish :: (HasCallStack, MonadIO m, IsFileInputStream a, IsAsyncResult b) => a -> b -> m FileInfo

# Exported types

newtype FileInputStream Source #

Memory-managed wrapper type.

Constructors

FileInputStream (ManagedPtr FileInputStream) |

#### Instances

Instances details

Eq FileInputStream Source # |
Instance details Defined in GI.Gio.Objects.FileInputStream Methods (==) :: FileInputStream -> FileInputStream -> Bool # (/=) :: FileInputStream -> FileInputStream -> Bool #
GObject FileInputStream Source # |
Instance details Defined in GI.Gio.Objects.FileInputStream
TypedObject FileInputStream Source # |
Instance details Defined in GI.Gio.Objects.FileInputStream Methods glibType :: IO GType Source #
ManagedPtrNewtype FileInputStream Source # |
Instance details Defined in GI.Gio.Objects.FileInputStream Methods toManagedPtr :: FileInputStream -> ManagedPtr FileInputStream Source #
IsGValue FileInputStream Source # | Convert `FileInputStream` to and from `GValue` with `toGValue` and `fromGValue`.
Instance details Defined in GI.Gio.Objects.FileInputStream Methods toGValue :: FileInputStream -> IO GValue Source # fromGValue :: GValue -> IO FileInputStream Source #
HasParentTypes FileInputStream Source # |
Instance details Defined in GI.Gio.Objects.FileInputStream
type ParentTypes FileInputStream Source # |
Instance details Defined in GI.Gio.Objects.FileInputStream type ParentTypes FileInputStream = '[InputStream, Object, Seekable]

class (GObject o, IsDescendantOf FileInputStream o) => IsFileInputStream o Source #

Type class for types which can be safely cast to `FileInputStream`, for instance with `toFileInputStream`.

#### Instances

Instances details

(GObject o, IsDescendantOf FileInputStream o) => IsFileInputStream o Source # |
Instance details Defined in GI.Gio.Objects.FileInputStream

toFileInputStream :: (MonadIO m, IsFileInputStream o) => o -> m FileInputStream Source #

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

# Methods

## Overloaded methods

## queryInfo

fileInputStreamQueryInfo Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInputStream a, IsCancellable b) |
=> a | `stream`: a `FileInputStream`.
-> Text | `attributes`: a file attribute query string.
-> Maybe b | `cancellable`: optional `Cancellable` object, `Nothing` to ignore.
-> m FileInfo | Returns: a `FileInfo`, or `Nothing` on error. (Can throw `GError`)

Queries a file input stream the given `attributes`. This function blocks while querying the stream. For the asynchronous (non-blocking) version of this function, see `fileInputStreamQueryInfoAsync`. While the stream is blocked, the stream will set the pending flag internally, and any other operations on the stream will fail with `IOErrorEnumPending`.

## queryInfoAsync

fileInputStreamQueryInfoAsync Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInputStream a, IsCancellable b) |
=> a | `stream`: a `FileInputStream`.
-> Text | `attributes`: a file attribute query string.
-> Int32 | `ioPriority`: the [I/O priority][io-priority] of the request
-> Maybe b | `cancellable`: optional `Cancellable` object, `Nothing` to ignore.
-> Maybe AsyncReadyCallback | `callback`: callback to call when the request is satisfied
-> m () |

Queries the stream information asynchronously. When the operation is finished `callback` will be called. You can then call `fileInputStreamQueryInfoFinish` to get the result of the operation.

For the synchronous version of this function, see `fileInputStreamQueryInfo`.

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

## queryInfoFinish

fileInputStreamQueryInfoFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileInputStream a, IsAsyncResult b) |
=> a | `stream`: a `FileInputStream`.
-> b | `result`: a `AsyncResult`.
-> m FileInfo | Returns: `FileInfo`. (Can throw `GError`)

Finishes an asynchronous info query operation.