{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.FileEnumerator
(
FileEnumerator(..) ,
IsFileEnumerator ,
toFileEnumerator ,
#if defined(ENABLE_OVERLOADING)
ResolveFileEnumeratorMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
FileEnumeratorCloseMethodInfo ,
#endif
fileEnumeratorClose ,
#if defined(ENABLE_OVERLOADING)
FileEnumeratorCloseAsyncMethodInfo ,
#endif
fileEnumeratorCloseAsync ,
#if defined(ENABLE_OVERLOADING)
FileEnumeratorCloseFinishMethodInfo ,
#endif
fileEnumeratorCloseFinish ,
#if defined(ENABLE_OVERLOADING)
FileEnumeratorGetChildMethodInfo ,
#endif
fileEnumeratorGetChild ,
#if defined(ENABLE_OVERLOADING)
FileEnumeratorGetContainerMethodInfo ,
#endif
fileEnumeratorGetContainer ,
#if defined(ENABLE_OVERLOADING)
FileEnumeratorHasPendingMethodInfo ,
#endif
fileEnumeratorHasPending ,
#if defined(ENABLE_OVERLOADING)
FileEnumeratorIsClosedMethodInfo ,
#endif
fileEnumeratorIsClosed ,
#if defined(ENABLE_OVERLOADING)
FileEnumeratorIterateMethodInfo ,
#endif
fileEnumeratorIterate ,
#if defined(ENABLE_OVERLOADING)
FileEnumeratorNextFileMethodInfo ,
#endif
fileEnumeratorNextFile ,
#if defined(ENABLE_OVERLOADING)
FileEnumeratorNextFilesAsyncMethodInfo ,
#endif
fileEnumeratorNextFilesAsync ,
#if defined(ENABLE_OVERLOADING)
FileEnumeratorNextFilesFinishMethodInfo ,
#endif
fileEnumeratorNextFilesFinish ,
#if defined(ENABLE_OVERLOADING)
FileEnumeratorSetPendingMethodInfo ,
#endif
fileEnumeratorSetPending ,
#if defined(ENABLE_OVERLOADING)
FileEnumeratorContainerPropertyInfo ,
#endif
constructFileEnumeratorContainer ,
#if defined(ENABLE_OVERLOADING)
fileEnumeratorContainer ,
#endif
) 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.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
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 Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
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 GHC.Records as R
import qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Enums as GLib.Enums
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.DateTime as GLib.DateTime
import qualified GI.GLib.Structs.PollFD as GLib.PollFD
import qualified GI.GLib.Structs.Source as GLib.Source
import qualified GI.GLib.Structs.TimeVal as GLib.TimeVal
import qualified GI.GObject.Callbacks as GObject.Callbacks
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import {-# SOURCE #-} qualified GI.Gio.Enums as Gio.Enums
import {-# SOURCE #-} qualified GI.Gio.Flags as Gio.Flags
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AppInfo as Gio.AppInfo
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Drive as Gio.Drive
import {-# SOURCE #-} qualified GI.Gio.Interfaces.File as Gio.File
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Icon as Gio.Icon
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Mount as Gio.Mount
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Seekable as Gio.Seekable
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Volume as Gio.Volume
import {-# SOURCE #-} qualified GI.Gio.Objects.AppLaunchContext as Gio.AppLaunchContext
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.FileIOStream as Gio.FileIOStream
import {-# SOURCE #-} qualified GI.Gio.Objects.FileInfo as Gio.FileInfo
import {-# SOURCE #-} qualified GI.Gio.Objects.FileInputStream as Gio.FileInputStream
import {-# SOURCE #-} qualified GI.Gio.Objects.FileMonitor as Gio.FileMonitor
import {-# SOURCE #-} qualified GI.Gio.Objects.FileOutputStream as Gio.FileOutputStream
import {-# SOURCE #-} qualified GI.Gio.Objects.IOStream as Gio.IOStream
import {-# SOURCE #-} qualified GI.Gio.Objects.InputStream as Gio.InputStream
import {-# SOURCE #-} qualified GI.Gio.Objects.MountOperation as Gio.MountOperation
import {-# SOURCE #-} qualified GI.Gio.Objects.OutputStream as Gio.OutputStream
import {-# SOURCE #-} qualified GI.Gio.Structs.FileAttributeInfo as Gio.FileAttributeInfo
import {-# SOURCE #-} qualified GI.Gio.Structs.FileAttributeInfoList as Gio.FileAttributeInfoList
import {-# SOURCE #-} qualified GI.Gio.Structs.FileAttributeMatcher as Gio.FileAttributeMatcher
import {-# SOURCE #-} qualified GI.Gio.Structs.OutputVector as Gio.OutputVector
#else
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.File as Gio.File
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.FileInfo as Gio.FileInfo
#endif
newtype FileEnumerator = FileEnumerator (SP.ManagedPtr FileEnumerator)
deriving (FileEnumerator -> FileEnumerator -> Bool
(FileEnumerator -> FileEnumerator -> Bool)
-> (FileEnumerator -> FileEnumerator -> Bool) -> Eq FileEnumerator
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FileEnumerator -> FileEnumerator -> Bool
== :: FileEnumerator -> FileEnumerator -> Bool
$c/= :: FileEnumerator -> FileEnumerator -> Bool
/= :: FileEnumerator -> FileEnumerator -> Bool
Eq)
instance SP.ManagedPtrNewtype FileEnumerator where
toManagedPtr :: FileEnumerator -> ManagedPtr FileEnumerator
toManagedPtr (FileEnumerator ManagedPtr FileEnumerator
p) = ManagedPtr FileEnumerator
p
foreign import ccall "g_file_enumerator_get_type"
c_g_file_enumerator_get_type :: IO B.Types.GType
instance B.Types.TypedObject FileEnumerator where
glibType :: IO GType
glibType = IO GType
c_g_file_enumerator_get_type
instance B.Types.GObject FileEnumerator
class (SP.GObject o, O.IsDescendantOf FileEnumerator o) => IsFileEnumerator o
instance (SP.GObject o, O.IsDescendantOf FileEnumerator o) => IsFileEnumerator o
instance O.HasParentTypes FileEnumerator
type instance O.ParentTypes FileEnumerator = '[GObject.Object.Object]
toFileEnumerator :: (MIO.MonadIO m, IsFileEnumerator o) => o -> m FileEnumerator
toFileEnumerator :: forall (m :: * -> *) o.
(MonadIO m, IsFileEnumerator o) =>
o -> m FileEnumerator
toFileEnumerator = IO FileEnumerator -> m FileEnumerator
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO FileEnumerator -> m FileEnumerator)
-> (o -> IO FileEnumerator) -> o -> m FileEnumerator
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr FileEnumerator -> FileEnumerator)
-> o -> IO FileEnumerator
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr FileEnumerator -> FileEnumerator
FileEnumerator
instance B.GValue.IsGValue (Maybe FileEnumerator) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_g_file_enumerator_get_type
gvalueSet_ :: Ptr GValue -> Maybe FileEnumerator -> IO ()
gvalueSet_ Ptr GValue
gv Maybe FileEnumerator
P.Nothing = Ptr GValue -> Ptr FileEnumerator -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr FileEnumerator
forall a. Ptr a
FP.nullPtr :: FP.Ptr FileEnumerator)
gvalueSet_ Ptr GValue
gv (P.Just FileEnumerator
obj) = FileEnumerator -> (Ptr FileEnumerator -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr FileEnumerator
obj (Ptr GValue -> Ptr FileEnumerator -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe FileEnumerator)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr FileEnumerator)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr FileEnumerator)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject FileEnumerator ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveFileEnumeratorMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveFileEnumeratorMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveFileEnumeratorMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveFileEnumeratorMethod "close" o = FileEnumeratorCloseMethodInfo
ResolveFileEnumeratorMethod "closeAsync" o = FileEnumeratorCloseAsyncMethodInfo
ResolveFileEnumeratorMethod "closeFinish" o = FileEnumeratorCloseFinishMethodInfo
ResolveFileEnumeratorMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveFileEnumeratorMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveFileEnumeratorMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveFileEnumeratorMethod "hasPending" o = FileEnumeratorHasPendingMethodInfo
ResolveFileEnumeratorMethod "isClosed" o = FileEnumeratorIsClosedMethodInfo
ResolveFileEnumeratorMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveFileEnumeratorMethod "iterate" o = FileEnumeratorIterateMethodInfo
ResolveFileEnumeratorMethod "nextFile" o = FileEnumeratorNextFileMethodInfo
ResolveFileEnumeratorMethod "nextFilesAsync" o = FileEnumeratorNextFilesAsyncMethodInfo
ResolveFileEnumeratorMethod "nextFilesFinish" o = FileEnumeratorNextFilesFinishMethodInfo
ResolveFileEnumeratorMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveFileEnumeratorMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveFileEnumeratorMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveFileEnumeratorMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveFileEnumeratorMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveFileEnumeratorMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveFileEnumeratorMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveFileEnumeratorMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveFileEnumeratorMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveFileEnumeratorMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveFileEnumeratorMethod "getChild" o = FileEnumeratorGetChildMethodInfo
ResolveFileEnumeratorMethod "getContainer" o = FileEnumeratorGetContainerMethodInfo
ResolveFileEnumeratorMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveFileEnumeratorMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveFileEnumeratorMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveFileEnumeratorMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveFileEnumeratorMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveFileEnumeratorMethod "setPending" o = FileEnumeratorSetPendingMethodInfo
ResolveFileEnumeratorMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveFileEnumeratorMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveFileEnumeratorMethod t FileEnumerator, O.OverloadedMethod info FileEnumerator p) => OL.IsLabel t (FileEnumerator -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveFileEnumeratorMethod t FileEnumerator, O.OverloadedMethod info FileEnumerator p, R.HasField t FileEnumerator p) => R.HasField t FileEnumerator p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveFileEnumeratorMethod t FileEnumerator, O.OverloadedMethodInfo info FileEnumerator) => OL.IsLabel t (O.MethodProxy info FileEnumerator) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
constructFileEnumeratorContainer :: (IsFileEnumerator o, MIO.MonadIO m, Gio.File.IsFile a) => a -> m (GValueConstruct o)
constructFileEnumeratorContainer :: forall o (m :: * -> *) a.
(IsFileEnumerator o, MonadIO m, IsFile a) =>
a -> m (GValueConstruct o)
constructFileEnumeratorContainer a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"container" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
#if defined(ENABLE_OVERLOADING)
data FileEnumeratorContainerPropertyInfo
instance AttrInfo FileEnumeratorContainerPropertyInfo where
type AttrAllowedOps FileEnumeratorContainerPropertyInfo = '[ 'AttrConstruct, 'AttrClear]
type AttrBaseTypeConstraint FileEnumeratorContainerPropertyInfo = IsFileEnumerator
type AttrSetTypeConstraint FileEnumeratorContainerPropertyInfo = Gio.File.IsFile
type AttrTransferTypeConstraint FileEnumeratorContainerPropertyInfo = Gio.File.IsFile
type AttrTransferType FileEnumeratorContainerPropertyInfo = Gio.File.File
type AttrGetType FileEnumeratorContainerPropertyInfo = ()
type AttrLabel FileEnumeratorContainerPropertyInfo = "container"
type AttrOrigin FileEnumeratorContainerPropertyInfo = FileEnumerator
attrGet = undefined
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Gio.File.File v
attrConstruct = constructFileEnumeratorContainer
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.FileEnumerator.container"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-FileEnumerator.html#g:attr:container"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList FileEnumerator
type instance O.AttributeList FileEnumerator = FileEnumeratorAttributeList
type FileEnumeratorAttributeList = ('[ '("container", FileEnumeratorContainerPropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
fileEnumeratorContainer :: AttrLabelProxy "container"
fileEnumeratorContainer = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList FileEnumerator = FileEnumeratorSignalList
type FileEnumeratorSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "g_file_enumerator_close" g_file_enumerator_close ::
Ptr FileEnumerator ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
fileEnumeratorClose ::
(B.CallStack.HasCallStack, MonadIO m, IsFileEnumerator a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m ()
fileEnumeratorClose :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsFileEnumerator a, IsCancellable b) =>
a -> Maybe b -> m ()
fileEnumeratorClose a
enumerator Maybe b
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
enumerator' <- a -> IO (Ptr FileEnumerator)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
enumerator
maybeCancellable <- case cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
onException (do
_ <- propagateGError $ g_file_enumerator_close enumerator' maybeCancellable
touchManagedPtr enumerator
whenJust cancellable touchManagedPtr
return ()
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data FileEnumeratorCloseMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsFileEnumerator a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod FileEnumeratorCloseMethodInfo a signature where
overloadedMethod = fileEnumeratorClose
instance O.OverloadedMethodInfo FileEnumeratorCloseMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.FileEnumerator.fileEnumeratorClose",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-FileEnumerator.html#v:fileEnumeratorClose"
})
#endif
foreign import ccall "g_file_enumerator_close_async" g_file_enumerator_close_async ::
Ptr FileEnumerator ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
fileEnumeratorCloseAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsFileEnumerator a, Gio.Cancellable.IsCancellable b) =>
a
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
fileEnumeratorCloseAsync :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsFileEnumerator a, IsCancellable b) =>
a -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
fileEnumeratorCloseAsync a
enumerator Int32
ioPriority Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
enumerator' <- a -> IO (Ptr FileEnumerator)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
enumerator
maybeCancellable <- case cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
maybeCallback <- case callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
g_file_enumerator_close_async enumerator' ioPriority maybeCancellable maybeCallback userData
touchManagedPtr enumerator
whenJust cancellable touchManagedPtr
return ()
#if defined(ENABLE_OVERLOADING)
data FileEnumeratorCloseAsyncMethodInfo
instance (signature ~ (Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsFileEnumerator a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod FileEnumeratorCloseAsyncMethodInfo a signature where
overloadedMethod = fileEnumeratorCloseAsync
instance O.OverloadedMethodInfo FileEnumeratorCloseAsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.FileEnumerator.fileEnumeratorCloseAsync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-FileEnumerator.html#v:fileEnumeratorCloseAsync"
})
#endif
foreign import ccall "g_file_enumerator_close_finish" g_file_enumerator_close_finish ::
Ptr FileEnumerator ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
fileEnumeratorCloseFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsFileEnumerator a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
fileEnumeratorCloseFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsFileEnumerator a, IsAsyncResult b) =>
a -> b -> m ()
fileEnumeratorCloseFinish a
enumerator b
result_ = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
enumerator' <- a -> IO (Ptr FileEnumerator)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
enumerator
result_' <- unsafeManagedPtrCastPtr result_
onException (do
_ <- propagateGError $ g_file_enumerator_close_finish enumerator' result_'
touchManagedPtr enumerator
touchManagedPtr result_
return ()
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data FileEnumeratorCloseFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsFileEnumerator a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod FileEnumeratorCloseFinishMethodInfo a signature where
overloadedMethod = fileEnumeratorCloseFinish
instance O.OverloadedMethodInfo FileEnumeratorCloseFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.FileEnumerator.fileEnumeratorCloseFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-FileEnumerator.html#v:fileEnumeratorCloseFinish"
})
#endif
foreign import ccall "g_file_enumerator_get_child" g_file_enumerator_get_child ::
Ptr FileEnumerator ->
Ptr Gio.FileInfo.FileInfo ->
IO (Ptr Gio.File.File)
fileEnumeratorGetChild ::
(B.CallStack.HasCallStack, MonadIO m, IsFileEnumerator a, Gio.FileInfo.IsFileInfo b) =>
a
-> b
-> m Gio.File.File
fileEnumeratorGetChild :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsFileEnumerator a, IsFileInfo b) =>
a -> b -> m File
fileEnumeratorGetChild a
enumerator b
info = IO File -> m File
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO File -> m File) -> IO File -> m File
forall a b. (a -> b) -> a -> b
$ do
enumerator' <- a -> IO (Ptr FileEnumerator)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
enumerator
info' <- unsafeManagedPtrCastPtr info
result <- g_file_enumerator_get_child enumerator' info'
checkUnexpectedReturnNULL "fileEnumeratorGetChild" result
result' <- (wrapObject Gio.File.File) result
touchManagedPtr enumerator
touchManagedPtr info
return result'
#if defined(ENABLE_OVERLOADING)
data FileEnumeratorGetChildMethodInfo
instance (signature ~ (b -> m Gio.File.File), MonadIO m, IsFileEnumerator a, Gio.FileInfo.IsFileInfo b) => O.OverloadedMethod FileEnumeratorGetChildMethodInfo a signature where
overloadedMethod = fileEnumeratorGetChild
instance O.OverloadedMethodInfo FileEnumeratorGetChildMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.FileEnumerator.fileEnumeratorGetChild",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-FileEnumerator.html#v:fileEnumeratorGetChild"
})
#endif
foreign import ccall "g_file_enumerator_get_container" g_file_enumerator_get_container ::
Ptr FileEnumerator ->
IO (Ptr Gio.File.File)
fileEnumeratorGetContainer ::
(B.CallStack.HasCallStack, MonadIO m, IsFileEnumerator a) =>
a
-> m Gio.File.File
fileEnumeratorGetContainer :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsFileEnumerator a) =>
a -> m File
fileEnumeratorGetContainer a
enumerator = IO File -> m File
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO File -> m File) -> IO File -> m File
forall a b. (a -> b) -> a -> b
$ do
enumerator' <- a -> IO (Ptr FileEnumerator)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
enumerator
result <- g_file_enumerator_get_container enumerator'
checkUnexpectedReturnNULL "fileEnumeratorGetContainer" result
result' <- (newObject Gio.File.File) result
touchManagedPtr enumerator
return result'
#if defined(ENABLE_OVERLOADING)
data FileEnumeratorGetContainerMethodInfo
instance (signature ~ (m Gio.File.File), MonadIO m, IsFileEnumerator a) => O.OverloadedMethod FileEnumeratorGetContainerMethodInfo a signature where
overloadedMethod = fileEnumeratorGetContainer
instance O.OverloadedMethodInfo FileEnumeratorGetContainerMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.FileEnumerator.fileEnumeratorGetContainer",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-FileEnumerator.html#v:fileEnumeratorGetContainer"
})
#endif
foreign import ccall "g_file_enumerator_has_pending" g_file_enumerator_has_pending ::
Ptr FileEnumerator ->
IO CInt
fileEnumeratorHasPending ::
(B.CallStack.HasCallStack, MonadIO m, IsFileEnumerator a) =>
a
-> m Bool
fileEnumeratorHasPending :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsFileEnumerator a) =>
a -> m Bool
fileEnumeratorHasPending a
enumerator = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
enumerator' <- a -> IO (Ptr FileEnumerator)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
enumerator
result <- g_file_enumerator_has_pending enumerator'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr enumerator
return result'
#if defined(ENABLE_OVERLOADING)
data FileEnumeratorHasPendingMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFileEnumerator a) => O.OverloadedMethod FileEnumeratorHasPendingMethodInfo a signature where
overloadedMethod = fileEnumeratorHasPending
instance O.OverloadedMethodInfo FileEnumeratorHasPendingMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.FileEnumerator.fileEnumeratorHasPending",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-FileEnumerator.html#v:fileEnumeratorHasPending"
})
#endif
foreign import ccall "g_file_enumerator_is_closed" g_file_enumerator_is_closed ::
Ptr FileEnumerator ->
IO CInt
fileEnumeratorIsClosed ::
(B.CallStack.HasCallStack, MonadIO m, IsFileEnumerator a) =>
a
-> m Bool
fileEnumeratorIsClosed :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsFileEnumerator a) =>
a -> m Bool
fileEnumeratorIsClosed a
enumerator = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
enumerator' <- a -> IO (Ptr FileEnumerator)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
enumerator
result <- g_file_enumerator_is_closed enumerator'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr enumerator
return result'
#if defined(ENABLE_OVERLOADING)
data FileEnumeratorIsClosedMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFileEnumerator a) => O.OverloadedMethod FileEnumeratorIsClosedMethodInfo a signature where
overloadedMethod = fileEnumeratorIsClosed
instance O.OverloadedMethodInfo FileEnumeratorIsClosedMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.FileEnumerator.fileEnumeratorIsClosed",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-FileEnumerator.html#v:fileEnumeratorIsClosed"
})
#endif
foreign import ccall "g_file_enumerator_iterate" g_file_enumerator_iterate ::
Ptr FileEnumerator ->
Ptr (Ptr Gio.FileInfo.FileInfo) ->
Ptr (Ptr Gio.File.File) ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
fileEnumeratorIterate ::
(B.CallStack.HasCallStack, MonadIO m, IsFileEnumerator a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m ((Gio.FileInfo.FileInfo, Gio.File.File))
fileEnumeratorIterate :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsFileEnumerator a, IsCancellable b) =>
a -> Maybe b -> m (FileInfo, File)
fileEnumeratorIterate a
direnum Maybe b
cancellable = IO (FileInfo, File) -> m (FileInfo, File)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (FileInfo, File) -> m (FileInfo, File))
-> IO (FileInfo, File) -> m (FileInfo, File)
forall a b. (a -> b) -> a -> b
$ do
direnum' <- a -> IO (Ptr FileEnumerator)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
direnum
outInfo <- callocMem :: IO (Ptr (Ptr Gio.FileInfo.FileInfo))
outChild <- callocMem :: IO (Ptr (Ptr Gio.File.File))
maybeCancellable <- case cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
onException (do
_ <- propagateGError $ g_file_enumerator_iterate direnum' outInfo outChild maybeCancellable
outInfo' <- peek outInfo
outInfo'' <- (newObject Gio.FileInfo.FileInfo) outInfo'
outChild' <- peek outChild
outChild'' <- (newObject Gio.File.File) outChild'
touchManagedPtr direnum
whenJust cancellable touchManagedPtr
freeMem outInfo
freeMem outChild
return (outInfo'', outChild'')
) (do
freeMem outInfo
freeMem outChild
)
#if defined(ENABLE_OVERLOADING)
data FileEnumeratorIterateMethodInfo
instance (signature ~ (Maybe (b) -> m ((Gio.FileInfo.FileInfo, Gio.File.File))), MonadIO m, IsFileEnumerator a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod FileEnumeratorIterateMethodInfo a signature where
overloadedMethod = fileEnumeratorIterate
instance O.OverloadedMethodInfo FileEnumeratorIterateMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.FileEnumerator.fileEnumeratorIterate",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-FileEnumerator.html#v:fileEnumeratorIterate"
})
#endif
foreign import ccall "g_file_enumerator_next_file" g_file_enumerator_next_file ::
Ptr FileEnumerator ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr Gio.FileInfo.FileInfo)
fileEnumeratorNextFile ::
(B.CallStack.HasCallStack, MonadIO m, IsFileEnumerator a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m (Maybe Gio.FileInfo.FileInfo)
fileEnumeratorNextFile :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsFileEnumerator a, IsCancellable b) =>
a -> Maybe b -> m (Maybe FileInfo)
fileEnumeratorNextFile a
enumerator Maybe b
cancellable = IO (Maybe FileInfo) -> m (Maybe FileInfo)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe FileInfo) -> m (Maybe FileInfo))
-> IO (Maybe FileInfo) -> m (Maybe FileInfo)
forall a b. (a -> b) -> a -> b
$ do
enumerator' <- a -> IO (Ptr FileEnumerator)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
enumerator
maybeCancellable <- case cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
onException (do
result <- propagateGError $ g_file_enumerator_next_file enumerator' maybeCancellable
maybeResult <- convertIfNonNull result $ \Ptr FileInfo
result' -> do
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'
return result''
touchManagedPtr enumerator
whenJust cancellable touchManagedPtr
return maybeResult
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data FileEnumeratorNextFileMethodInfo
instance (signature ~ (Maybe (b) -> m (Maybe Gio.FileInfo.FileInfo)), MonadIO m, IsFileEnumerator a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod FileEnumeratorNextFileMethodInfo a signature where
overloadedMethod = fileEnumeratorNextFile
instance O.OverloadedMethodInfo FileEnumeratorNextFileMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.FileEnumerator.fileEnumeratorNextFile",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-FileEnumerator.html#v:fileEnumeratorNextFile"
})
#endif
foreign import ccall "g_file_enumerator_next_files_async" g_file_enumerator_next_files_async ::
Ptr FileEnumerator ->
Int32 ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
fileEnumeratorNextFilesAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsFileEnumerator a, Gio.Cancellable.IsCancellable b) =>
a
-> Int32
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
fileEnumeratorNextFilesAsync :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsFileEnumerator a, IsCancellable b) =>
a -> Int32 -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
fileEnumeratorNextFilesAsync a
enumerator Int32
numFiles Int32
ioPriority Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
enumerator' <- a -> IO (Ptr FileEnumerator)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
enumerator
maybeCancellable <- case cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
maybeCallback <- case callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
g_file_enumerator_next_files_async enumerator' numFiles ioPriority maybeCancellable maybeCallback userData
touchManagedPtr enumerator
whenJust cancellable touchManagedPtr
return ()
#if defined(ENABLE_OVERLOADING)
data FileEnumeratorNextFilesAsyncMethodInfo
instance (signature ~ (Int32 -> Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsFileEnumerator a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod FileEnumeratorNextFilesAsyncMethodInfo a signature where
overloadedMethod = fileEnumeratorNextFilesAsync
instance O.OverloadedMethodInfo FileEnumeratorNextFilesAsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.FileEnumerator.fileEnumeratorNextFilesAsync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-FileEnumerator.html#v:fileEnumeratorNextFilesAsync"
})
#endif
foreign import ccall "g_file_enumerator_next_files_finish" g_file_enumerator_next_files_finish ::
Ptr FileEnumerator ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr (GList (Ptr Gio.FileInfo.FileInfo)))
fileEnumeratorNextFilesFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsFileEnumerator a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m [Gio.FileInfo.FileInfo]
fileEnumeratorNextFilesFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsFileEnumerator a, IsAsyncResult b) =>
a -> b -> m [FileInfo]
fileEnumeratorNextFilesFinish a
enumerator b
result_ = IO [FileInfo] -> m [FileInfo]
forall a. IO a -> m a
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
enumerator' <- a -> IO (Ptr FileEnumerator)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
enumerator
result_' <- unsafeManagedPtrCastPtr result_
onException (do
result <- propagateGError $ g_file_enumerator_next_files_finish enumerator' result_'
result' <- unpackGList result
result'' <- mapM (wrapObject Gio.FileInfo.FileInfo) result'
g_list_free result
touchManagedPtr enumerator
touchManagedPtr result_
return result''
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data FileEnumeratorNextFilesFinishMethodInfo
instance (signature ~ (b -> m [Gio.FileInfo.FileInfo]), MonadIO m, IsFileEnumerator a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod FileEnumeratorNextFilesFinishMethodInfo a signature where
overloadedMethod = fileEnumeratorNextFilesFinish
instance O.OverloadedMethodInfo FileEnumeratorNextFilesFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.FileEnumerator.fileEnumeratorNextFilesFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-FileEnumerator.html#v:fileEnumeratorNextFilesFinish"
})
#endif
foreign import ccall "g_file_enumerator_set_pending" g_file_enumerator_set_pending ::
Ptr FileEnumerator ->
CInt ->
IO ()
fileEnumeratorSetPending ::
(B.CallStack.HasCallStack, MonadIO m, IsFileEnumerator a) =>
a
-> Bool
-> m ()
fileEnumeratorSetPending :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsFileEnumerator a) =>
a -> Bool -> m ()
fileEnumeratorSetPending a
enumerator Bool
pending = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
enumerator' <- a -> IO (Ptr FileEnumerator)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
enumerator
let pending' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
pending
g_file_enumerator_set_pending enumerator' pending'
touchManagedPtr enumerator
return ()
#if defined(ENABLE_OVERLOADING)
data FileEnumeratorSetPendingMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsFileEnumerator a) => O.OverloadedMethod FileEnumeratorSetPendingMethodInfo a signature where
overloadedMethod = fileEnumeratorSetPending
instance O.OverloadedMethodInfo FileEnumeratorSetPendingMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.FileEnumerator.fileEnumeratorSetPending",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-FileEnumerator.html#v:fileEnumeratorSetPending"
})
#endif