{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Interfaces.File
(
#if defined(ENABLE_OVERLOADING)
FileCopyAsyncMethodInfo ,
#endif
File(..) ,
noFile ,
IsFile ,
toFile ,
#if defined(ENABLE_OVERLOADING)
ResolveFileMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
FileAppendToMethodInfo ,
#endif
fileAppendTo ,
#if defined(ENABLE_OVERLOADING)
FileAppendToAsyncMethodInfo ,
#endif
fileAppendToAsync ,
#if defined(ENABLE_OVERLOADING)
FileAppendToFinishMethodInfo ,
#endif
fileAppendToFinish ,
#if defined(ENABLE_OVERLOADING)
FileCopyMethodInfo ,
#endif
fileCopy ,
#if defined(ENABLE_OVERLOADING)
FileCopyAttributesMethodInfo ,
#endif
fileCopyAttributes ,
#if defined(ENABLE_OVERLOADING)
FileCopyFinishMethodInfo ,
#endif
fileCopyFinish ,
#if defined(ENABLE_OVERLOADING)
FileCreateMethodInfo ,
#endif
fileCreate ,
#if defined(ENABLE_OVERLOADING)
FileCreateAsyncMethodInfo ,
#endif
fileCreateAsync ,
#if defined(ENABLE_OVERLOADING)
FileCreateFinishMethodInfo ,
#endif
fileCreateFinish ,
#if defined(ENABLE_OVERLOADING)
FileCreateReadwriteMethodInfo ,
#endif
fileCreateReadwrite ,
#if defined(ENABLE_OVERLOADING)
FileCreateReadwriteAsyncMethodInfo ,
#endif
fileCreateReadwriteAsync ,
#if defined(ENABLE_OVERLOADING)
FileCreateReadwriteFinishMethodInfo ,
#endif
fileCreateReadwriteFinish ,
#if defined(ENABLE_OVERLOADING)
FileDeleteMethodInfo ,
#endif
fileDelete ,
#if defined(ENABLE_OVERLOADING)
FileDeleteAsyncMethodInfo ,
#endif
fileDeleteAsync ,
#if defined(ENABLE_OVERLOADING)
FileDeleteFinishMethodInfo ,
#endif
fileDeleteFinish ,
#if defined(ENABLE_OVERLOADING)
FileDupMethodInfo ,
#endif
fileDup ,
#if defined(ENABLE_OVERLOADING)
FileEjectMountableMethodInfo ,
#endif
fileEjectMountable ,
#if defined(ENABLE_OVERLOADING)
FileEjectMountableFinishMethodInfo ,
#endif
fileEjectMountableFinish ,
#if defined(ENABLE_OVERLOADING)
FileEjectMountableWithOperationMethodInfo,
#endif
fileEjectMountableWithOperation ,
#if defined(ENABLE_OVERLOADING)
FileEjectMountableWithOperationFinishMethodInfo,
#endif
fileEjectMountableWithOperationFinish ,
#if defined(ENABLE_OVERLOADING)
FileEnumerateChildrenMethodInfo ,
#endif
fileEnumerateChildren ,
#if defined(ENABLE_OVERLOADING)
FileEnumerateChildrenAsyncMethodInfo ,
#endif
fileEnumerateChildrenAsync ,
#if defined(ENABLE_OVERLOADING)
FileEnumerateChildrenFinishMethodInfo ,
#endif
fileEnumerateChildrenFinish ,
#if defined(ENABLE_OVERLOADING)
FileEqualMethodInfo ,
#endif
fileEqual ,
#if defined(ENABLE_OVERLOADING)
FileFindEnclosingMountMethodInfo ,
#endif
fileFindEnclosingMount ,
#if defined(ENABLE_OVERLOADING)
FileFindEnclosingMountAsyncMethodInfo ,
#endif
fileFindEnclosingMountAsync ,
#if defined(ENABLE_OVERLOADING)
FileFindEnclosingMountFinishMethodInfo ,
#endif
fileFindEnclosingMountFinish ,
#if defined(ENABLE_OVERLOADING)
FileGetBasenameMethodInfo ,
#endif
fileGetBasename ,
#if defined(ENABLE_OVERLOADING)
FileGetChildMethodInfo ,
#endif
fileGetChild ,
#if defined(ENABLE_OVERLOADING)
FileGetChildForDisplayNameMethodInfo ,
#endif
fileGetChildForDisplayName ,
#if defined(ENABLE_OVERLOADING)
FileGetParentMethodInfo ,
#endif
fileGetParent ,
#if defined(ENABLE_OVERLOADING)
FileGetParseNameMethodInfo ,
#endif
fileGetParseName ,
#if defined(ENABLE_OVERLOADING)
FileGetPathMethodInfo ,
#endif
fileGetPath ,
#if defined(ENABLE_OVERLOADING)
FileGetRelativePathMethodInfo ,
#endif
fileGetRelativePath ,
#if defined(ENABLE_OVERLOADING)
FileGetUriMethodInfo ,
#endif
fileGetUri ,
#if defined(ENABLE_OVERLOADING)
FileGetUriSchemeMethodInfo ,
#endif
fileGetUriScheme ,
#if defined(ENABLE_OVERLOADING)
FileHasParentMethodInfo ,
#endif
fileHasParent ,
#if defined(ENABLE_OVERLOADING)
FileHasPrefixMethodInfo ,
#endif
fileHasPrefix ,
#if defined(ENABLE_OVERLOADING)
FileHasUriSchemeMethodInfo ,
#endif
fileHasUriScheme ,
#if defined(ENABLE_OVERLOADING)
FileHashMethodInfo ,
#endif
fileHash ,
#if defined(ENABLE_OVERLOADING)
FileIsNativeMethodInfo ,
#endif
fileIsNative ,
#if defined(ENABLE_OVERLOADING)
FileLoadBytesMethodInfo ,
#endif
fileLoadBytes ,
#if defined(ENABLE_OVERLOADING)
FileLoadBytesAsyncMethodInfo ,
#endif
fileLoadBytesAsync ,
#if defined(ENABLE_OVERLOADING)
FileLoadBytesFinishMethodInfo ,
#endif
fileLoadBytesFinish ,
#if defined(ENABLE_OVERLOADING)
FileLoadContentsMethodInfo ,
#endif
fileLoadContents ,
#if defined(ENABLE_OVERLOADING)
FileLoadContentsAsyncMethodInfo ,
#endif
fileLoadContentsAsync ,
#if defined(ENABLE_OVERLOADING)
FileLoadContentsFinishMethodInfo ,
#endif
fileLoadContentsFinish ,
#if defined(ENABLE_OVERLOADING)
FileLoadPartialContentsFinishMethodInfo ,
#endif
fileLoadPartialContentsFinish ,
#if defined(ENABLE_OVERLOADING)
FileMakeDirectoryMethodInfo ,
#endif
fileMakeDirectory ,
#if defined(ENABLE_OVERLOADING)
FileMakeDirectoryAsyncMethodInfo ,
#endif
fileMakeDirectoryAsync ,
#if defined(ENABLE_OVERLOADING)
FileMakeDirectoryFinishMethodInfo ,
#endif
fileMakeDirectoryFinish ,
#if defined(ENABLE_OVERLOADING)
FileMakeDirectoryWithParentsMethodInfo ,
#endif
fileMakeDirectoryWithParents ,
#if defined(ENABLE_OVERLOADING)
FileMakeSymbolicLinkMethodInfo ,
#endif
fileMakeSymbolicLink ,
#if defined(ENABLE_OVERLOADING)
FileMeasureDiskUsageFinishMethodInfo ,
#endif
fileMeasureDiskUsageFinish ,
#if defined(ENABLE_OVERLOADING)
FileMonitorMethodInfo ,
#endif
fileMonitor ,
#if defined(ENABLE_OVERLOADING)
FileMonitorDirectoryMethodInfo ,
#endif
fileMonitorDirectory ,
#if defined(ENABLE_OVERLOADING)
FileMonitorFileMethodInfo ,
#endif
fileMonitorFile ,
#if defined(ENABLE_OVERLOADING)
FileMountEnclosingVolumeMethodInfo ,
#endif
fileMountEnclosingVolume ,
#if defined(ENABLE_OVERLOADING)
FileMountEnclosingVolumeFinishMethodInfo,
#endif
fileMountEnclosingVolumeFinish ,
#if defined(ENABLE_OVERLOADING)
FileMountMountableMethodInfo ,
#endif
fileMountMountable ,
#if defined(ENABLE_OVERLOADING)
FileMountMountableFinishMethodInfo ,
#endif
fileMountMountableFinish ,
#if defined(ENABLE_OVERLOADING)
FileMoveMethodInfo ,
#endif
fileMove ,
fileNewForCommandlineArg ,
fileNewForCommandlineArgAndCwd ,
fileNewForPath ,
fileNewForUri ,
fileNewTmp ,
#if defined(ENABLE_OVERLOADING)
FileOpenReadwriteMethodInfo ,
#endif
fileOpenReadwrite ,
#if defined(ENABLE_OVERLOADING)
FileOpenReadwriteAsyncMethodInfo ,
#endif
fileOpenReadwriteAsync ,
#if defined(ENABLE_OVERLOADING)
FileOpenReadwriteFinishMethodInfo ,
#endif
fileOpenReadwriteFinish ,
fileParseName ,
#if defined(ENABLE_OVERLOADING)
FilePeekPathMethodInfo ,
#endif
filePeekPath ,
#if defined(ENABLE_OVERLOADING)
FilePollMountableMethodInfo ,
#endif
filePollMountable ,
#if defined(ENABLE_OVERLOADING)
FilePollMountableFinishMethodInfo ,
#endif
filePollMountableFinish ,
#if defined(ENABLE_OVERLOADING)
FileQueryDefaultHandlerMethodInfo ,
#endif
fileQueryDefaultHandler ,
#if defined(ENABLE_OVERLOADING)
FileQueryDefaultHandlerAsyncMethodInfo ,
#endif
fileQueryDefaultHandlerAsync ,
#if defined(ENABLE_OVERLOADING)
FileQueryDefaultHandlerFinishMethodInfo ,
#endif
fileQueryDefaultHandlerFinish ,
#if defined(ENABLE_OVERLOADING)
FileQueryExistsMethodInfo ,
#endif
fileQueryExists ,
#if defined(ENABLE_OVERLOADING)
FileQueryFileTypeMethodInfo ,
#endif
fileQueryFileType ,
#if defined(ENABLE_OVERLOADING)
FileQueryFilesystemInfoMethodInfo ,
#endif
fileQueryFilesystemInfo ,
#if defined(ENABLE_OVERLOADING)
FileQueryFilesystemInfoAsyncMethodInfo ,
#endif
fileQueryFilesystemInfoAsync ,
#if defined(ENABLE_OVERLOADING)
FileQueryFilesystemInfoFinishMethodInfo ,
#endif
fileQueryFilesystemInfoFinish ,
#if defined(ENABLE_OVERLOADING)
FileQueryInfoMethodInfo ,
#endif
fileQueryInfo ,
#if defined(ENABLE_OVERLOADING)
FileQueryInfoAsyncMethodInfo ,
#endif
fileQueryInfoAsync ,
#if defined(ENABLE_OVERLOADING)
FileQueryInfoFinishMethodInfo ,
#endif
fileQueryInfoFinish ,
#if defined(ENABLE_OVERLOADING)
FileQuerySettableAttributesMethodInfo ,
#endif
fileQuerySettableAttributes ,
#if defined(ENABLE_OVERLOADING)
FileQueryWritableNamespacesMethodInfo ,
#endif
fileQueryWritableNamespaces ,
#if defined(ENABLE_OVERLOADING)
FileReadMethodInfo ,
#endif
fileRead ,
#if defined(ENABLE_OVERLOADING)
FileReadAsyncMethodInfo ,
#endif
fileReadAsync ,
#if defined(ENABLE_OVERLOADING)
FileReadFinishMethodInfo ,
#endif
fileReadFinish ,
#if defined(ENABLE_OVERLOADING)
FileReplaceMethodInfo ,
#endif
fileReplace ,
#if defined(ENABLE_OVERLOADING)
FileReplaceAsyncMethodInfo ,
#endif
fileReplaceAsync ,
#if defined(ENABLE_OVERLOADING)
FileReplaceContentsMethodInfo ,
#endif
fileReplaceContents ,
#if defined(ENABLE_OVERLOADING)
FileReplaceContentsAsyncMethodInfo ,
#endif
fileReplaceContentsAsync ,
#if defined(ENABLE_OVERLOADING)
FileReplaceContentsBytesAsyncMethodInfo ,
#endif
fileReplaceContentsBytesAsync ,
#if defined(ENABLE_OVERLOADING)
FileReplaceContentsFinishMethodInfo ,
#endif
fileReplaceContentsFinish ,
#if defined(ENABLE_OVERLOADING)
FileReplaceFinishMethodInfo ,
#endif
fileReplaceFinish ,
#if defined(ENABLE_OVERLOADING)
FileReplaceReadwriteMethodInfo ,
#endif
fileReplaceReadwrite ,
#if defined(ENABLE_OVERLOADING)
FileReplaceReadwriteAsyncMethodInfo ,
#endif
fileReplaceReadwriteAsync ,
#if defined(ENABLE_OVERLOADING)
FileReplaceReadwriteFinishMethodInfo ,
#endif
fileReplaceReadwriteFinish ,
#if defined(ENABLE_OVERLOADING)
FileResolveRelativePathMethodInfo ,
#endif
fileResolveRelativePath ,
#if defined(ENABLE_OVERLOADING)
FileSetAttributeMethodInfo ,
#endif
fileSetAttribute ,
#if defined(ENABLE_OVERLOADING)
FileSetAttributeByteStringMethodInfo ,
#endif
fileSetAttributeByteString ,
#if defined(ENABLE_OVERLOADING)
FileSetAttributeInt32MethodInfo ,
#endif
fileSetAttributeInt32 ,
#if defined(ENABLE_OVERLOADING)
FileSetAttributeInt64MethodInfo ,
#endif
fileSetAttributeInt64 ,
#if defined(ENABLE_OVERLOADING)
FileSetAttributeStringMethodInfo ,
#endif
fileSetAttributeString ,
#if defined(ENABLE_OVERLOADING)
FileSetAttributeUint32MethodInfo ,
#endif
fileSetAttributeUint32 ,
#if defined(ENABLE_OVERLOADING)
FileSetAttributeUint64MethodInfo ,
#endif
fileSetAttributeUint64 ,
#if defined(ENABLE_OVERLOADING)
FileSetAttributesAsyncMethodInfo ,
#endif
fileSetAttributesAsync ,
#if defined(ENABLE_OVERLOADING)
FileSetAttributesFinishMethodInfo ,
#endif
fileSetAttributesFinish ,
#if defined(ENABLE_OVERLOADING)
FileSetAttributesFromInfoMethodInfo ,
#endif
fileSetAttributesFromInfo ,
#if defined(ENABLE_OVERLOADING)
FileSetDisplayNameMethodInfo ,
#endif
fileSetDisplayName ,
#if defined(ENABLE_OVERLOADING)
FileSetDisplayNameAsyncMethodInfo ,
#endif
fileSetDisplayNameAsync ,
#if defined(ENABLE_OVERLOADING)
FileSetDisplayNameFinishMethodInfo ,
#endif
fileSetDisplayNameFinish ,
#if defined(ENABLE_OVERLOADING)
FileStartMountableMethodInfo ,
#endif
fileStartMountable ,
#if defined(ENABLE_OVERLOADING)
FileStartMountableFinishMethodInfo ,
#endif
fileStartMountableFinish ,
#if defined(ENABLE_OVERLOADING)
FileStopMountableMethodInfo ,
#endif
fileStopMountable ,
#if defined(ENABLE_OVERLOADING)
FileStopMountableFinishMethodInfo ,
#endif
fileStopMountableFinish ,
#if defined(ENABLE_OVERLOADING)
FileSupportsThreadContextsMethodInfo ,
#endif
fileSupportsThreadContexts ,
#if defined(ENABLE_OVERLOADING)
FileTrashMethodInfo ,
#endif
fileTrash ,
#if defined(ENABLE_OVERLOADING)
FileTrashAsyncMethodInfo ,
#endif
fileTrashAsync ,
#if defined(ENABLE_OVERLOADING)
FileTrashFinishMethodInfo ,
#endif
fileTrashFinish ,
#if defined(ENABLE_OVERLOADING)
FileUnmountMountableMethodInfo ,
#endif
fileUnmountMountable ,
#if defined(ENABLE_OVERLOADING)
FileUnmountMountableFinishMethodInfo ,
#endif
fileUnmountMountableFinish ,
#if defined(ENABLE_OVERLOADING)
FileUnmountMountableWithOperationMethodInfo,
#endif
fileUnmountMountableWithOperation ,
#if defined(ENABLE_OVERLOADING)
FileUnmountMountableWithOperationFinishMethodInfo,
#endif
fileUnmountMountableWithOperationFinish ,
) 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.GLib.Structs.Bytes as GLib.Bytes
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.Mount as Gio.Mount
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.FileEnumerator as Gio.FileEnumerator
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.MountOperation as Gio.MountOperation
import {-# SOURCE #-} qualified GI.Gio.Structs.FileAttributeInfoList as Gio.FileAttributeInfoList
newtype File = File (ManagedPtr File)
deriving (File -> File -> Bool
(File -> File -> Bool) -> (File -> File -> Bool) -> Eq File
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: File -> File -> Bool
$c/= :: File -> File -> Bool
== :: File -> File -> Bool
$c== :: File -> File -> Bool
Eq)
noFile :: Maybe File
noFile :: Maybe File
noFile = Maybe File
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList File = FileSignalList
type FileSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_file_get_type"
c_g_file_get_type :: IO GType
instance GObject File where
gobjectType :: IO GType
gobjectType = IO GType
c_g_file_get_type
instance B.GValue.IsGValue File where
toGValue :: File -> IO GValue
toGValue o :: File
o = do
GType
gtype <- IO GType
c_g_file_get_type
File -> (Ptr File -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr File
o (GType -> (GValue -> Ptr File -> IO ()) -> Ptr File -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr File -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO File
fromGValue gv :: GValue
gv = do
Ptr File
ptr <- GValue -> IO (Ptr File)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr File)
(ManagedPtr File -> File) -> Ptr File -> IO File
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr File -> File
File Ptr File
ptr
class (GObject o, O.IsDescendantOf File o) => IsFile o
instance (GObject o, O.IsDescendantOf File o) => IsFile o
instance O.HasParentTypes File
type instance O.ParentTypes File = '[GObject.Object.Object]
toFile :: (MonadIO m, IsFile o) => o -> m File
toFile :: o -> m File
toFile = IO File -> m File
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO File -> m File) -> (o -> IO File) -> o -> m File
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr File -> File) -> o -> IO File
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr File -> File
File
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList File
type instance O.AttributeList File = FileAttributeList
type FileAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveFileMethod (t :: Symbol) (o :: *) :: * where
ResolveFileMethod "appendTo" o = FileAppendToMethodInfo
ResolveFileMethod "appendToAsync" o = FileAppendToAsyncMethodInfo
ResolveFileMethod "appendToFinish" o = FileAppendToFinishMethodInfo
ResolveFileMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveFileMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveFileMethod "copy" o = FileCopyMethodInfo
ResolveFileMethod "copyAsync" o = FileCopyAsyncMethodInfo
ResolveFileMethod "copyAttributes" o = FileCopyAttributesMethodInfo
ResolveFileMethod "copyFinish" o = FileCopyFinishMethodInfo
ResolveFileMethod "create" o = FileCreateMethodInfo
ResolveFileMethod "createAsync" o = FileCreateAsyncMethodInfo
ResolveFileMethod "createFinish" o = FileCreateFinishMethodInfo
ResolveFileMethod "createReadwrite" o = FileCreateReadwriteMethodInfo
ResolveFileMethod "createReadwriteAsync" o = FileCreateReadwriteAsyncMethodInfo
ResolveFileMethod "createReadwriteFinish" o = FileCreateReadwriteFinishMethodInfo
ResolveFileMethod "delete" o = FileDeleteMethodInfo
ResolveFileMethod "deleteAsync" o = FileDeleteAsyncMethodInfo
ResolveFileMethod "deleteFinish" o = FileDeleteFinishMethodInfo
ResolveFileMethod "dup" o = FileDupMethodInfo
ResolveFileMethod "ejectMountable" o = FileEjectMountableMethodInfo
ResolveFileMethod "ejectMountableFinish" o = FileEjectMountableFinishMethodInfo
ResolveFileMethod "ejectMountableWithOperation" o = FileEjectMountableWithOperationMethodInfo
ResolveFileMethod "ejectMountableWithOperationFinish" o = FileEjectMountableWithOperationFinishMethodInfo
ResolveFileMethod "enumerateChildren" o = FileEnumerateChildrenMethodInfo
ResolveFileMethod "enumerateChildrenAsync" o = FileEnumerateChildrenAsyncMethodInfo
ResolveFileMethod "enumerateChildrenFinish" o = FileEnumerateChildrenFinishMethodInfo
ResolveFileMethod "equal" o = FileEqualMethodInfo
ResolveFileMethod "findEnclosingMount" o = FileFindEnclosingMountMethodInfo
ResolveFileMethod "findEnclosingMountAsync" o = FileFindEnclosingMountAsyncMethodInfo
ResolveFileMethod "findEnclosingMountFinish" o = FileFindEnclosingMountFinishMethodInfo
ResolveFileMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveFileMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveFileMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveFileMethod "hasParent" o = FileHasParentMethodInfo
ResolveFileMethod "hasPrefix" o = FileHasPrefixMethodInfo
ResolveFileMethod "hasUriScheme" o = FileHasUriSchemeMethodInfo
ResolveFileMethod "hash" o = FileHashMethodInfo
ResolveFileMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveFileMethod "isNative" o = FileIsNativeMethodInfo
ResolveFileMethod "loadBytes" o = FileLoadBytesMethodInfo
ResolveFileMethod "loadBytesAsync" o = FileLoadBytesAsyncMethodInfo
ResolveFileMethod "loadBytesFinish" o = FileLoadBytesFinishMethodInfo
ResolveFileMethod "loadContents" o = FileLoadContentsMethodInfo
ResolveFileMethod "loadContentsAsync" o = FileLoadContentsAsyncMethodInfo
ResolveFileMethod "loadContentsFinish" o = FileLoadContentsFinishMethodInfo
ResolveFileMethod "loadPartialContentsFinish" o = FileLoadPartialContentsFinishMethodInfo
ResolveFileMethod "makeDirectory" o = FileMakeDirectoryMethodInfo
ResolveFileMethod "makeDirectoryAsync" o = FileMakeDirectoryAsyncMethodInfo
ResolveFileMethod "makeDirectoryFinish" o = FileMakeDirectoryFinishMethodInfo
ResolveFileMethod "makeDirectoryWithParents" o = FileMakeDirectoryWithParentsMethodInfo
ResolveFileMethod "makeSymbolicLink" o = FileMakeSymbolicLinkMethodInfo
ResolveFileMethod "measureDiskUsageFinish" o = FileMeasureDiskUsageFinishMethodInfo
ResolveFileMethod "monitor" o = FileMonitorMethodInfo
ResolveFileMethod "monitorDirectory" o = FileMonitorDirectoryMethodInfo
ResolveFileMethod "monitorFile" o = FileMonitorFileMethodInfo
ResolveFileMethod "mountEnclosingVolume" o = FileMountEnclosingVolumeMethodInfo
ResolveFileMethod "mountEnclosingVolumeFinish" o = FileMountEnclosingVolumeFinishMethodInfo
ResolveFileMethod "mountMountable" o = FileMountMountableMethodInfo
ResolveFileMethod "mountMountableFinish" o = FileMountMountableFinishMethodInfo
ResolveFileMethod "move" o = FileMoveMethodInfo
ResolveFileMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveFileMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveFileMethod "openReadwrite" o = FileOpenReadwriteMethodInfo
ResolveFileMethod "openReadwriteAsync" o = FileOpenReadwriteAsyncMethodInfo
ResolveFileMethod "openReadwriteFinish" o = FileOpenReadwriteFinishMethodInfo
ResolveFileMethod "peekPath" o = FilePeekPathMethodInfo
ResolveFileMethod "pollMountable" o = FilePollMountableMethodInfo
ResolveFileMethod "pollMountableFinish" o = FilePollMountableFinishMethodInfo
ResolveFileMethod "queryDefaultHandler" o = FileQueryDefaultHandlerMethodInfo
ResolveFileMethod "queryDefaultHandlerAsync" o = FileQueryDefaultHandlerAsyncMethodInfo
ResolveFileMethod "queryDefaultHandlerFinish" o = FileQueryDefaultHandlerFinishMethodInfo
ResolveFileMethod "queryExists" o = FileQueryExistsMethodInfo
ResolveFileMethod "queryFileType" o = FileQueryFileTypeMethodInfo
ResolveFileMethod "queryFilesystemInfo" o = FileQueryFilesystemInfoMethodInfo
ResolveFileMethod "queryFilesystemInfoAsync" o = FileQueryFilesystemInfoAsyncMethodInfo
ResolveFileMethod "queryFilesystemInfoFinish" o = FileQueryFilesystemInfoFinishMethodInfo
ResolveFileMethod "queryInfo" o = FileQueryInfoMethodInfo
ResolveFileMethod "queryInfoAsync" o = FileQueryInfoAsyncMethodInfo
ResolveFileMethod "queryInfoFinish" o = FileQueryInfoFinishMethodInfo
ResolveFileMethod "querySettableAttributes" o = FileQuerySettableAttributesMethodInfo
ResolveFileMethod "queryWritableNamespaces" o = FileQueryWritableNamespacesMethodInfo
ResolveFileMethod "read" o = FileReadMethodInfo
ResolveFileMethod "readAsync" o = FileReadAsyncMethodInfo
ResolveFileMethod "readFinish" o = FileReadFinishMethodInfo
ResolveFileMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveFileMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveFileMethod "replace" o = FileReplaceMethodInfo
ResolveFileMethod "replaceAsync" o = FileReplaceAsyncMethodInfo
ResolveFileMethod "replaceContents" o = FileReplaceContentsMethodInfo
ResolveFileMethod "replaceContentsAsync" o = FileReplaceContentsAsyncMethodInfo
ResolveFileMethod "replaceContentsBytesAsync" o = FileReplaceContentsBytesAsyncMethodInfo
ResolveFileMethod "replaceContentsFinish" o = FileReplaceContentsFinishMethodInfo
ResolveFileMethod "replaceFinish" o = FileReplaceFinishMethodInfo
ResolveFileMethod "replaceReadwrite" o = FileReplaceReadwriteMethodInfo
ResolveFileMethod "replaceReadwriteAsync" o = FileReplaceReadwriteAsyncMethodInfo
ResolveFileMethod "replaceReadwriteFinish" o = FileReplaceReadwriteFinishMethodInfo
ResolveFileMethod "resolveRelativePath" o = FileResolveRelativePathMethodInfo
ResolveFileMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveFileMethod "startMountable" o = FileStartMountableMethodInfo
ResolveFileMethod "startMountableFinish" o = FileStartMountableFinishMethodInfo
ResolveFileMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveFileMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveFileMethod "stopMountable" o = FileStopMountableMethodInfo
ResolveFileMethod "stopMountableFinish" o = FileStopMountableFinishMethodInfo
ResolveFileMethod "supportsThreadContexts" o = FileSupportsThreadContextsMethodInfo
ResolveFileMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveFileMethod "trash" o = FileTrashMethodInfo
ResolveFileMethod "trashAsync" o = FileTrashAsyncMethodInfo
ResolveFileMethod "trashFinish" o = FileTrashFinishMethodInfo
ResolveFileMethod "unmountMountable" o = FileUnmountMountableMethodInfo
ResolveFileMethod "unmountMountableFinish" o = FileUnmountMountableFinishMethodInfo
ResolveFileMethod "unmountMountableWithOperation" o = FileUnmountMountableWithOperationMethodInfo
ResolveFileMethod "unmountMountableWithOperationFinish" o = FileUnmountMountableWithOperationFinishMethodInfo
ResolveFileMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveFileMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveFileMethod "getBasename" o = FileGetBasenameMethodInfo
ResolveFileMethod "getChild" o = FileGetChildMethodInfo
ResolveFileMethod "getChildForDisplayName" o = FileGetChildForDisplayNameMethodInfo
ResolveFileMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveFileMethod "getParent" o = FileGetParentMethodInfo
ResolveFileMethod "getParseName" o = FileGetParseNameMethodInfo
ResolveFileMethod "getPath" o = FileGetPathMethodInfo
ResolveFileMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveFileMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveFileMethod "getRelativePath" o = FileGetRelativePathMethodInfo
ResolveFileMethod "getUri" o = FileGetUriMethodInfo
ResolveFileMethod "getUriScheme" o = FileGetUriSchemeMethodInfo
ResolveFileMethod "setAttribute" o = FileSetAttributeMethodInfo
ResolveFileMethod "setAttributeByteString" o = FileSetAttributeByteStringMethodInfo
ResolveFileMethod "setAttributeInt32" o = FileSetAttributeInt32MethodInfo
ResolveFileMethod "setAttributeInt64" o = FileSetAttributeInt64MethodInfo
ResolveFileMethod "setAttributeString" o = FileSetAttributeStringMethodInfo
ResolveFileMethod "setAttributeUint32" o = FileSetAttributeUint32MethodInfo
ResolveFileMethod "setAttributeUint64" o = FileSetAttributeUint64MethodInfo
ResolveFileMethod "setAttributesAsync" o = FileSetAttributesAsyncMethodInfo
ResolveFileMethod "setAttributesFinish" o = FileSetAttributesFinishMethodInfo
ResolveFileMethod "setAttributesFromInfo" o = FileSetAttributesFromInfoMethodInfo
ResolveFileMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveFileMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveFileMethod "setDisplayName" o = FileSetDisplayNameMethodInfo
ResolveFileMethod "setDisplayNameAsync" o = FileSetDisplayNameAsyncMethodInfo
ResolveFileMethod "setDisplayNameFinish" o = FileSetDisplayNameFinishMethodInfo
ResolveFileMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveFileMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveFileMethod t File, O.MethodInfo info File p) => OL.IsLabel t (File -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
foreign import ccall "g_file_append_to" g_file_append_to ::
Ptr File ->
CUInt ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr Gio.FileOutputStream.FileOutputStream)
fileAppendTo ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a, Gio.Cancellable.IsCancellable b) =>
a
-> [Gio.Flags.FileCreateFlags]
-> Maybe (b)
-> m Gio.FileOutputStream.FileOutputStream
fileAppendTo :: a -> [FileCreateFlags] -> Maybe b -> m FileOutputStream
fileAppendTo file :: a
file flags :: [FileCreateFlags]
flags cancellable :: Maybe b
cancellable = IO FileOutputStream -> m FileOutputStream
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FileOutputStream -> m FileOutputStream)
-> IO FileOutputStream -> m FileOutputStream
forall a b. (a -> b) -> a -> b
$ do
Ptr File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
let flags' :: CUInt
flags' = [FileCreateFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [FileCreateFlags]
flags
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 FileOutputStream -> IO () -> IO FileOutputStream
forall a b. IO a -> IO b -> IO a
onException (do
Ptr FileOutputStream
result <- (Ptr (Ptr GError) -> IO (Ptr FileOutputStream))
-> IO (Ptr FileOutputStream)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr FileOutputStream))
-> IO (Ptr FileOutputStream))
-> (Ptr (Ptr GError) -> IO (Ptr FileOutputStream))
-> IO (Ptr FileOutputStream)
forall a b. (a -> b) -> a -> b
$ Ptr File
-> CUInt
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr FileOutputStream)
g_file_append_to Ptr File
file' CUInt
flags' Ptr Cancellable
maybeCancellable
Text -> Ptr FileOutputStream -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "fileAppendTo" Ptr FileOutputStream
result
FileOutputStream
result' <- ((ManagedPtr FileOutputStream -> FileOutputStream)
-> Ptr FileOutputStream -> IO FileOutputStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr FileOutputStream -> FileOutputStream
Gio.FileOutputStream.FileOutputStream) Ptr FileOutputStream
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
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
FileOutputStream -> IO FileOutputStream
forall (m :: * -> *) a. Monad m => a -> m a
return FileOutputStream
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data FileAppendToMethodInfo
instance (signature ~ ([Gio.Flags.FileCreateFlags] -> Maybe (b) -> m Gio.FileOutputStream.FileOutputStream), MonadIO m, IsFile a, Gio.Cancellable.IsCancellable b) => O.MethodInfo FileAppendToMethodInfo a signature where
overloadedMethod = fileAppendTo
#endif
foreign import ccall "g_file_append_to_async" g_file_append_to_async ::
Ptr File ->
CUInt ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
fileAppendToAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a, Gio.Cancellable.IsCancellable b) =>
a
-> [Gio.Flags.FileCreateFlags]
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
fileAppendToAsync :: a
-> [FileCreateFlags]
-> Int32
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
fileAppendToAsync file :: a
file flags :: [FileCreateFlags]
flags 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 File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
let flags' :: CUInt
flags' = [FileCreateFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [FileCreateFlags]
flags
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 File
-> CUInt
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_file_append_to_async Ptr File
file' CUInt
flags' 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
file
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
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FileAppendToAsyncMethodInfo
instance (signature ~ ([Gio.Flags.FileCreateFlags] -> Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsFile a, Gio.Cancellable.IsCancellable b) => O.MethodInfo FileAppendToAsyncMethodInfo a signature where
overloadedMethod = fileAppendToAsync
#endif
foreign import ccall "g_file_append_to_finish" g_file_append_to_finish ::
Ptr File ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr Gio.FileOutputStream.FileOutputStream)
fileAppendToFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m Gio.FileOutputStream.FileOutputStream
fileAppendToFinish :: a -> b -> m FileOutputStream
fileAppendToFinish file :: a
file res :: b
res = IO FileOutputStream -> m FileOutputStream
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FileOutputStream -> m FileOutputStream)
-> IO FileOutputStream -> m FileOutputStream
forall a b. (a -> b) -> a -> b
$ do
Ptr File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO FileOutputStream -> IO () -> IO FileOutputStream
forall a b. IO a -> IO b -> IO a
onException (do
Ptr FileOutputStream
result <- (Ptr (Ptr GError) -> IO (Ptr FileOutputStream))
-> IO (Ptr FileOutputStream)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr FileOutputStream))
-> IO (Ptr FileOutputStream))
-> (Ptr (Ptr GError) -> IO (Ptr FileOutputStream))
-> IO (Ptr FileOutputStream)
forall a b. (a -> b) -> a -> b
$ Ptr File
-> Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr FileOutputStream)
g_file_append_to_finish Ptr File
file' Ptr AsyncResult
res'
Text -> Ptr FileOutputStream -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "fileAppendToFinish" Ptr FileOutputStream
result
FileOutputStream
result' <- ((ManagedPtr FileOutputStream -> FileOutputStream)
-> Ptr FileOutputStream -> IO FileOutputStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr FileOutputStream -> FileOutputStream
Gio.FileOutputStream.FileOutputStream) Ptr FileOutputStream
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
FileOutputStream -> IO FileOutputStream
forall (m :: * -> *) a. Monad m => a -> m a
return FileOutputStream
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data FileAppendToFinishMethodInfo
instance (signature ~ (b -> m Gio.FileOutputStream.FileOutputStream), MonadIO m, IsFile a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo FileAppendToFinishMethodInfo a signature where
overloadedMethod = fileAppendToFinish
#endif
foreign import ccall "g_file_copy" g_file_copy ::
Ptr File ->
Ptr File ->
CUInt ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_FileProgressCallback ->
Ptr () ->
Ptr (Ptr GError) ->
IO CInt
fileCopy ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a, IsFile b, Gio.Cancellable.IsCancellable c) =>
a
-> b
-> [Gio.Flags.FileCopyFlags]
-> Maybe (c)
-> Maybe (Gio.Callbacks.FileProgressCallback)
-> m ()
fileCopy :: a
-> b
-> [FileCopyFlags]
-> Maybe c
-> Maybe FileProgressCallback
-> m ()
fileCopy source :: a
source destination :: b
destination flags :: [FileCopyFlags]
flags cancellable :: Maybe c
cancellable progressCallback :: Maybe FileProgressCallback
progressCallback = 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 File
source' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
source
Ptr File
destination' <- b -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
destination
let flags' :: CUInt
flags' = [FileCopyFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [FileCopyFlags]
flags
Ptr Cancellable
maybeCancellable <- case Maybe c
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 :: c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_FileProgressCallback
maybeProgressCallback <- case Maybe FileProgressCallback
progressCallback of
Nothing -> FunPtr C_FileProgressCallback -> IO (FunPtr C_FileProgressCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_FileProgressCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jProgressCallback :: FileProgressCallback
jProgressCallback -> do
FunPtr C_FileProgressCallback
jProgressCallback' <- C_FileProgressCallback -> IO (FunPtr C_FileProgressCallback)
Gio.Callbacks.mk_FileProgressCallback (Maybe (Ptr (FunPtr C_FileProgressCallback))
-> C_FileProgressCallback -> C_FileProgressCallback
Gio.Callbacks.wrap_FileProgressCallback Maybe (Ptr (FunPtr C_FileProgressCallback))
forall a. Maybe a
Nothing (FileProgressCallback -> C_FileProgressCallback
Gio.Callbacks.drop_closures_FileProgressCallback FileProgressCallback
jProgressCallback))
FunPtr C_FileProgressCallback -> IO (FunPtr C_FileProgressCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_FileProgressCallback
jProgressCallback'
let progressCallbackData :: Ptr a
progressCallbackData = Ptr a
forall a. Ptr a
nullPtr
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr File
-> Ptr File
-> CUInt
-> Ptr Cancellable
-> FunPtr C_FileProgressCallback
-> Ptr ()
-> Ptr (Ptr GError)
-> IO CInt
g_file_copy Ptr File
source' Ptr File
destination' CUInt
flags' Ptr Cancellable
maybeCancellable FunPtr C_FileProgressCallback
maybeProgressCallback Ptr ()
forall a. Ptr a
progressCallbackData
Ptr Any -> IO ()
forall a. Ptr a -> IO ()
safeFreeFunPtr (Ptr Any -> IO ()) -> Ptr Any -> IO ()
forall a b. (a -> b) -> a -> b
$ FunPtr C_FileProgressCallback -> Ptr Any
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_FileProgressCallback
maybeProgressCallback
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
source
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
destination
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
Ptr Any -> IO ()
forall a. Ptr a -> IO ()
safeFreeFunPtr (Ptr Any -> IO ()) -> Ptr Any -> IO ()
forall a b. (a -> b) -> a -> b
$ FunPtr C_FileProgressCallback -> Ptr Any
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_FileProgressCallback
maybeProgressCallback
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data FileCopyMethodInfo
instance (signature ~ (b -> [Gio.Flags.FileCopyFlags] -> Maybe (c) -> Maybe (Gio.Callbacks.FileProgressCallback) -> m ()), MonadIO m, IsFile a, IsFile b, Gio.Cancellable.IsCancellable c) => O.MethodInfo FileCopyMethodInfo a signature where
overloadedMethod = fileCopy
#endif
#if defined(ENABLE_OVERLOADING)
data FileCopyAsyncMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "copyAsync" File) => O.MethodInfo FileCopyAsyncMethodInfo o p where
overloadedMethod = undefined
#endif
foreign import ccall "g_file_copy_attributes" g_file_copy_attributes ::
Ptr File ->
Ptr File ->
CUInt ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
fileCopyAttributes ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a, IsFile b, Gio.Cancellable.IsCancellable c) =>
a
-> b
-> [Gio.Flags.FileCopyFlags]
-> Maybe (c)
-> m ()
fileCopyAttributes :: a -> b -> [FileCopyFlags] -> Maybe c -> m ()
fileCopyAttributes source :: a
source destination :: b
destination flags :: [FileCopyFlags]
flags cancellable :: Maybe c
cancellable = 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 File
source' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
source
Ptr File
destination' <- b -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
destination
let flags' :: CUInt
flags' = [FileCopyFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [FileCopyFlags]
flags
Ptr Cancellable
maybeCancellable <- case Maybe c
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 :: c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr File
-> Ptr File
-> CUInt
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO CInt
g_file_copy_attributes Ptr File
source' Ptr File
destination' CUInt
flags' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
source
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
destination
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data FileCopyAttributesMethodInfo
instance (signature ~ (b -> [Gio.Flags.FileCopyFlags] -> Maybe (c) -> m ()), MonadIO m, IsFile a, IsFile b, Gio.Cancellable.IsCancellable c) => O.MethodInfo FileCopyAttributesMethodInfo a signature where
overloadedMethod = fileCopyAttributes
#endif
foreign import ccall "g_file_copy_finish" g_file_copy_finish ::
Ptr File ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
fileCopyFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
fileCopyFinish :: a -> b -> m ()
fileCopyFinish file :: a
file res :: b
res = 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 File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr File -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
g_file_copy_finish Ptr File
file' Ptr AsyncResult
res'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data FileCopyFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsFile a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo FileCopyFinishMethodInfo a signature where
overloadedMethod = fileCopyFinish
#endif
foreign import ccall "g_file_create" g_file_create ::
Ptr File ->
CUInt ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr Gio.FileOutputStream.FileOutputStream)
fileCreate ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a, Gio.Cancellable.IsCancellable b) =>
a
-> [Gio.Flags.FileCreateFlags]
-> Maybe (b)
-> m Gio.FileOutputStream.FileOutputStream
fileCreate :: a -> [FileCreateFlags] -> Maybe b -> m FileOutputStream
fileCreate file :: a
file flags :: [FileCreateFlags]
flags cancellable :: Maybe b
cancellable = IO FileOutputStream -> m FileOutputStream
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FileOutputStream -> m FileOutputStream)
-> IO FileOutputStream -> m FileOutputStream
forall a b. (a -> b) -> a -> b
$ do
Ptr File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
let flags' :: CUInt
flags' = [FileCreateFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [FileCreateFlags]
flags
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 FileOutputStream -> IO () -> IO FileOutputStream
forall a b. IO a -> IO b -> IO a
onException (do
Ptr FileOutputStream
result <- (Ptr (Ptr GError) -> IO (Ptr FileOutputStream))
-> IO (Ptr FileOutputStream)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr FileOutputStream))
-> IO (Ptr FileOutputStream))
-> (Ptr (Ptr GError) -> IO (Ptr FileOutputStream))
-> IO (Ptr FileOutputStream)
forall a b. (a -> b) -> a -> b
$ Ptr File
-> CUInt
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr FileOutputStream)
g_file_create Ptr File
file' CUInt
flags' Ptr Cancellable
maybeCancellable
Text -> Ptr FileOutputStream -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "fileCreate" Ptr FileOutputStream
result
FileOutputStream
result' <- ((ManagedPtr FileOutputStream -> FileOutputStream)
-> Ptr FileOutputStream -> IO FileOutputStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr FileOutputStream -> FileOutputStream
Gio.FileOutputStream.FileOutputStream) Ptr FileOutputStream
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
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
FileOutputStream -> IO FileOutputStream
forall (m :: * -> *) a. Monad m => a -> m a
return FileOutputStream
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data FileCreateMethodInfo
instance (signature ~ ([Gio.Flags.FileCreateFlags] -> Maybe (b) -> m Gio.FileOutputStream.FileOutputStream), MonadIO m, IsFile a, Gio.Cancellable.IsCancellable b) => O.MethodInfo FileCreateMethodInfo a signature where
overloadedMethod = fileCreate
#endif
foreign import ccall "g_file_create_async" g_file_create_async ::
Ptr File ->
CUInt ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
fileCreateAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a, Gio.Cancellable.IsCancellable b) =>
a
-> [Gio.Flags.FileCreateFlags]
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
fileCreateAsync :: a
-> [FileCreateFlags]
-> Int32
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
fileCreateAsync file :: a
file flags :: [FileCreateFlags]
flags 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 File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
let flags' :: CUInt
flags' = [FileCreateFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [FileCreateFlags]
flags
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 File
-> CUInt
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_file_create_async Ptr File
file' CUInt
flags' 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
file
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
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FileCreateAsyncMethodInfo
instance (signature ~ ([Gio.Flags.FileCreateFlags] -> Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsFile a, Gio.Cancellable.IsCancellable b) => O.MethodInfo FileCreateAsyncMethodInfo a signature where
overloadedMethod = fileCreateAsync
#endif
foreign import ccall "g_file_create_finish" g_file_create_finish ::
Ptr File ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr Gio.FileOutputStream.FileOutputStream)
fileCreateFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m Gio.FileOutputStream.FileOutputStream
fileCreateFinish :: a -> b -> m FileOutputStream
fileCreateFinish file :: a
file res :: b
res = IO FileOutputStream -> m FileOutputStream
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FileOutputStream -> m FileOutputStream)
-> IO FileOutputStream -> m FileOutputStream
forall a b. (a -> b) -> a -> b
$ do
Ptr File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO FileOutputStream -> IO () -> IO FileOutputStream
forall a b. IO a -> IO b -> IO a
onException (do
Ptr FileOutputStream
result <- (Ptr (Ptr GError) -> IO (Ptr FileOutputStream))
-> IO (Ptr FileOutputStream)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr FileOutputStream))
-> IO (Ptr FileOutputStream))
-> (Ptr (Ptr GError) -> IO (Ptr FileOutputStream))
-> IO (Ptr FileOutputStream)
forall a b. (a -> b) -> a -> b
$ Ptr File
-> Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr FileOutputStream)
g_file_create_finish Ptr File
file' Ptr AsyncResult
res'
Text -> Ptr FileOutputStream -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "fileCreateFinish" Ptr FileOutputStream
result
FileOutputStream
result' <- ((ManagedPtr FileOutputStream -> FileOutputStream)
-> Ptr FileOutputStream -> IO FileOutputStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr FileOutputStream -> FileOutputStream
Gio.FileOutputStream.FileOutputStream) Ptr FileOutputStream
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
FileOutputStream -> IO FileOutputStream
forall (m :: * -> *) a. Monad m => a -> m a
return FileOutputStream
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data FileCreateFinishMethodInfo
instance (signature ~ (b -> m Gio.FileOutputStream.FileOutputStream), MonadIO m, IsFile a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo FileCreateFinishMethodInfo a signature where
overloadedMethod = fileCreateFinish
#endif
foreign import ccall "g_file_create_readwrite" g_file_create_readwrite ::
Ptr File ->
CUInt ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr Gio.FileIOStream.FileIOStream)
fileCreateReadwrite ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a, Gio.Cancellable.IsCancellable b) =>
a
-> [Gio.Flags.FileCreateFlags]
-> Maybe (b)
-> m Gio.FileIOStream.FileIOStream
fileCreateReadwrite :: a -> [FileCreateFlags] -> Maybe b -> m FileIOStream
fileCreateReadwrite file :: a
file flags :: [FileCreateFlags]
flags cancellable :: Maybe b
cancellable = IO FileIOStream -> m FileIOStream
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FileIOStream -> m FileIOStream)
-> IO FileIOStream -> m FileIOStream
forall a b. (a -> b) -> a -> b
$ do
Ptr File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
let flags' :: CUInt
flags' = [FileCreateFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [FileCreateFlags]
flags
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 FileIOStream -> IO () -> IO FileIOStream
forall a b. IO a -> IO b -> IO a
onException (do
Ptr FileIOStream
result <- (Ptr (Ptr GError) -> IO (Ptr FileIOStream))
-> IO (Ptr FileIOStream)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr FileIOStream))
-> IO (Ptr FileIOStream))
-> (Ptr (Ptr GError) -> IO (Ptr FileIOStream))
-> IO (Ptr FileIOStream)
forall a b. (a -> b) -> a -> b
$ Ptr File
-> CUInt
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr FileIOStream)
g_file_create_readwrite Ptr File
file' CUInt
flags' Ptr Cancellable
maybeCancellable
Text -> Ptr FileIOStream -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "fileCreateReadwrite" Ptr FileIOStream
result
FileIOStream
result' <- ((ManagedPtr FileIOStream -> FileIOStream)
-> Ptr FileIOStream -> IO FileIOStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr FileIOStream -> FileIOStream
Gio.FileIOStream.FileIOStream) Ptr FileIOStream
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
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
FileIOStream -> IO FileIOStream
forall (m :: * -> *) a. Monad m => a -> m a
return FileIOStream
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data FileCreateReadwriteMethodInfo
instance (signature ~ ([Gio.Flags.FileCreateFlags] -> Maybe (b) -> m Gio.FileIOStream.FileIOStream), MonadIO m, IsFile a, Gio.Cancellable.IsCancellable b) => O.MethodInfo FileCreateReadwriteMethodInfo a signature where
overloadedMethod = fileCreateReadwrite
#endif
foreign import ccall "g_file_create_readwrite_async" g_file_create_readwrite_async ::
Ptr File ->
CUInt ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
fileCreateReadwriteAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a, Gio.Cancellable.IsCancellable b) =>
a
-> [Gio.Flags.FileCreateFlags]
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
fileCreateReadwriteAsync :: a
-> [FileCreateFlags]
-> Int32
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
fileCreateReadwriteAsync file :: a
file flags :: [FileCreateFlags]
flags 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 File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
let flags' :: CUInt
flags' = [FileCreateFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [FileCreateFlags]
flags
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 File
-> CUInt
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_file_create_readwrite_async Ptr File
file' CUInt
flags' 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
file
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
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FileCreateReadwriteAsyncMethodInfo
instance (signature ~ ([Gio.Flags.FileCreateFlags] -> Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsFile a, Gio.Cancellable.IsCancellable b) => O.MethodInfo FileCreateReadwriteAsyncMethodInfo a signature where
overloadedMethod = fileCreateReadwriteAsync
#endif
foreign import ccall "g_file_create_readwrite_finish" g_file_create_readwrite_finish ::
Ptr File ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr Gio.FileIOStream.FileIOStream)
fileCreateReadwriteFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m Gio.FileIOStream.FileIOStream
fileCreateReadwriteFinish :: a -> b -> m FileIOStream
fileCreateReadwriteFinish file :: a
file res :: b
res = IO FileIOStream -> m FileIOStream
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FileIOStream -> m FileIOStream)
-> IO FileIOStream -> m FileIOStream
forall a b. (a -> b) -> a -> b
$ do
Ptr File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO FileIOStream -> IO () -> IO FileIOStream
forall a b. IO a -> IO b -> IO a
onException (do
Ptr FileIOStream
result <- (Ptr (Ptr GError) -> IO (Ptr FileIOStream))
-> IO (Ptr FileIOStream)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr FileIOStream))
-> IO (Ptr FileIOStream))
-> (Ptr (Ptr GError) -> IO (Ptr FileIOStream))
-> IO (Ptr FileIOStream)
forall a b. (a -> b) -> a -> b
$ Ptr File
-> Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr FileIOStream)
g_file_create_readwrite_finish Ptr File
file' Ptr AsyncResult
res'
Text -> Ptr FileIOStream -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "fileCreateReadwriteFinish" Ptr FileIOStream
result
FileIOStream
result' <- ((ManagedPtr FileIOStream -> FileIOStream)
-> Ptr FileIOStream -> IO FileIOStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr FileIOStream -> FileIOStream
Gio.FileIOStream.FileIOStream) Ptr FileIOStream
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
FileIOStream -> IO FileIOStream
forall (m :: * -> *) a. Monad m => a -> m a
return FileIOStream
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data FileCreateReadwriteFinishMethodInfo
instance (signature ~ (b -> m Gio.FileIOStream.FileIOStream), MonadIO m, IsFile a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo FileCreateReadwriteFinishMethodInfo a signature where
overloadedMethod = fileCreateReadwriteFinish
#endif
foreign import ccall "g_file_delete" g_file_delete ::
Ptr File ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
fileDelete ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m ()
fileDelete :: a -> Maybe b -> m ()
fileDelete file :: a
file cancellable :: Maybe b
cancellable = 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 File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
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 () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr File -> Ptr Cancellable -> Ptr (Ptr GError) -> IO CInt
g_file_delete Ptr File
file' Ptr Cancellable
maybeCancellable
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
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
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data FileDeleteMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsFile a, Gio.Cancellable.IsCancellable b) => O.MethodInfo FileDeleteMethodInfo a signature where
overloadedMethod = fileDelete
#endif
foreign import ccall "g_file_delete_async" g_file_delete_async ::
Ptr File ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
fileDeleteAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a, Gio.Cancellable.IsCancellable b) =>
a
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
fileDeleteAsync :: a -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
fileDeleteAsync file :: a
file 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 File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
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 File
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_file_delete_async Ptr File
file' 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
file
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
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FileDeleteAsyncMethodInfo
instance (signature ~ (Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsFile a, Gio.Cancellable.IsCancellable b) => O.MethodInfo FileDeleteAsyncMethodInfo a signature where
overloadedMethod = fileDeleteAsync
#endif
foreign import ccall "g_file_delete_finish" g_file_delete_finish ::
Ptr File ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
fileDeleteFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
fileDeleteFinish :: a -> b -> m ()
fileDeleteFinish file :: a
file result_ :: b
result_ = 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 File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr File -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
g_file_delete_finish Ptr File
file' Ptr AsyncResult
result_'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data FileDeleteFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsFile a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo FileDeleteFinishMethodInfo a signature where
overloadedMethod = fileDeleteFinish
#endif
foreign import ccall "g_file_dup" g_file_dup ::
Ptr File ->
IO (Ptr File)
fileDup ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a) =>
a
-> m File
fileDup :: a -> m File
fileDup file :: a
file = IO File -> m File
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
Ptr File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
Ptr File
result <- Ptr File -> IO (Ptr File)
g_file_dup Ptr File
file'
Text -> Ptr File -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "fileDup" Ptr File
result
File
result' <- ((ManagedPtr File -> File) -> Ptr File -> IO File
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr File -> File
File) Ptr File
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
File -> IO File
forall (m :: * -> *) a. Monad m => a -> m a
return File
result'
#if defined(ENABLE_OVERLOADING)
data FileDupMethodInfo
instance (signature ~ (m File), MonadIO m, IsFile a) => O.MethodInfo FileDupMethodInfo a signature where
overloadedMethod = fileDup
#endif
foreign import ccall "g_file_eject_mountable" g_file_eject_mountable ::
Ptr File ->
CUInt ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
{-# DEPRECATED fileEjectMountable ["(Since version 2.22)","Use 'GI.Gio.Interfaces.File.fileEjectMountableWithOperation' instead."] #-}
fileEjectMountable ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a, Gio.Cancellable.IsCancellable b) =>
a
-> [Gio.Flags.MountUnmountFlags]
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
fileEjectMountable :: a
-> [MountUnmountFlags]
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
fileEjectMountable file :: a
file flags :: [MountUnmountFlags]
flags 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 File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
let flags' :: CUInt
flags' = [MountUnmountFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [MountUnmountFlags]
flags
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 File
-> CUInt
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_file_eject_mountable Ptr File
file' CUInt
flags' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
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
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FileEjectMountableMethodInfo
instance (signature ~ ([Gio.Flags.MountUnmountFlags] -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsFile a, Gio.Cancellable.IsCancellable b) => O.MethodInfo FileEjectMountableMethodInfo a signature where
overloadedMethod = fileEjectMountable
#endif
foreign import ccall "g_file_eject_mountable_finish" g_file_eject_mountable_finish ::
Ptr File ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
{-# DEPRECATED fileEjectMountableFinish ["(Since version 2.22)","Use 'GI.Gio.Interfaces.File.fileEjectMountableWithOperationFinish'"," instead."] #-}
fileEjectMountableFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
fileEjectMountableFinish :: a -> b -> m ()
fileEjectMountableFinish file :: a
file result_ :: b
result_ = 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 File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr File -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
g_file_eject_mountable_finish Ptr File
file' Ptr AsyncResult
result_'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data FileEjectMountableFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsFile a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo FileEjectMountableFinishMethodInfo a signature where
overloadedMethod = fileEjectMountableFinish
#endif
foreign import ccall "g_file_eject_mountable_with_operation" g_file_eject_mountable_with_operation ::
Ptr File ->
CUInt ->
Ptr Gio.MountOperation.MountOperation ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
fileEjectMountableWithOperation ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a, Gio.MountOperation.IsMountOperation b, Gio.Cancellable.IsCancellable c) =>
a
-> [Gio.Flags.MountUnmountFlags]
-> Maybe (b)
-> Maybe (c)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
fileEjectMountableWithOperation :: a
-> [MountUnmountFlags]
-> Maybe b
-> Maybe c
-> Maybe AsyncReadyCallback
-> m ()
fileEjectMountableWithOperation file :: a
file flags :: [MountUnmountFlags]
flags mountOperation :: Maybe b
mountOperation cancellable :: Maybe c
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 File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
let flags' :: CUInt
flags' = [MountUnmountFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [MountUnmountFlags]
flags
Ptr MountOperation
maybeMountOperation <- case Maybe b
mountOperation of
Nothing -> Ptr MountOperation -> IO (Ptr MountOperation)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr MountOperation
forall a. Ptr a
nullPtr
Just jMountOperation :: b
jMountOperation -> do
Ptr MountOperation
jMountOperation' <- b -> IO (Ptr MountOperation)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jMountOperation
Ptr MountOperation -> IO (Ptr MountOperation)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr MountOperation
jMountOperation'
Ptr Cancellable
maybeCancellable <- case Maybe c
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 :: c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
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 File
-> CUInt
-> Ptr MountOperation
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_file_eject_mountable_with_operation Ptr File
file' CUInt
flags' Ptr MountOperation
maybeMountOperation Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
mountOperation b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FileEjectMountableWithOperationMethodInfo
instance (signature ~ ([Gio.Flags.MountUnmountFlags] -> Maybe (b) -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsFile a, Gio.MountOperation.IsMountOperation b, Gio.Cancellable.IsCancellable c) => O.MethodInfo FileEjectMountableWithOperationMethodInfo a signature where
overloadedMethod = fileEjectMountableWithOperation
#endif
foreign import ccall "g_file_eject_mountable_with_operation_finish" g_file_eject_mountable_with_operation_finish ::
Ptr File ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
fileEjectMountableWithOperationFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
fileEjectMountableWithOperationFinish :: a -> b -> m ()
fileEjectMountableWithOperationFinish file :: a
file result_ :: b
result_ = 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 File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr File -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
g_file_eject_mountable_with_operation_finish Ptr File
file' Ptr AsyncResult
result_'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data FileEjectMountableWithOperationFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsFile a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo FileEjectMountableWithOperationFinishMethodInfo a signature where
overloadedMethod = fileEjectMountableWithOperationFinish
#endif
foreign import ccall "g_file_enumerate_children" g_file_enumerate_children ::
Ptr File ->
CString ->
CUInt ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr Gio.FileEnumerator.FileEnumerator)
fileEnumerateChildren ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> [Gio.Flags.FileQueryInfoFlags]
-> Maybe (b)
-> m Gio.FileEnumerator.FileEnumerator
fileEnumerateChildren :: a -> Text -> [FileQueryInfoFlags] -> Maybe b -> m FileEnumerator
fileEnumerateChildren file :: a
file attributes :: Text
attributes flags :: [FileQueryInfoFlags]
flags cancellable :: Maybe b
cancellable = IO FileEnumerator -> m FileEnumerator
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FileEnumerator -> m FileEnumerator)
-> IO FileEnumerator -> m FileEnumerator
forall a b. (a -> b) -> a -> b
$ do
Ptr File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
CString
attributes' <- Text -> IO CString
textToCString Text
attributes
let flags' :: CUInt
flags' = [FileQueryInfoFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [FileQueryInfoFlags]
flags
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 FileEnumerator -> IO () -> IO FileEnumerator
forall a b. IO a -> IO b -> IO a
onException (do
Ptr FileEnumerator
result <- (Ptr (Ptr GError) -> IO (Ptr FileEnumerator))
-> IO (Ptr FileEnumerator)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr FileEnumerator))
-> IO (Ptr FileEnumerator))
-> (Ptr (Ptr GError) -> IO (Ptr FileEnumerator))
-> IO (Ptr FileEnumerator)
forall a b. (a -> b) -> a -> b
$ Ptr File
-> CString
-> CUInt
-> Ptr Cancellable
-> Ptr (Ptr GError)
-> IO (Ptr FileEnumerator)
g_file_enumerate_children Ptr File
file' CString
attributes' CUInt
flags' Ptr Cancellable
maybeCancellable
Text -> Ptr FileEnumerator -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "fileEnumerateChildren" Ptr FileEnumerator
result
FileEnumerator
result' <- ((ManagedPtr FileEnumerator -> FileEnumerator)
-> Ptr FileEnumerator -> IO FileEnumerator
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr FileEnumerator -> FileEnumerator
Gio.FileEnumerator.FileEnumerator) Ptr FileEnumerator
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
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'
FileEnumerator -> IO FileEnumerator
forall (m :: * -> *) a. Monad m => a -> m a
return FileEnumerator
result'
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
attributes'
)
#if defined(ENABLE_OVERLOADING)
data FileEnumerateChildrenMethodInfo
instance (signature ~ (T.Text -> [Gio.Flags.FileQueryInfoFlags] -> Maybe (b) -> m Gio.FileEnumerator.FileEnumerator), MonadIO m, IsFile a, Gio.Cancellable.IsCancellable b) => O.MethodInfo FileEnumerateChildrenMethodInfo a signature where
overloadedMethod = fileEnumerateChildren
#endif
foreign import ccall "g_file_enumerate_children_async" g_file_enumerate_children_async ::
Ptr File ->
CString ->
CUInt ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
fileEnumerateChildrenAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a, Gio.Cancellable.IsCancellable b) =>
a
-> T.Text
-> [Gio.Flags.FileQueryInfoFlags]
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
fileEnumerateChildrenAsync :: a
-> Text
-> [FileQueryInfoFlags]
-> Int32
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
fileEnumerateChildrenAsync file :: a
file attributes :: Text
attributes flags :: [FileQueryInfoFlags]
flags 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 File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
CString
attributes' <- Text -> IO CString
textToCString Text
attributes
let flags' :: CUInt
flags' = [FileQueryInfoFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [FileQueryInfoFlags]
flags
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 File
-> CString
-> CUInt
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_file_enumerate_children_async Ptr File
file' CString
attributes' CUInt
flags' 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
file
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 FileEnumerateChildrenAsyncMethodInfo
instance (signature ~ (T.Text -> [Gio.Flags.FileQueryInfoFlags] -> Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsFile a, Gio.Cancellable.IsCancellable b) => O.MethodInfo FileEnumerateChildrenAsyncMethodInfo a signature where
overloadedMethod = fileEnumerateChildrenAsync
#endif
foreign import ccall "g_file_enumerate_children_finish" g_file_enumerate_children_finish ::
Ptr File ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr Gio.FileEnumerator.FileEnumerator)
fileEnumerateChildrenFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m Gio.FileEnumerator.FileEnumerator
fileEnumerateChildrenFinish :: a -> b -> m FileEnumerator
fileEnumerateChildrenFinish file :: a
file res :: b
res = IO FileEnumerator -> m FileEnumerator
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FileEnumerator -> m FileEnumerator)
-> IO FileEnumerator -> m FileEnumerator
forall a b. (a -> b) -> a -> b
$ do
Ptr File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO FileEnumerator -> IO () -> IO FileEnumerator
forall a b. IO a -> IO b -> IO a
onException (do
Ptr FileEnumerator
result <- (Ptr (Ptr GError) -> IO (Ptr FileEnumerator))
-> IO (Ptr FileEnumerator)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr FileEnumerator))
-> IO (Ptr FileEnumerator))
-> (Ptr (Ptr GError) -> IO (Ptr FileEnumerator))
-> IO (Ptr FileEnumerator)
forall a b. (a -> b) -> a -> b
$ Ptr File
-> Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr FileEnumerator)
g_file_enumerate_children_finish Ptr File
file' Ptr AsyncResult
res'
Text -> Ptr FileEnumerator -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "fileEnumerateChildrenFinish" Ptr FileEnumerator
result
FileEnumerator
result' <- ((ManagedPtr FileEnumerator -> FileEnumerator)
-> Ptr FileEnumerator -> IO FileEnumerator
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr FileEnumerator -> FileEnumerator
Gio.FileEnumerator.FileEnumerator) Ptr FileEnumerator
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
FileEnumerator -> IO FileEnumerator
forall (m :: * -> *) a. Monad m => a -> m a
return FileEnumerator
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data FileEnumerateChildrenFinishMethodInfo
instance (signature ~ (b -> m Gio.FileEnumerator.FileEnumerator), MonadIO m, IsFile a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo FileEnumerateChildrenFinishMethodInfo a signature where
overloadedMethod = fileEnumerateChildrenFinish
#endif
foreign import ccall "g_file_equal" g_file_equal ::
Ptr File ->
Ptr File ->
IO CInt
fileEqual ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a, IsFile b) =>
a
-> b
-> m Bool
fileEqual :: a -> b -> m Bool
fileEqual file1 :: a
file1 file2 :: b
file2 = IO Bool -> m Bool
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
Ptr File
file1' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file1
Ptr File
file2' <- b -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
file2
CInt
result <- Ptr File -> Ptr File -> IO CInt
g_file_equal Ptr File
file1' Ptr File
file2'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file1
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
file2
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data FileEqualMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsFile a, IsFile b) => O.MethodInfo FileEqualMethodInfo a signature where
overloadedMethod = fileEqual
#endif
foreign import ccall "g_file_find_enclosing_mount" g_file_find_enclosing_mount ::
Ptr File ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr Gio.Mount.Mount)
fileFindEnclosingMount ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m Gio.Mount.Mount
fileFindEnclosingMount :: a -> Maybe b -> m Mount
fileFindEnclosingMount file :: a
file cancellable :: Maybe b
cancellable = IO Mount -> m Mount
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Mount -> m Mount) -> IO Mount -> m Mount
forall a b. (a -> b) -> a -> b
$ do
Ptr File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
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 Mount -> IO () -> IO Mount
forall a b. IO a -> IO b -> IO a
onException (do
Ptr Mount
result <- (Ptr (Ptr GError) -> IO (Ptr Mount)) -> IO (Ptr Mount)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr Mount)) -> IO (Ptr Mount))
-> (Ptr (Ptr GError) -> IO (Ptr Mount)) -> IO (Ptr Mount)
forall a b. (a -> b) -> a -> b
$ Ptr File -> Ptr Cancellable -> Ptr (Ptr GError) -> IO (Ptr Mount)
g_file_find_enclosing_mount Ptr File
file' Ptr Cancellable
maybeCancellable
Text -> Ptr Mount -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "fileFindEnclosingMount" Ptr Mount
result
Mount
result' <- ((ManagedPtr Mount -> Mount) -> Ptr Mount -> IO Mount
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Mount -> Mount
Gio.Mount.Mount) Ptr Mount
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
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
Mount -> IO Mount
forall (m :: * -> *) a. Monad m => a -> m a
return Mount
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data FileFindEnclosingMountMethodInfo
instance (signature ~ (Maybe (b) -> m Gio.Mount.Mount), MonadIO m, IsFile a, Gio.Cancellable.IsCancellable b) => O.MethodInfo FileFindEnclosingMountMethodInfo a signature where
overloadedMethod = fileFindEnclosingMount
#endif
foreign import ccall "g_file_find_enclosing_mount_async" g_file_find_enclosing_mount_async ::
Ptr File ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
fileFindEnclosingMountAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a, Gio.Cancellable.IsCancellable b) =>
a
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
fileFindEnclosingMountAsync :: a -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
fileFindEnclosingMountAsync file :: a
file 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 File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
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 File
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_file_find_enclosing_mount_async Ptr File
file' 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
file
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
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FileFindEnclosingMountAsyncMethodInfo
instance (signature ~ (Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsFile a, Gio.Cancellable.IsCancellable b) => O.MethodInfo FileFindEnclosingMountAsyncMethodInfo a signature where
overloadedMethod = fileFindEnclosingMountAsync
#endif
foreign import ccall "g_file_find_enclosing_mount_finish" g_file_find_enclosing_mount_finish ::
Ptr File ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr Gio.Mount.Mount)
fileFindEnclosingMountFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m Gio.Mount.Mount
fileFindEnclosingMountFinish :: a -> b -> m Mount
fileFindEnclosingMountFinish file :: a
file res :: b
res = IO Mount -> m Mount
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Mount -> m Mount) -> IO Mount -> m Mount
forall a b. (a -> b) -> a -> b
$ do
Ptr File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
Ptr AsyncResult
res' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
res
IO Mount -> IO () -> IO Mount
forall a b. IO a -> IO b -> IO a
onException (do
Ptr Mount
result <- (Ptr (Ptr GError) -> IO (Ptr Mount)) -> IO (Ptr Mount)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr Mount)) -> IO (Ptr Mount))
-> (Ptr (Ptr GError) -> IO (Ptr Mount)) -> IO (Ptr Mount)
forall a b. (a -> b) -> a -> b
$ Ptr File -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr Mount)
g_file_find_enclosing_mount_finish Ptr File
file' Ptr AsyncResult
res'
Text -> Ptr Mount -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "fileFindEnclosingMountFinish" Ptr Mount
result
Mount
result' <- ((ManagedPtr Mount -> Mount) -> Ptr Mount -> IO Mount
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Mount -> Mount
Gio.Mount.Mount) Ptr Mount
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
res
Mount -> IO Mount
forall (m :: * -> *) a. Monad m => a -> m a
return Mount
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data FileFindEnclosingMountFinishMethodInfo
instance (signature ~ (b -> m Gio.Mount.Mount), MonadIO m, IsFile a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo FileFindEnclosingMountFinishMethodInfo a signature where
overloadedMethod = fileFindEnclosingMountFinish
#endif
foreign import ccall "g_file_get_basename" g_file_get_basename ::
Ptr File ->
IO CString
fileGetBasename ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a) =>
a
-> m (Maybe [Char])
fileGetBasename :: a -> m (Maybe [Char])
fileGetBasename file :: a
file = IO (Maybe [Char]) -> m (Maybe [Char])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe [Char]) -> m (Maybe [Char]))
-> IO (Maybe [Char]) -> m (Maybe [Char])
forall a b. (a -> b) -> a -> b
$ do
Ptr File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
CString
result <- Ptr File -> IO CString
g_file_get_basename Ptr File
file'
Maybe [Char]
maybeResult <- CString -> (CString -> IO [Char]) -> IO (Maybe [Char])
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO [Char]) -> IO (Maybe [Char]))
-> (CString -> IO [Char]) -> IO (Maybe [Char])
forall a b. (a -> b) -> a -> b
$ \result' :: CString
result' -> do
[Char]
result'' <- HasCallStack => CString -> IO [Char]
CString -> IO [Char]
cstringToString CString
result'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result'
[Char] -> IO [Char]
forall (m :: * -> *) a. Monad m => a -> m a
return [Char]
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
Maybe [Char] -> IO (Maybe [Char])
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe [Char]
maybeResult
#if defined(ENABLE_OVERLOADING)
data FileGetBasenameMethodInfo
instance (signature ~ (m (Maybe [Char])), MonadIO m, IsFile a) => O.MethodInfo FileGetBasenameMethodInfo a signature where
overloadedMethod = fileGetBasename
#endif
foreign import ccall "g_file_get_child" g_file_get_child ::
Ptr File ->
CString ->
IO (Ptr File)
fileGetChild ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a) =>
a
-> [Char]
-> m File
fileGetChild :: a -> [Char] -> m File
fileGetChild file :: a
file name :: [Char]
name = IO File -> m File
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
Ptr File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
CString
name' <- [Char] -> IO CString
stringToCString [Char]
name
Ptr File
result <- Ptr File -> CString -> IO (Ptr File)
g_file_get_child Ptr File
file' CString
name'
Text -> Ptr File -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "fileGetChild" Ptr File
result
File
result' <- ((ManagedPtr File -> File) -> Ptr File -> IO File
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr File -> File
File) Ptr File
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
File -> IO File
forall (m :: * -> *) a. Monad m => a -> m a
return File
result'
#if defined(ENABLE_OVERLOADING)
data FileGetChildMethodInfo
instance (signature ~ ([Char] -> m File), MonadIO m, IsFile a) => O.MethodInfo FileGetChildMethodInfo a signature where
overloadedMethod = fileGetChild
#endif
foreign import ccall "g_file_get_child_for_display_name" g_file_get_child_for_display_name ::
Ptr File ->
CString ->
Ptr (Ptr GError) ->
IO (Ptr File)
fileGetChildForDisplayName ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a) =>
a
-> T.Text
-> m File
fileGetChildForDisplayName :: a -> Text -> m File
fileGetChildForDisplayName file :: a
file displayName :: Text
displayName = IO File -> m File
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
Ptr File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
CString
displayName' <- Text -> IO CString
textToCString Text
displayName
IO File -> IO () -> IO File
forall a b. IO a -> IO b -> IO a
onException (do
Ptr File
result <- (Ptr (Ptr GError) -> IO (Ptr File)) -> IO (Ptr File)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr File)) -> IO (Ptr File))
-> (Ptr (Ptr GError) -> IO (Ptr File)) -> IO (Ptr File)
forall a b. (a -> b) -> a -> b
$ Ptr File -> CString -> Ptr (Ptr GError) -> IO (Ptr File)
g_file_get_child_for_display_name Ptr File
file' CString
displayName'
Text -> Ptr File -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "fileGetChildForDisplayName" Ptr File
result
File
result' <- ((ManagedPtr File -> File) -> Ptr File -> IO File
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr File -> File
File) Ptr File
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
displayName'
File -> IO File
forall (m :: * -> *) a. Monad m => a -> m a
return File
result'
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
displayName'
)
#if defined(ENABLE_OVERLOADING)
data FileGetChildForDisplayNameMethodInfo
instance (signature ~ (T.Text -> m File), MonadIO m, IsFile a) => O.MethodInfo FileGetChildForDisplayNameMethodInfo a signature where
overloadedMethod = fileGetChildForDisplayName
#endif
foreign import ccall "g_file_get_parent" g_file_get_parent ::
Ptr File ->
IO (Ptr File)
fileGetParent ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a) =>
a
-> m (Maybe File)
fileGetParent :: a -> m (Maybe File)
fileGetParent file :: a
file = IO (Maybe File) -> m (Maybe File)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe File) -> m (Maybe File))
-> IO (Maybe File) -> m (Maybe File)
forall a b. (a -> b) -> a -> b
$ do
Ptr File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
Ptr File
result <- Ptr File -> IO (Ptr File)
g_file_get_parent Ptr File
file'
Maybe File
maybeResult <- Ptr File -> (Ptr File -> IO File) -> IO (Maybe File)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr File
result ((Ptr File -> IO File) -> IO (Maybe File))
-> (Ptr File -> IO File) -> IO (Maybe File)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr File
result' -> do
File
result'' <- ((ManagedPtr File -> File) -> Ptr File -> IO File
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr File -> File
File) Ptr File
result'
File -> IO File
forall (m :: * -> *) a. Monad m => a -> m a
return File
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
Maybe File -> IO (Maybe File)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe File
maybeResult
#if defined(ENABLE_OVERLOADING)
data FileGetParentMethodInfo
instance (signature ~ (m (Maybe File)), MonadIO m, IsFile a) => O.MethodInfo FileGetParentMethodInfo a signature where
overloadedMethod = fileGetParent
#endif
foreign import ccall "g_file_get_parse_name" g_file_get_parse_name ::
Ptr File ->
IO CString
fileGetParseName ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a) =>
a
-> m T.Text
fileGetParseName :: a -> m Text
fileGetParseName file :: a
file = 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 File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
CString
result <- Ptr File -> IO CString
g_file_get_parse_name Ptr File
file'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "fileGetParseName" 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
file
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data FileGetParseNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsFile a) => O.MethodInfo FileGetParseNameMethodInfo a signature where
overloadedMethod = fileGetParseName
#endif
foreign import ccall "g_file_get_path" g_file_get_path ::
Ptr File ->
IO CString
fileGetPath ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a) =>
a
-> m (Maybe [Char])
fileGetPath :: a -> m (Maybe [Char])
fileGetPath file :: a
file = IO (Maybe [Char]) -> m (Maybe [Char])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe [Char]) -> m (Maybe [Char]))
-> IO (Maybe [Char]) -> m (Maybe [Char])
forall a b. (a -> b) -> a -> b
$ do
Ptr File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
CString
result <- Ptr File -> IO CString
g_file_get_path Ptr File
file'
Maybe [Char]
maybeResult <- CString -> (CString -> IO [Char]) -> IO (Maybe [Char])
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO [Char]) -> IO (Maybe [Char]))
-> (CString -> IO [Char]) -> IO (Maybe [Char])
forall a b. (a -> b) -> a -> b
$ \result' :: CString
result' -> do
[Char]
result'' <- HasCallStack => CString -> IO [Char]
CString -> IO [Char]
cstringToString CString
result'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result'
[Char] -> IO [Char]
forall (m :: * -> *) a. Monad m => a -> m a
return [Char]
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
Maybe [Char] -> IO (Maybe [Char])
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe [Char]
maybeResult
#if defined(ENABLE_OVERLOADING)
data FileGetPathMethodInfo
instance (signature ~ (m (Maybe [Char])), MonadIO m, IsFile a) => O.MethodInfo FileGetPathMethodInfo a signature where
overloadedMethod = fileGetPath
#endif