{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Soup.Objects.MultipartInputStream
(
MultipartInputStream(..) ,
IsMultipartInputStream ,
toMultipartInputStream ,
#if defined(ENABLE_OVERLOADING)
ResolveMultipartInputStreamMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
MultipartInputStreamGetHeadersMethodInfo,
#endif
multipartInputStreamGetHeaders ,
multipartInputStreamNew ,
#if defined(ENABLE_OVERLOADING)
MultipartInputStreamNextPartMethodInfo ,
#endif
multipartInputStreamNextPart ,
#if defined(ENABLE_OVERLOADING)
MultipartInputStreamNextPartAsyncMethodInfo,
#endif
multipartInputStreamNextPartAsync ,
#if defined(ENABLE_OVERLOADING)
MultipartInputStreamNextPartFinishMethodInfo,
#endif
multipartInputStreamNextPartFinish ,
#if defined(ENABLE_OVERLOADING)
MultipartInputStreamMessagePropertyInfo ,
#endif
constructMultipartInputStreamMessage ,
getMultipartInputStreamMessage ,
#if defined(ENABLE_OVERLOADING)
multipartInputStreamMessage ,
#endif
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Interfaces.PollableInputStream as Gio.PollableInputStream
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.FilterInputStream as Gio.FilterInputStream
import qualified GI.Gio.Objects.InputStream as Gio.InputStream
import {-# SOURCE #-} qualified GI.Soup.Objects.Message as Soup.Message
import {-# SOURCE #-} qualified GI.Soup.Structs.MessageHeaders as Soup.MessageHeaders
newtype MultipartInputStream = MultipartInputStream (SP.ManagedPtr MultipartInputStream)
deriving (MultipartInputStream -> MultipartInputStream -> Bool
(MultipartInputStream -> MultipartInputStream -> Bool)
-> (MultipartInputStream -> MultipartInputStream -> Bool)
-> Eq MultipartInputStream
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MultipartInputStream -> MultipartInputStream -> Bool
== :: MultipartInputStream -> MultipartInputStream -> Bool
$c/= :: MultipartInputStream -> MultipartInputStream -> Bool
/= :: MultipartInputStream -> MultipartInputStream -> Bool
Eq)
instance SP.ManagedPtrNewtype MultipartInputStream where
toManagedPtr :: MultipartInputStream -> ManagedPtr MultipartInputStream
toManagedPtr (MultipartInputStream ManagedPtr MultipartInputStream
p) = ManagedPtr MultipartInputStream
p
foreign import ccall "soup_multipart_input_stream_get_type"
c_soup_multipart_input_stream_get_type :: IO B.Types.GType
instance B.Types.TypedObject MultipartInputStream where
glibType :: IO GType
glibType = IO GType
c_soup_multipart_input_stream_get_type
instance B.Types.GObject MultipartInputStream
class (SP.GObject o, O.IsDescendantOf MultipartInputStream o) => IsMultipartInputStream o
instance (SP.GObject o, O.IsDescendantOf MultipartInputStream o) => IsMultipartInputStream o
instance O.HasParentTypes MultipartInputStream
type instance O.ParentTypes MultipartInputStream = '[Gio.FilterInputStream.FilterInputStream, Gio.InputStream.InputStream, GObject.Object.Object, Gio.PollableInputStream.PollableInputStream]
toMultipartInputStream :: (MIO.MonadIO m, IsMultipartInputStream o) => o -> m MultipartInputStream
toMultipartInputStream :: forall (m :: * -> *) o.
(MonadIO m, IsMultipartInputStream o) =>
o -> m MultipartInputStream
toMultipartInputStream = IO MultipartInputStream -> m MultipartInputStream
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO MultipartInputStream -> m MultipartInputStream)
-> (o -> IO MultipartInputStream) -> o -> m MultipartInputStream
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr MultipartInputStream -> MultipartInputStream)
-> o -> IO MultipartInputStream
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr MultipartInputStream -> MultipartInputStream
MultipartInputStream
instance B.GValue.IsGValue (Maybe MultipartInputStream) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_soup_multipart_input_stream_get_type
gvalueSet_ :: Ptr GValue -> Maybe MultipartInputStream -> IO ()
gvalueSet_ Ptr GValue
gv Maybe MultipartInputStream
P.Nothing = Ptr GValue -> Ptr MultipartInputStream -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr MultipartInputStream
forall a. Ptr a
FP.nullPtr :: FP.Ptr MultipartInputStream)
gvalueSet_ Ptr GValue
gv (P.Just MultipartInputStream
obj) = MultipartInputStream
-> (Ptr MultipartInputStream -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr MultipartInputStream
obj (Ptr GValue -> Ptr MultipartInputStream -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe MultipartInputStream)
gvalueGet_ Ptr GValue
gv = do
Ptr MultipartInputStream
ptr <- Ptr GValue -> IO (Ptr MultipartInputStream)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr MultipartInputStream)
if Ptr MultipartInputStream
ptr Ptr MultipartInputStream -> Ptr MultipartInputStream -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr MultipartInputStream
forall a. Ptr a
FP.nullPtr
then MultipartInputStream -> Maybe MultipartInputStream
forall a. a -> Maybe a
P.Just (MultipartInputStream -> Maybe MultipartInputStream)
-> IO MultipartInputStream -> IO (Maybe MultipartInputStream)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr MultipartInputStream -> MultipartInputStream)
-> Ptr MultipartInputStream -> IO MultipartInputStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr MultipartInputStream -> MultipartInputStream
MultipartInputStream Ptr MultipartInputStream
ptr
else Maybe MultipartInputStream -> IO (Maybe MultipartInputStream)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe MultipartInputStream
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveMultipartInputStreamMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveMultipartInputStreamMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveMultipartInputStreamMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveMultipartInputStreamMethod "canPoll" o = Gio.PollableInputStream.PollableInputStreamCanPollMethodInfo
ResolveMultipartInputStreamMethod "clearPending" o = Gio.InputStream.InputStreamClearPendingMethodInfo
ResolveMultipartInputStreamMethod "close" o = Gio.InputStream.InputStreamCloseMethodInfo
ResolveMultipartInputStreamMethod "closeAsync" o = Gio.InputStream.InputStreamCloseAsyncMethodInfo
ResolveMultipartInputStreamMethod "closeFinish" o = Gio.InputStream.InputStreamCloseFinishMethodInfo
ResolveMultipartInputStreamMethod "createSource" o = Gio.PollableInputStream.PollableInputStreamCreateSourceMethodInfo
ResolveMultipartInputStreamMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveMultipartInputStreamMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveMultipartInputStreamMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveMultipartInputStreamMethod "hasPending" o = Gio.InputStream.InputStreamHasPendingMethodInfo
ResolveMultipartInputStreamMethod "isClosed" o = Gio.InputStream.InputStreamIsClosedMethodInfo
ResolveMultipartInputStreamMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveMultipartInputStreamMethod "isReadable" o = Gio.PollableInputStream.PollableInputStreamIsReadableMethodInfo
ResolveMultipartInputStreamMethod "nextPart" o = MultipartInputStreamNextPartMethodInfo
ResolveMultipartInputStreamMethod "nextPartAsync" o = MultipartInputStreamNextPartAsyncMethodInfo
ResolveMultipartInputStreamMethod "nextPartFinish" o = MultipartInputStreamNextPartFinishMethodInfo
ResolveMultipartInputStreamMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveMultipartInputStreamMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveMultipartInputStreamMethod "read" o = Gio.InputStream.InputStreamReadMethodInfo
ResolveMultipartInputStreamMethod "readAll" o = Gio.InputStream.InputStreamReadAllMethodInfo
ResolveMultipartInputStreamMethod "readAllAsync" o = Gio.InputStream.InputStreamReadAllAsyncMethodInfo
ResolveMultipartInputStreamMethod "readAllFinish" o = Gio.InputStream.InputStreamReadAllFinishMethodInfo
ResolveMultipartInputStreamMethod "readAsync" o = Gio.InputStream.InputStreamReadAsyncMethodInfo
ResolveMultipartInputStreamMethod "readBytes" o = Gio.InputStream.InputStreamReadBytesMethodInfo
ResolveMultipartInputStreamMethod "readBytesAsync" o = Gio.InputStream.InputStreamReadBytesAsyncMethodInfo
ResolveMultipartInputStreamMethod "readBytesFinish" o = Gio.InputStream.InputStreamReadBytesFinishMethodInfo
ResolveMultipartInputStreamMethod "readFinish" o = Gio.InputStream.InputStreamReadFinishMethodInfo
ResolveMultipartInputStreamMethod "readNonblocking" o = Gio.PollableInputStream.PollableInputStreamReadNonblockingMethodInfo
ResolveMultipartInputStreamMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveMultipartInputStreamMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveMultipartInputStreamMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveMultipartInputStreamMethod "skip" o = Gio.InputStream.InputStreamSkipMethodInfo
ResolveMultipartInputStreamMethod "skipAsync" o = Gio.InputStream.InputStreamSkipAsyncMethodInfo
ResolveMultipartInputStreamMethod "skipFinish" o = Gio.InputStream.InputStreamSkipFinishMethodInfo
ResolveMultipartInputStreamMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveMultipartInputStreamMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveMultipartInputStreamMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveMultipartInputStreamMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveMultipartInputStreamMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveMultipartInputStreamMethod "getBaseStream" o = Gio.FilterInputStream.FilterInputStreamGetBaseStreamMethodInfo
ResolveMultipartInputStreamMethod "getCloseBaseStream" o = Gio.FilterInputStream.FilterInputStreamGetCloseBaseStreamMethodInfo
ResolveMultipartInputStreamMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveMultipartInputStreamMethod "getHeaders" o = MultipartInputStreamGetHeadersMethodInfo
ResolveMultipartInputStreamMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveMultipartInputStreamMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveMultipartInputStreamMethod "setCloseBaseStream" o = Gio.FilterInputStream.FilterInputStreamSetCloseBaseStreamMethodInfo
ResolveMultipartInputStreamMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveMultipartInputStreamMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveMultipartInputStreamMethod "setPending" o = Gio.InputStream.InputStreamSetPendingMethodInfo
ResolveMultipartInputStreamMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveMultipartInputStreamMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveMultipartInputStreamMethod t MultipartInputStream, O.OverloadedMethod info MultipartInputStream p) => OL.IsLabel t (MultipartInputStream -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveMultipartInputStreamMethod t MultipartInputStream, O.OverloadedMethod info MultipartInputStream p, R.HasField t MultipartInputStream p) => R.HasField t MultipartInputStream p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveMultipartInputStreamMethod t MultipartInputStream, O.OverloadedMethodInfo info MultipartInputStream) => OL.IsLabel t (O.MethodProxy info MultipartInputStream) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
getMultipartInputStreamMessage :: (MonadIO m, IsMultipartInputStream o) => o -> m (Maybe Soup.Message.Message)
getMultipartInputStreamMessage :: forall (m :: * -> *) o.
(MonadIO m, IsMultipartInputStream o) =>
o -> m (Maybe Message)
getMultipartInputStreamMessage o
obj = IO (Maybe Message) -> m (Maybe Message)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe Message) -> m (Maybe Message))
-> IO (Maybe Message) -> m (Maybe Message)
forall a b. (a -> b) -> a -> b
$ o
-> String -> (ManagedPtr Message -> Message) -> IO (Maybe Message)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"message" ManagedPtr Message -> Message
Soup.Message.Message
constructMultipartInputStreamMessage :: (IsMultipartInputStream o, MIO.MonadIO m, Soup.Message.IsMessage a) => a -> m (GValueConstruct o)
constructMultipartInputStreamMessage :: forall o (m :: * -> *) a.
(IsMultipartInputStream o, MonadIO m, IsMessage a) =>
a -> m (GValueConstruct o)
constructMultipartInputStreamMessage a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"message" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
#if defined(ENABLE_OVERLOADING)
data MultipartInputStreamMessagePropertyInfo
instance AttrInfo MultipartInputStreamMessagePropertyInfo where
type AttrAllowedOps MultipartInputStreamMessagePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint MultipartInputStreamMessagePropertyInfo = IsMultipartInputStream
type AttrSetTypeConstraint MultipartInputStreamMessagePropertyInfo = Soup.Message.IsMessage
type AttrTransferTypeConstraint MultipartInputStreamMessagePropertyInfo = Soup.Message.IsMessage
type AttrTransferType MultipartInputStreamMessagePropertyInfo = Soup.Message.Message
type AttrGetType MultipartInputStreamMessagePropertyInfo = (Maybe Soup.Message.Message)
type AttrLabel MultipartInputStreamMessagePropertyInfo = "message"
type AttrOrigin MultipartInputStreamMessagePropertyInfo = MultipartInputStream
attrGet = getMultipartInputStreamMessage
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Soup.Message.Message v
attrConstruct = constructMultipartInputStreamMessage
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Objects.MultipartInputStream.message"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Objects-MultipartInputStream.html#g:attr:message"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList MultipartInputStream
type instance O.AttributeList MultipartInputStream = MultipartInputStreamAttributeList
type MultipartInputStreamAttributeList = ('[ '("baseStream", Gio.FilterInputStream.FilterInputStreamBaseStreamPropertyInfo), '("closeBaseStream", Gio.FilterInputStream.FilterInputStreamCloseBaseStreamPropertyInfo), '("message", MultipartInputStreamMessagePropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
multipartInputStreamMessage :: AttrLabelProxy "message"
multipartInputStreamMessage = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList MultipartInputStream = MultipartInputStreamSignalList
type MultipartInputStreamSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "soup_multipart_input_stream_new" soup_multipart_input_stream_new ::
Ptr Soup.Message.Message ->
Ptr Gio.InputStream.InputStream ->
IO (Ptr MultipartInputStream)
multipartInputStreamNew ::
(B.CallStack.HasCallStack, MonadIO m, Soup.Message.IsMessage a, Gio.InputStream.IsInputStream b) =>
a
-> b
-> m MultipartInputStream
multipartInputStreamNew :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsMessage a, IsInputStream b) =>
a -> b -> m MultipartInputStream
multipartInputStreamNew a
msg b
baseStream = IO MultipartInputStream -> m MultipartInputStream
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO MultipartInputStream -> m MultipartInputStream)
-> IO MultipartInputStream -> m MultipartInputStream
forall a b. (a -> b) -> a -> b
$ do
Ptr Message
msg' <- a -> IO (Ptr Message)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
msg
Ptr InputStream
baseStream' <- b -> IO (Ptr InputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
baseStream
Ptr MultipartInputStream
result <- Ptr Message -> Ptr InputStream -> IO (Ptr MultipartInputStream)
soup_multipart_input_stream_new Ptr Message
msg' Ptr InputStream
baseStream'
Text -> Ptr MultipartInputStream -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"multipartInputStreamNew" Ptr MultipartInputStream
result
MultipartInputStream
result' <- ((ManagedPtr MultipartInputStream -> MultipartInputStream)
-> Ptr MultipartInputStream -> IO MultipartInputStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr MultipartInputStream -> MultipartInputStream
MultipartInputStream) Ptr MultipartInputStream
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
msg
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
baseStream
MultipartInputStream -> IO MultipartInputStream
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return MultipartInputStream
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "soup_multipart_input_stream_get_headers" ::
Ptr MultipartInputStream ->
IO (Ptr Soup.MessageHeaders.MessageHeaders)
multipartInputStreamGetHeaders ::
(B.CallStack.HasCallStack, MonadIO m, IsMultipartInputStream a) =>
a
-> m (Maybe Soup.MessageHeaders.MessageHeaders)
a
multipart = IO (Maybe MessageHeaders) -> m (Maybe MessageHeaders)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe MessageHeaders) -> m (Maybe MessageHeaders))
-> IO (Maybe MessageHeaders) -> m (Maybe MessageHeaders)
forall a b. (a -> b) -> a -> b
$ do
Ptr MultipartInputStream
multipart' <- a -> IO (Ptr MultipartInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
multipart
Ptr MessageHeaders
result <- Ptr MultipartInputStream -> IO (Ptr MessageHeaders)
soup_multipart_input_stream_get_headers Ptr MultipartInputStream
multipart'
Maybe MessageHeaders
maybeResult <- Ptr MessageHeaders
-> (Ptr MessageHeaders -> IO MessageHeaders)
-> IO (Maybe MessageHeaders)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr MessageHeaders
result ((Ptr MessageHeaders -> IO MessageHeaders)
-> IO (Maybe MessageHeaders))
-> (Ptr MessageHeaders -> IO MessageHeaders)
-> IO (Maybe MessageHeaders)
forall a b. (a -> b) -> a -> b
$ \Ptr MessageHeaders
result' -> do
MessageHeaders
result'' <- ((ManagedPtr MessageHeaders -> MessageHeaders)
-> Ptr MessageHeaders -> IO MessageHeaders
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr MessageHeaders -> MessageHeaders
Soup.MessageHeaders.MessageHeaders) Ptr MessageHeaders
result'
MessageHeaders -> IO MessageHeaders
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return MessageHeaders
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
multipart
Maybe MessageHeaders -> IO (Maybe MessageHeaders)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe MessageHeaders
maybeResult
#if defined(ENABLE_OVERLOADING)
data MultipartInputStreamGetHeadersMethodInfo
instance (signature ~ (m (Maybe Soup.MessageHeaders.MessageHeaders)), MonadIO m, IsMultipartInputStream a) => O.OverloadedMethod MultipartInputStreamGetHeadersMethodInfo a signature where
overloadedMethod = multipartInputStreamGetHeaders
instance O.OverloadedMethodInfo MultipartInputStreamGetHeadersMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Objects.MultipartInputStream.multipartInputStreamGetHeaders",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Objects-MultipartInputStream.html#v:multipartInputStreamGetHeaders"
})
#endif
foreign import ccall "soup_multipart_input_stream_next_part" soup_multipart_input_stream_next_part ::
Ptr MultipartInputStream ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr Gio.InputStream.InputStream)
multipartInputStreamNextPart ::
(B.CallStack.HasCallStack, MonadIO m, IsMultipartInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m (Maybe Gio.InputStream.InputStream)
multipartInputStreamNextPart :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsMultipartInputStream a,
IsCancellable b) =>
a -> Maybe b -> m (Maybe InputStream)
multipartInputStreamNextPart a
multipart Maybe b
cancellable = IO (Maybe InputStream) -> m (Maybe InputStream)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe InputStream) -> m (Maybe InputStream))
-> IO (Maybe InputStream) -> m (Maybe InputStream)
forall a b. (a -> b) -> a -> b
$ do
Ptr MultipartInputStream
multipart' <- a -> IO (Ptr MultipartInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
multipart
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just 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 a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
IO (Maybe InputStream) -> IO () -> IO (Maybe InputStream)
forall a b. IO a -> IO b -> IO a
onException (do
Ptr InputStream
result <- (Ptr (Ptr GError) -> IO (Ptr InputStream)) -> IO (Ptr InputStream)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr InputStream))
-> IO (Ptr InputStream))
-> (Ptr (Ptr GError) -> IO (Ptr InputStream))
-> IO (Ptr InputStream)
forall a b. (a -> b) -> a -> b
$ Ptr MultipartInputStream
-> Ptr Cancellable -> Ptr (Ptr GError) -> IO (Ptr InputStream)
soup_multipart_input_stream_next_part Ptr MultipartInputStream
multipart' Ptr Cancellable
maybeCancellable
Maybe InputStream
maybeResult <- Ptr InputStream
-> (Ptr InputStream -> IO InputStream) -> IO (Maybe InputStream)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr InputStream
result ((Ptr InputStream -> IO InputStream) -> IO (Maybe InputStream))
-> (Ptr InputStream -> IO InputStream) -> IO (Maybe InputStream)
forall a b. (a -> b) -> a -> b
$ \Ptr InputStream
result' -> do
InputStream
result'' <- ((ManagedPtr InputStream -> InputStream)
-> Ptr InputStream -> IO InputStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr InputStream -> InputStream
Gio.InputStream.InputStream) Ptr InputStream
result'
InputStream -> IO InputStream
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return InputStream
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
multipart
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
Maybe InputStream -> IO (Maybe InputStream)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe InputStream
maybeResult
) (do
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data MultipartInputStreamNextPartMethodInfo
instance (signature ~ (Maybe (b) -> m (Maybe Gio.InputStream.InputStream)), MonadIO m, IsMultipartInputStream a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod MultipartInputStreamNextPartMethodInfo a signature where
overloadedMethod = multipartInputStreamNextPart
instance O.OverloadedMethodInfo MultipartInputStreamNextPartMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Objects.MultipartInputStream.multipartInputStreamNextPart",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Objects-MultipartInputStream.html#v:multipartInputStreamNextPart"
})
#endif
foreign import ccall "soup_multipart_input_stream_next_part_async" soup_multipart_input_stream_next_part_async ::
Ptr MultipartInputStream ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
multipartInputStreamNextPartAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsMultipartInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
multipartInputStreamNextPartAsync :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsMultipartInputStream a,
IsCancellable b) =>
a -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
multipartInputStreamNextPartAsync a
multipart Int32
ioPriority Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr MultipartInputStream
multipart' <- a -> IO (Ptr MultipartInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
multipart
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just 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 a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just 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 -> 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
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 a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let data_ :: Ptr a
data_ = Ptr a
forall a. Ptr a
nullPtr
Ptr MultipartInputStream
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
soup_multipart_input_stream_next_part_async Ptr MultipartInputStream
multipart' Int32
ioPriority Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
data_
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
multipart
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 a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data MultipartInputStreamNextPartAsyncMethodInfo
instance (signature ~ (Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsMultipartInputStream a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod MultipartInputStreamNextPartAsyncMethodInfo a signature where
overloadedMethod = multipartInputStreamNextPartAsync
instance O.OverloadedMethodInfo MultipartInputStreamNextPartAsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Objects.MultipartInputStream.multipartInputStreamNextPartAsync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Objects-MultipartInputStream.html#v:multipartInputStreamNextPartAsync"
})
#endif
foreign import ccall "soup_multipart_input_stream_next_part_finish" soup_multipart_input_stream_next_part_finish ::
Ptr MultipartInputStream ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr Gio.InputStream.InputStream)
multipartInputStreamNextPartFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsMultipartInputStream a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m (Maybe Gio.InputStream.InputStream)
multipartInputStreamNextPartFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsMultipartInputStream a,
IsAsyncResult b) =>
a -> b -> m (Maybe InputStream)
multipartInputStreamNextPartFinish a
multipart b
result_ = IO (Maybe InputStream) -> m (Maybe InputStream)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe InputStream) -> m (Maybe InputStream))
-> IO (Maybe InputStream) -> m (Maybe InputStream)
forall a b. (a -> b) -> a -> b
$ do
Ptr MultipartInputStream
multipart' <- a -> IO (Ptr MultipartInputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
multipart
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
IO (Maybe InputStream) -> IO () -> IO (Maybe InputStream)
forall a b. IO a -> IO b -> IO a
onException (do
Ptr InputStream
result <- (Ptr (Ptr GError) -> IO (Ptr InputStream)) -> IO (Ptr InputStream)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr InputStream))
-> IO (Ptr InputStream))
-> (Ptr (Ptr GError) -> IO (Ptr InputStream))
-> IO (Ptr InputStream)
forall a b. (a -> b) -> a -> b
$ Ptr MultipartInputStream
-> Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr InputStream)
soup_multipart_input_stream_next_part_finish Ptr MultipartInputStream
multipart' Ptr AsyncResult
result_'
Maybe InputStream
maybeResult <- Ptr InputStream
-> (Ptr InputStream -> IO InputStream) -> IO (Maybe InputStream)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr InputStream
result ((Ptr InputStream -> IO InputStream) -> IO (Maybe InputStream))
-> (Ptr InputStream -> IO InputStream) -> IO (Maybe InputStream)
forall a b. (a -> b) -> a -> b
$ \Ptr InputStream
result' -> do
InputStream
result'' <- ((ManagedPtr InputStream -> InputStream)
-> Ptr InputStream -> IO InputStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr InputStream -> InputStream
Gio.InputStream.InputStream) Ptr InputStream
result'
InputStream -> IO InputStream
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return InputStream
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
multipart
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
Maybe InputStream -> IO (Maybe InputStream)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe InputStream
maybeResult
) (do
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data MultipartInputStreamNextPartFinishMethodInfo
instance (signature ~ (b -> m (Maybe Gio.InputStream.InputStream)), MonadIO m, IsMultipartInputStream a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod MultipartInputStreamNextPartFinishMethodInfo a signature where
overloadedMethod = multipartInputStreamNextPartFinish
instance O.OverloadedMethodInfo MultipartInputStreamNextPartFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Objects.MultipartInputStream.multipartInputStreamNextPartFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Objects-MultipartInputStream.html#v:multipartInputStreamNextPartFinish"
})
#endif