#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Objects.BufferedInputStream
(
BufferedInputStream(..) ,
IsBufferedInputStream ,
toBufferedInputStream ,
noBufferedInputStream ,
#if ENABLE_OVERLOADING
BufferedInputStreamFillMethodInfo ,
#endif
bufferedInputStreamFill ,
#if ENABLE_OVERLOADING
BufferedInputStreamFillAsyncMethodInfo ,
#endif
bufferedInputStreamFillAsync ,
#if ENABLE_OVERLOADING
BufferedInputStreamFillFinishMethodInfo ,
#endif
bufferedInputStreamFillFinish ,
#if ENABLE_OVERLOADING
BufferedInputStreamGetAvailableMethodInfo,
#endif
bufferedInputStreamGetAvailable ,
#if ENABLE_OVERLOADING
BufferedInputStreamGetBufferSizeMethodInfo,
#endif
bufferedInputStreamGetBufferSize ,
bufferedInputStreamNew ,
bufferedInputStreamNewSized ,
#if ENABLE_OVERLOADING
BufferedInputStreamPeekMethodInfo ,
#endif
bufferedInputStreamPeek ,
#if ENABLE_OVERLOADING
BufferedInputStreamPeekBufferMethodInfo ,
#endif
bufferedInputStreamPeekBuffer ,
#if ENABLE_OVERLOADING
BufferedInputStreamReadByteMethodInfo ,
#endif
bufferedInputStreamReadByte ,
#if ENABLE_OVERLOADING
BufferedInputStreamSetBufferSizeMethodInfo,
#endif
bufferedInputStreamSetBufferSize ,
#if ENABLE_OVERLOADING
BufferedInputStreamBufferSizePropertyInfo,
#endif
#if ENABLE_OVERLOADING
bufferedInputStreamBufferSize ,
#endif
constructBufferedInputStreamBufferSize ,
getBufferedInputStreamBufferSize ,
setBufferedInputStreamBufferSize ,
) 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.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.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Seekable as Gio.Seekable
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.FilterInputStream as Gio.FilterInputStream
import {-# SOURCE #-} qualified GI.Gio.Objects.InputStream as Gio.InputStream
newtype BufferedInputStream = BufferedInputStream (ManagedPtr BufferedInputStream)
foreign import ccall "g_buffered_input_stream_get_type"
c_g_buffered_input_stream_get_type :: IO GType
instance GObject BufferedInputStream where
gobjectType _ = c_g_buffered_input_stream_get_type
class GObject o => IsBufferedInputStream o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError BufferedInputStream a) =>
IsBufferedInputStream a
#endif
instance IsBufferedInputStream BufferedInputStream
instance Gio.FilterInputStream.IsFilterInputStream BufferedInputStream
instance Gio.InputStream.IsInputStream BufferedInputStream
instance GObject.Object.IsObject BufferedInputStream
instance Gio.Seekable.IsSeekable BufferedInputStream
toBufferedInputStream :: (MonadIO m, IsBufferedInputStream o) => o -> m BufferedInputStream
toBufferedInputStream = liftIO . unsafeCastTo BufferedInputStream
noBufferedInputStream :: Maybe BufferedInputStream
noBufferedInputStream = Nothing
#if ENABLE_OVERLOADING
type family ResolveBufferedInputStreamMethod (t :: Symbol) (o :: *) :: * where
ResolveBufferedInputStreamMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveBufferedInputStreamMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveBufferedInputStreamMethod "canSeek" o = Gio.Seekable.SeekableCanSeekMethodInfo
ResolveBufferedInputStreamMethod "canTruncate" o = Gio.Seekable.SeekableCanTruncateMethodInfo
ResolveBufferedInputStreamMethod "clearPending" o = Gio.InputStream.InputStreamClearPendingMethodInfo
ResolveBufferedInputStreamMethod "close" o = Gio.InputStream.InputStreamCloseMethodInfo
ResolveBufferedInputStreamMethod "closeAsync" o = Gio.InputStream.InputStreamCloseAsyncMethodInfo
ResolveBufferedInputStreamMethod "closeFinish" o = Gio.InputStream.InputStreamCloseFinishMethodInfo
ResolveBufferedInputStreamMethod "fill" o = BufferedInputStreamFillMethodInfo
ResolveBufferedInputStreamMethod "fillAsync" o = BufferedInputStreamFillAsyncMethodInfo
ResolveBufferedInputStreamMethod "fillFinish" o = BufferedInputStreamFillFinishMethodInfo
ResolveBufferedInputStreamMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveBufferedInputStreamMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveBufferedInputStreamMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveBufferedInputStreamMethod "hasPending" o = Gio.InputStream.InputStreamHasPendingMethodInfo
ResolveBufferedInputStreamMethod "isClosed" o = Gio.InputStream.InputStreamIsClosedMethodInfo
ResolveBufferedInputStreamMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveBufferedInputStreamMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveBufferedInputStreamMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveBufferedInputStreamMethod "peek" o = BufferedInputStreamPeekMethodInfo
ResolveBufferedInputStreamMethod "peekBuffer" o = BufferedInputStreamPeekBufferMethodInfo
ResolveBufferedInputStreamMethod "read" o = Gio.InputStream.InputStreamReadMethodInfo
ResolveBufferedInputStreamMethod "readAll" o = Gio.InputStream.InputStreamReadAllMethodInfo
ResolveBufferedInputStreamMethod "readAllAsync" o = Gio.InputStream.InputStreamReadAllAsyncMethodInfo
ResolveBufferedInputStreamMethod "readAllFinish" o = Gio.InputStream.InputStreamReadAllFinishMethodInfo
ResolveBufferedInputStreamMethod "readAsync" o = Gio.InputStream.InputStreamReadAsyncMethodInfo
ResolveBufferedInputStreamMethod "readByte" o = BufferedInputStreamReadByteMethodInfo
ResolveBufferedInputStreamMethod "readBytes" o = Gio.InputStream.InputStreamReadBytesMethodInfo
ResolveBufferedInputStreamMethod "readBytesAsync" o = Gio.InputStream.InputStreamReadBytesAsyncMethodInfo
ResolveBufferedInputStreamMethod "readBytesFinish" o = Gio.InputStream.InputStreamReadBytesFinishMethodInfo
ResolveBufferedInputStreamMethod "readFinish" o = Gio.InputStream.InputStreamReadFinishMethodInfo
ResolveBufferedInputStreamMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveBufferedInputStreamMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveBufferedInputStreamMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveBufferedInputStreamMethod "seek" o = Gio.Seekable.SeekableSeekMethodInfo
ResolveBufferedInputStreamMethod "skip" o = Gio.InputStream.InputStreamSkipMethodInfo
ResolveBufferedInputStreamMethod "skipAsync" o = Gio.InputStream.InputStreamSkipAsyncMethodInfo
ResolveBufferedInputStreamMethod "skipFinish" o = Gio.InputStream.InputStreamSkipFinishMethodInfo
ResolveBufferedInputStreamMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveBufferedInputStreamMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveBufferedInputStreamMethod "tell" o = Gio.Seekable.SeekableTellMethodInfo
ResolveBufferedInputStreamMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveBufferedInputStreamMethod "truncate" o = Gio.Seekable.SeekableTruncateMethodInfo
ResolveBufferedInputStreamMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveBufferedInputStreamMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveBufferedInputStreamMethod "getAvailable" o = BufferedInputStreamGetAvailableMethodInfo
ResolveBufferedInputStreamMethod "getBaseStream" o = Gio.FilterInputStream.FilterInputStreamGetBaseStreamMethodInfo
ResolveBufferedInputStreamMethod "getBufferSize" o = BufferedInputStreamGetBufferSizeMethodInfo
ResolveBufferedInputStreamMethod "getCloseBaseStream" o = Gio.FilterInputStream.FilterInputStreamGetCloseBaseStreamMethodInfo
ResolveBufferedInputStreamMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveBufferedInputStreamMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveBufferedInputStreamMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveBufferedInputStreamMethod "setBufferSize" o = BufferedInputStreamSetBufferSizeMethodInfo
ResolveBufferedInputStreamMethod "setCloseBaseStream" o = Gio.FilterInputStream.FilterInputStreamSetCloseBaseStreamMethodInfo
ResolveBufferedInputStreamMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveBufferedInputStreamMethod "setPending" o = Gio.InputStream.InputStreamSetPendingMethodInfo
ResolveBufferedInputStreamMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveBufferedInputStreamMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveBufferedInputStreamMethod t BufferedInputStream, O.MethodInfo info BufferedInputStream p) => O.IsLabelProxy t (BufferedInputStream -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveBufferedInputStreamMethod t BufferedInputStream, O.MethodInfo info BufferedInputStream p) => O.IsLabel t (BufferedInputStream -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
#endif
getBufferedInputStreamBufferSize :: (MonadIO m, IsBufferedInputStream o) => o -> m Word32
getBufferedInputStreamBufferSize obj = liftIO $ getObjectPropertyUInt32 obj "buffer-size"
setBufferedInputStreamBufferSize :: (MonadIO m, IsBufferedInputStream o) => o -> Word32 -> m ()
setBufferedInputStreamBufferSize obj val = liftIO $ setObjectPropertyUInt32 obj "buffer-size" val
constructBufferedInputStreamBufferSize :: (IsBufferedInputStream o) => Word32 -> IO (GValueConstruct o)
constructBufferedInputStreamBufferSize val = constructObjectPropertyUInt32 "buffer-size" val
#if ENABLE_OVERLOADING
data BufferedInputStreamBufferSizePropertyInfo
instance AttrInfo BufferedInputStreamBufferSizePropertyInfo where
type AttrAllowedOps BufferedInputStreamBufferSizePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint BufferedInputStreamBufferSizePropertyInfo = (~) Word32
type AttrBaseTypeConstraint BufferedInputStreamBufferSizePropertyInfo = IsBufferedInputStream
type AttrGetType BufferedInputStreamBufferSizePropertyInfo = Word32
type AttrLabel BufferedInputStreamBufferSizePropertyInfo = "buffer-size"
type AttrOrigin BufferedInputStreamBufferSizePropertyInfo = BufferedInputStream
attrGet _ = getBufferedInputStreamBufferSize
attrSet _ = setBufferedInputStreamBufferSize
attrConstruct _ = constructBufferedInputStreamBufferSize
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList BufferedInputStream
type instance O.AttributeList BufferedInputStream = BufferedInputStreamAttributeList
type BufferedInputStreamAttributeList = ('[ '("baseStream", Gio.FilterInputStream.FilterInputStreamBaseStreamPropertyInfo), '("bufferSize", BufferedInputStreamBufferSizePropertyInfo), '("closeBaseStream", Gio.FilterInputStream.FilterInputStreamCloseBaseStreamPropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
bufferedInputStreamBufferSize :: AttrLabelProxy "bufferSize"
bufferedInputStreamBufferSize = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList BufferedInputStream = BufferedInputStreamSignalList
type BufferedInputStreamSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_buffered_input_stream_new" g_buffered_input_stream_new ::
Ptr Gio.InputStream.InputStream ->
IO (Ptr BufferedInputStream)
bufferedInputStreamNew ::
(B.CallStack.HasCallStack, MonadIO m, Gio.InputStream.IsInputStream a) =>
a
-> m BufferedInputStream
bufferedInputStreamNew baseStream = liftIO $ do
baseStream' <- unsafeManagedPtrCastPtr baseStream
result <- g_buffered_input_stream_new baseStream'
checkUnexpectedReturnNULL "bufferedInputStreamNew" result
result' <- (wrapObject BufferedInputStream) result
touchManagedPtr baseStream
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "g_buffered_input_stream_new_sized" g_buffered_input_stream_new_sized ::
Ptr Gio.InputStream.InputStream ->
Word64 ->
IO (Ptr BufferedInputStream)
bufferedInputStreamNewSized ::
(B.CallStack.HasCallStack, MonadIO m, Gio.InputStream.IsInputStream a) =>
a
-> Word64
-> m BufferedInputStream
bufferedInputStreamNewSized baseStream size = liftIO $ do
baseStream' <- unsafeManagedPtrCastPtr baseStream
result <- g_buffered_input_stream_new_sized baseStream' size
checkUnexpectedReturnNULL "bufferedInputStreamNewSized" result
result' <- (wrapObject BufferedInputStream) result
touchManagedPtr baseStream
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "g_buffered_input_stream_fill" g_buffered_input_stream_fill ::
Ptr BufferedInputStream ->
Int64 ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO Int64
bufferedInputStreamFill ::
(B.CallStack.HasCallStack, MonadIO m, IsBufferedInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> Int64
-> Maybe (b)
-> m Int64
bufferedInputStreamFill stream count cancellable = liftIO $ do
stream' <- unsafeManagedPtrCastPtr stream
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
onException (do
result <- propagateGError $ g_buffered_input_stream_fill stream' count maybeCancellable
touchManagedPtr stream
whenJust cancellable touchManagedPtr
return result
) (do
return ()
)
#if ENABLE_OVERLOADING
data BufferedInputStreamFillMethodInfo
instance (signature ~ (Int64 -> Maybe (b) -> m Int64), MonadIO m, IsBufferedInputStream a, Gio.Cancellable.IsCancellable b) => O.MethodInfo BufferedInputStreamFillMethodInfo a signature where
overloadedMethod _ = bufferedInputStreamFill
#endif
foreign import ccall "g_buffered_input_stream_fill_async" g_buffered_input_stream_fill_async ::
Ptr BufferedInputStream ->
Int64 ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
bufferedInputStreamFillAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsBufferedInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> Int64
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
bufferedInputStreamFillAsync stream count ioPriority cancellable callback = liftIO $ do
stream' <- unsafeManagedPtrCastPtr stream
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
maybeCallback <- case callback of
Nothing -> return (castPtrToFunPtr nullPtr)
Just jCallback -> do
ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = nullPtr
g_buffered_input_stream_fill_async stream' count ioPriority maybeCancellable maybeCallback userData
touchManagedPtr stream
whenJust cancellable touchManagedPtr
return ()
#if ENABLE_OVERLOADING
data BufferedInputStreamFillAsyncMethodInfo
instance (signature ~ (Int64 -> Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsBufferedInputStream a, Gio.Cancellable.IsCancellable b) => O.MethodInfo BufferedInputStreamFillAsyncMethodInfo a signature where
overloadedMethod _ = bufferedInputStreamFillAsync
#endif
foreign import ccall "g_buffered_input_stream_fill_finish" g_buffered_input_stream_fill_finish ::
Ptr BufferedInputStream ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO Int64
bufferedInputStreamFillFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsBufferedInputStream a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m Int64
bufferedInputStreamFillFinish stream result_ = liftIO $ do
stream' <- unsafeManagedPtrCastPtr stream
result_' <- unsafeManagedPtrCastPtr result_
onException (do
result <- propagateGError $ g_buffered_input_stream_fill_finish stream' result_'
touchManagedPtr stream
touchManagedPtr result_
return result
) (do
return ()
)
#if ENABLE_OVERLOADING
data BufferedInputStreamFillFinishMethodInfo
instance (signature ~ (b -> m Int64), MonadIO m, IsBufferedInputStream a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo BufferedInputStreamFillFinishMethodInfo a signature where
overloadedMethod _ = bufferedInputStreamFillFinish
#endif
foreign import ccall "g_buffered_input_stream_get_available" g_buffered_input_stream_get_available ::
Ptr BufferedInputStream ->
IO Word64
bufferedInputStreamGetAvailable ::
(B.CallStack.HasCallStack, MonadIO m, IsBufferedInputStream a) =>
a
-> m Word64
bufferedInputStreamGetAvailable stream = liftIO $ do
stream' <- unsafeManagedPtrCastPtr stream
result <- g_buffered_input_stream_get_available stream'
touchManagedPtr stream
return result
#if ENABLE_OVERLOADING
data BufferedInputStreamGetAvailableMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsBufferedInputStream a) => O.MethodInfo BufferedInputStreamGetAvailableMethodInfo a signature where
overloadedMethod _ = bufferedInputStreamGetAvailable
#endif
foreign import ccall "g_buffered_input_stream_get_buffer_size" g_buffered_input_stream_get_buffer_size ::
Ptr BufferedInputStream ->
IO Word64
bufferedInputStreamGetBufferSize ::
(B.CallStack.HasCallStack, MonadIO m, IsBufferedInputStream a) =>
a
-> m Word64
bufferedInputStreamGetBufferSize stream = liftIO $ do
stream' <- unsafeManagedPtrCastPtr stream
result <- g_buffered_input_stream_get_buffer_size stream'
touchManagedPtr stream
return result
#if ENABLE_OVERLOADING
data BufferedInputStreamGetBufferSizeMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsBufferedInputStream a) => O.MethodInfo BufferedInputStreamGetBufferSizeMethodInfo a signature where
overloadedMethod _ = bufferedInputStreamGetBufferSize
#endif
foreign import ccall "g_buffered_input_stream_peek" g_buffered_input_stream_peek ::
Ptr BufferedInputStream ->
Ptr Word8 ->
Word64 ->
Word64 ->
IO Word64
bufferedInputStreamPeek ::
(B.CallStack.HasCallStack, MonadIO m, IsBufferedInputStream a) =>
a
-> ByteString
-> Word64
-> m Word64
bufferedInputStreamPeek stream buffer offset = liftIO $ do
let count = fromIntegral $ B.length buffer
stream' <- unsafeManagedPtrCastPtr stream
buffer' <- packByteString buffer
result <- g_buffered_input_stream_peek stream' buffer' offset count
touchManagedPtr stream
freeMem buffer'
return result
#if ENABLE_OVERLOADING
data BufferedInputStreamPeekMethodInfo
instance (signature ~ (ByteString -> Word64 -> m Word64), MonadIO m, IsBufferedInputStream a) => O.MethodInfo BufferedInputStreamPeekMethodInfo a signature where
overloadedMethod _ = bufferedInputStreamPeek
#endif
foreign import ccall "g_buffered_input_stream_peek_buffer" g_buffered_input_stream_peek_buffer ::
Ptr BufferedInputStream ->
Ptr Word64 ->
IO (Ptr Word8)
bufferedInputStreamPeekBuffer ::
(B.CallStack.HasCallStack, MonadIO m, IsBufferedInputStream a) =>
a
-> m ByteString
bufferedInputStreamPeekBuffer stream = liftIO $ do
stream' <- unsafeManagedPtrCastPtr stream
count <- allocMem :: IO (Ptr Word64)
result <- g_buffered_input_stream_peek_buffer stream' count
count' <- peek count
checkUnexpectedReturnNULL "bufferedInputStreamPeekBuffer" result
result' <- (unpackByteStringWithLength count') result
touchManagedPtr stream
freeMem count
return result'
#if ENABLE_OVERLOADING
data BufferedInputStreamPeekBufferMethodInfo
instance (signature ~ (m ByteString), MonadIO m, IsBufferedInputStream a) => O.MethodInfo BufferedInputStreamPeekBufferMethodInfo a signature where
overloadedMethod _ = bufferedInputStreamPeekBuffer
#endif
foreign import ccall "g_buffered_input_stream_read_byte" g_buffered_input_stream_read_byte ::
Ptr BufferedInputStream ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO Int32
bufferedInputStreamReadByte ::
(B.CallStack.HasCallStack, MonadIO m, IsBufferedInputStream a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m Int32
bufferedInputStreamReadByte stream cancellable = liftIO $ do
stream' <- unsafeManagedPtrCastPtr stream
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
onException (do
result <- propagateGError $ g_buffered_input_stream_read_byte stream' maybeCancellable
touchManagedPtr stream
whenJust cancellable touchManagedPtr
return result
) (do
return ()
)
#if ENABLE_OVERLOADING
data BufferedInputStreamReadByteMethodInfo
instance (signature ~ (Maybe (b) -> m Int32), MonadIO m, IsBufferedInputStream a, Gio.Cancellable.IsCancellable b) => O.MethodInfo BufferedInputStreamReadByteMethodInfo a signature where
overloadedMethod _ = bufferedInputStreamReadByte
#endif
foreign import ccall "g_buffered_input_stream_set_buffer_size" g_buffered_input_stream_set_buffer_size ::
Ptr BufferedInputStream ->
Word64 ->
IO ()
bufferedInputStreamSetBufferSize ::
(B.CallStack.HasCallStack, MonadIO m, IsBufferedInputStream a) =>
a
-> Word64
-> m ()
bufferedInputStreamSetBufferSize stream size = liftIO $ do
stream' <- unsafeManagedPtrCastPtr stream
g_buffered_input_stream_set_buffer_size stream' size
touchManagedPtr stream
return ()
#if ENABLE_OVERLOADING
data BufferedInputStreamSetBufferSizeMethodInfo
instance (signature ~ (Word64 -> m ()), MonadIO m, IsBufferedInputStream a) => O.MethodInfo BufferedInputStreamSetBufferSizeMethodInfo a signature where
overloadedMethod _ = bufferedInputStreamSetBufferSize
#endif