{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.FileOutputStream
(
FileOutputStream(..) ,
IsFileOutputStream ,
toFileOutputStream ,
noFileOutputStream ,
#if defined(ENABLE_OVERLOADING)
ResolveFileOutputStreamMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
FileOutputStreamGetEtagMethodInfo ,
#endif
fileOutputStreamGetEtag ,
#if defined(ENABLE_OVERLOADING)
FileOutputStreamQueryInfoMethodInfo ,
#endif
fileOutputStreamQueryInfo ,
#if defined(ENABLE_OVERLOADING)
FileOutputStreamQueryInfoAsyncMethodInfo,
#endif
fileOutputStreamQueryInfoAsync ,
#if defined(ENABLE_OVERLOADING)
FileOutputStreamQueryInfoFinishMethodInfo,
#endif
fileOutputStreamQueryInfoFinish ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Seekable as Gio.Seekable
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.FileInfo as Gio.FileInfo
import {-# SOURCE #-} qualified GI.Gio.Objects.OutputStream as Gio.OutputStream
newtype FileOutputStream = FileOutputStream (ManagedPtr FileOutputStream)
deriving (FileOutputStream -> FileOutputStream -> Bool
(FileOutputStream -> FileOutputStream -> Bool)
-> (FileOutputStream -> FileOutputStream -> Bool)
-> Eq FileOutputStream
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FileOutputStream -> FileOutputStream -> Bool
$c/= :: FileOutputStream -> FileOutputStream -> Bool
== :: FileOutputStream -> FileOutputStream -> Bool
$c== :: FileOutputStream -> FileOutputStream -> Bool
Eq)
foreign import ccall "g_file_output_stream_get_type"
c_g_file_output_stream_get_type :: IO GType
instance GObject FileOutputStream where
gobjectType :: IO GType
gobjectType = IO GType
c_g_file_output_stream_get_type
instance B.GValue.IsGValue FileOutputStream where
toGValue :: FileOutputStream -> IO GValue
toGValue o :: FileOutputStream
o = do
GType
gtype <- IO GType
c_g_file_output_stream_get_type
FileOutputStream
-> (Ptr FileOutputStream -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr FileOutputStream
o (GType
-> (GValue -> Ptr FileOutputStream -> IO ())
-> Ptr FileOutputStream
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr FileOutputStream -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO FileOutputStream
fromGValue gv :: GValue
gv = do
Ptr FileOutputStream
ptr <- GValue -> IO (Ptr FileOutputStream)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr FileOutputStream)
(ManagedPtr FileOutputStream -> FileOutputStream)
-> Ptr FileOutputStream -> IO FileOutputStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr FileOutputStream -> FileOutputStream
FileOutputStream Ptr FileOutputStream
ptr
class (GObject o, O.IsDescendantOf FileOutputStream o) => IsFileOutputStream o
instance (GObject o, O.IsDescendantOf FileOutputStream o) => IsFileOutputStream o
instance O.HasParentTypes FileOutputStream
type instance O.ParentTypes FileOutputStream = '[Gio.OutputStream.OutputStream, GObject.Object.Object, Gio.Seekable.Seekable]
toFileOutputStream :: (MonadIO m, IsFileOutputStream o) => o -> m FileOutputStream
toFileOutputStream :: o -> m FileOutputStream
toFileOutputStream = IO FileOutputStream -> m FileOutputStream
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FileOutputStream -> m FileOutputStream)
-> (o -> IO FileOutputStream) -> o -> m FileOutputStream
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr FileOutputStream -> FileOutputStream)
-> o -> IO FileOutputStream
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr FileOutputStream -> FileOutputStream
FileOutputStream
noFileOutputStream :: Maybe FileOutputStream
noFileOutputStream :: Maybe FileOutputStream
noFileOutputStream = Maybe FileOutputStream
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveFileOutputStreamMethod (t :: Symbol) (o :: *) :: * where
ResolveFileOutputStreamMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveFileOutputStreamMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveFileOutputStreamMethod "canSeek" o = Gio.Seekable.SeekableCanSeekMethodInfo
ResolveFileOutputStreamMethod "canTruncate" o = Gio.Seekable.SeekableCanTruncateMethodInfo
ResolveFileOutputStreamMethod "clearPending" o = Gio.OutputStream.OutputStreamClearPendingMethodInfo
ResolveFileOutputStreamMethod "close" o = Gio.OutputStream.OutputStreamCloseMethodInfo
ResolveFileOutputStreamMethod "closeAsync" o = Gio.OutputStream.OutputStreamCloseAsyncMethodInfo
ResolveFileOutputStreamMethod "closeFinish" o = Gio.OutputStream.OutputStreamCloseFinishMethodInfo
ResolveFileOutputStreamMethod "flush" o = Gio.OutputStream.OutputStreamFlushMethodInfo
ResolveFileOutputStreamMethod "flushAsync" o = Gio.OutputStream.OutputStreamFlushAsyncMethodInfo
ResolveFileOutputStreamMethod "flushFinish" o = Gio.OutputStream.OutputStreamFlushFinishMethodInfo
ResolveFileOutputStreamMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveFileOutputStreamMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveFileOutputStreamMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveFileOutputStreamMethod "hasPending" o = Gio.OutputStream.OutputStreamHasPendingMethodInfo
ResolveFileOutputStreamMethod "isClosed" o = Gio.OutputStream.OutputStreamIsClosedMethodInfo
ResolveFileOutputStreamMethod "isClosing" o = Gio.OutputStream.OutputStreamIsClosingMethodInfo
ResolveFileOutputStreamMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveFileOutputStreamMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveFileOutputStreamMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveFileOutputStreamMethod "queryInfo" o = FileOutputStreamQueryInfoMethodInfo
ResolveFileOutputStreamMethod "queryInfoAsync" o = FileOutputStreamQueryInfoAsyncMethodInfo
ResolveFileOutputStreamMethod "queryInfoFinish" o = FileOutputStreamQueryInfoFinishMethodInfo
ResolveFileOutputStreamMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveFileOutputStreamMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveFileOutputStreamMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveFileOutputStreamMethod "seek" o = Gio.Seekable.SeekableSeekMethodInfo
ResolveFileOutputStreamMethod "splice" o = Gio.OutputStream.OutputStreamSpliceMethodInfo
ResolveFileOutputStreamMethod "spliceAsync" o = Gio.OutputStream.OutputStreamSpliceAsyncMethodInfo
ResolveFileOutputStreamMethod "spliceFinish" o = Gio.OutputStream.OutputStreamSpliceFinishMethodInfo
ResolveFileOutputStreamMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveFileOutputStreamMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveFileOutputStreamMethod "tell" o = Gio.Seekable.SeekableTellMethodInfo
ResolveFileOutputStreamMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveFileOutputStreamMethod "truncate" o = Gio.Seekable.SeekableTruncateMethodInfo
ResolveFileOutputStreamMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveFileOutputStreamMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveFileOutputStreamMethod "write" o = Gio.OutputStream.OutputStreamWriteMethodInfo
ResolveFileOutputStreamMethod "writeAll" o = Gio.OutputStream.OutputStreamWriteAllMethodInfo
ResolveFileOutputStreamMethod "writeAllAsync" o = Gio.OutputStream.OutputStreamWriteAllAsyncMethodInfo
ResolveFileOutputStreamMethod "writeAllFinish" o = Gio.OutputStream.OutputStreamWriteAllFinishMethodInfo
ResolveFileOutputStreamMethod "writeAsync" o = Gio.OutputStream.OutputStreamWriteAsyncMethodInfo
ResolveFileOutputStreamMethod "writeBytes" o = Gio.OutputStream.OutputStreamWriteBytesMethodInfo
ResolveFileOutputStreamMethod "writeBytesAsync" o = Gio.OutputStream.OutputStreamWriteBytesAsyncMethodInfo
ResolveFileOutputStreamMethod "writeBytesFinish" o = Gio.OutputStream.OutputStreamWriteBytesFinishMethodInfo
ResolveFileOutputStreamMethod "writeFinish" o = Gio.OutputStream.OutputStreamWriteFinishMethodInfo
ResolveFileOutputStreamMethod "writev" o = Gio.OutputStream.OutputStreamWritevMethodInfo
ResolveFileOutputStreamMethod "writevAll" o = Gio.OutputStream.OutputStreamWritevAllMethodInfo
ResolveFileOutputStreamMethod "writevAllAsync" o = Gio.OutputStream.OutputStreamWritevAllAsyncMethodInfo
ResolveFileOutputStreamMethod "writevAllFinish" o = Gio.OutputStream.OutputStreamWritevAllFinishMethodInfo
ResolveFileOutputStreamMethod "writevAsync" o = Gio.OutputStream.OutputStreamWritevAsyncMethodInfo
ResolveFileOutputStreamMethod "writevFinish" o = Gio.OutputStream.OutputStreamWritevFinishMethodInfo
ResolveFileOutputStreamMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveFileOutputStreamMethod "getEtag" o = FileOutputStreamGetEtagMethodInfo
ResolveFileOutputStreamMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveFileOutputStreamMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveFileOutputStreamMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveFileOutputStreamMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveFileOutputStreamMethod "setPending" o = Gio.OutputStream.OutputStreamSetPendingMethodInfo
ResolveFileOutputStreamMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveFileOutputStreamMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveFileOutputStreamMethod t FileOutputStream, O.MethodInfo info FileOutputStream p) => OL.IsLabel t (FileOutputStream -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList FileOutputStream
type instance O.AttributeList FileOutputStream = FileOutputStreamAttributeList
type FileOutputStreamAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList FileOutputStream = FileOutputStreamSignalList
type FileOutputStreamSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_file_output_stream_get_etag" g_file_output_stream_get_etag ::
Ptr FileOutputStream ->
IO CString
fileOutputStreamGetEtag ::
(B.CallStack.HasCallStack, MonadIO m, IsFileOutputStream a) =>
a
-> m T.Text
fileOutputStreamGetEtag :: a -> m Text
fileOutputStreamGetEtag stream :: a
stream = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr FileOutputStream
stream' <- a -> IO (Ptr FileOutputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
CString
result <- Ptr FileOutputStream -> IO CString
g_file_output_stream_get_etag Ptr FileOutputStream
stream'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "fileOutputStreamGetEtag" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data FileOutputStreamGetEtagMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsFileOutputStream a) => O.MethodInfo FileOutputStreamGetEtagMethodInfo a signature where
overloadedMethod = fileOutputStreamGetEtag
#endif
foreign import ccall "g_file_output_stream_query_info" g_file_output_stream_query_info ::
Ptr FileOutputStream ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr Gio.FileInfo.FileInfo)
fileOutputStreamQueryInfo ::
(B.CallStack.HasCallStack, MonadIO m, IsFileOutputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Maybe (b)
-> m Gio.FileInfo.FileInfo
fileOutputStreamQueryInfo :: a -> Text -> Maybe b -> m FileInfo
fileOutputStreamQueryInfo stream :: a
stream attributes :: Text
attributes cancellable :: Maybe b
cancellable = IO FileInfo -> m FileInfo
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FileInfo -> m FileInfo) -> IO FileInfo -> m FileInfo
forall a b. (a -> b) -> a -> b
$ do
Ptr FileOutputStream
stream' <- a -> IO (Ptr FileOutputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
CString
attributes' <- Text -> IO CString
textToCString Text
attributes
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO FileInfo -> IO () -> IO FileInfo
forall a b. IO a -> IO b -> IO a
onException (do
Ptr FileInfo
result <- (Ptr (Ptr GError) -> IO (Ptr FileInfo)) -> IO (Ptr FileInfo)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr FileInfo)) -> IO (Ptr FileInfo))
-> (Ptr (Ptr GError) -> IO (Ptr FileInfo)) -> IO (Ptr FileInfo)
forall a b. (a -> b) -> a -> b
$ Ptr FileOutputStream
-> CString
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr FileInfo)
g_file_output_stream_query_info Ptr FileOutputStream
stream' CString
attributes' Ptr Cancellable
maybeCancellable
Text -> Ptr FileInfo -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "fileOutputStreamQueryInfo" Ptr FileInfo
result
FileInfo
result' <- ((ManagedPtr FileInfo -> FileInfo) -> Ptr FileInfo -> IO FileInfo
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr FileInfo -> FileInfo
Gio.FileInfo.FileInfo) Ptr FileInfo
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
attributes'
FileInfo -> IO FileInfo
forall (m :: * -> *) a. Monad m => a -> m a
return FileInfo
result'
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
attributes'
)
#if defined(ENABLE_OVERLOADING)
data FileOutputStreamQueryInfoMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> m Gio.FileInfo.FileInfo), MonadIO m, IsFileOutputStream a, Gio.Cancellable.IsCancellable b) => O.MethodInfo FileOutputStreamQueryInfoMethodInfo a signature where
overloadedMethod = fileOutputStreamQueryInfo
#endif
foreign import ccall "g_file_output_stream_query_info_async" g_file_output_stream_query_info_async ::
Ptr FileOutputStream ->
CString ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
fileOutputStreamQueryInfoAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsFileOutputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
fileOutputStreamQueryInfoAsync :: a -> Text -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
fileOutputStreamQueryInfoAsync stream :: a
stream attributes :: Text
attributes ioPriority :: Int32
ioPriority cancellable :: Maybe b
cancellable callback :: Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr FileOutputStream
stream' <- a -> IO (Ptr FileOutputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
CString
attributes' <- Text -> IO CString
textToCString Text
attributes
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jCallback :: AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr FileOutputStream
-> CString
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_file_output_stream_query_info_async Ptr FileOutputStream
stream' CString
attributes' Int32
ioPriority Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
attributes'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FileOutputStreamQueryInfoAsyncMethodInfo
instance (signature ~ (T.Text -> Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsFileOutputStream a, Gio.Cancellable.IsCancellable b) => O.MethodInfo FileOutputStreamQueryInfoAsyncMethodInfo a signature where
overloadedMethod = fileOutputStreamQueryInfoAsync
#endif
foreign import ccall "g_file_output_stream_query_info_finish" g_file_output_stream_query_info_finish ::
Ptr FileOutputStream ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr Gio.FileInfo.FileInfo)
fileOutputStreamQueryInfoFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsFileOutputStream a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m Gio.FileInfo.FileInfo
fileOutputStreamQueryInfoFinish :: a -> b -> m FileInfo
fileOutputStreamQueryInfoFinish stream :: a
stream result_ :: b
result_ = IO FileInfo -> m FileInfo
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FileInfo -> m FileInfo) -> IO FileInfo -> m FileInfo
forall a b. (a -> b) -> a -> b
$ do
Ptr FileOutputStream
stream' <- a -> IO (Ptr FileOutputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
IO FileInfo -> IO () -> IO FileInfo
forall a b. IO a -> IO b -> IO a
onException (do
Ptr FileInfo
result <- (Ptr (Ptr GError) -> IO (Ptr FileInfo)) -> IO (Ptr FileInfo)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr FileInfo)) -> IO (Ptr FileInfo))
-> (Ptr (Ptr GError) -> IO (Ptr FileInfo)) -> IO (Ptr FileInfo)
forall a b. (a -> b) -> a -> b
$ Ptr FileOutputStream
-> Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr FileInfo)
g_file_output_stream_query_info_finish Ptr FileOutputStream
stream' Ptr AsyncResult
result_'
Text -> Ptr FileInfo -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "fileOutputStreamQueryInfoFinish" Ptr FileInfo
result
FileInfo
result' <- ((ManagedPtr FileInfo -> FileInfo) -> Ptr FileInfo -> IO FileInfo
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr FileInfo -> FileInfo
Gio.FileInfo.FileInfo) Ptr FileInfo
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
FileInfo -> IO FileInfo
forall (m :: * -> *) a. Monad m => a -> m a
return FileInfo
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data FileOutputStreamQueryInfoFinishMethodInfo
instance (signature ~ (b -> m Gio.FileInfo.FileInfo), MonadIO m, IsFileOutputStream a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo FileOutputStreamQueryInfoFinishMethodInfo a signature where
overloadedMethod = fileOutputStreamQueryInfoFinish
#endif