{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.BufferedOutputStream
(
BufferedOutputStream(..) ,
IsBufferedOutputStream ,
toBufferedOutputStream ,
#if defined(ENABLE_OVERLOADING)
ResolveBufferedOutputStreamMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
BufferedOutputStreamGetAutoGrowMethodInfo,
#endif
bufferedOutputStreamGetAutoGrow ,
#if defined(ENABLE_OVERLOADING)
BufferedOutputStreamGetBufferSizeMethodInfo,
#endif
bufferedOutputStreamGetBufferSize ,
bufferedOutputStreamNew ,
bufferedOutputStreamNewSized ,
#if defined(ENABLE_OVERLOADING)
BufferedOutputStreamSetAutoGrowMethodInfo,
#endif
bufferedOutputStreamSetAutoGrow ,
#if defined(ENABLE_OVERLOADING)
BufferedOutputStreamSetBufferSizeMethodInfo,
#endif
bufferedOutputStreamSetBufferSize ,
#if defined(ENABLE_OVERLOADING)
BufferedOutputStreamAutoGrowPropertyInfo,
#endif
#if defined(ENABLE_OVERLOADING)
bufferedOutputStreamAutoGrow ,
#endif
constructBufferedOutputStreamAutoGrow ,
getBufferedOutputStreamAutoGrow ,
setBufferedOutputStreamAutoGrow ,
#if defined(ENABLE_OVERLOADING)
BufferedOutputStreamBufferSizePropertyInfo,
#endif
#if defined(ENABLE_OVERLOADING)
bufferedOutputStreamBufferSize ,
#endif
constructBufferedOutputStreamBufferSize ,
getBufferedOutputStreamBufferSize ,
setBufferedOutputStreamBufferSize ,
) 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.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 Control.Monad.IO.Class as MIO
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Seekable as Gio.Seekable
import {-# SOURCE #-} qualified GI.Gio.Objects.FilterOutputStream as Gio.FilterOutputStream
import {-# SOURCE #-} qualified GI.Gio.Objects.OutputStream as Gio.OutputStream
newtype BufferedOutputStream = BufferedOutputStream (SP.ManagedPtr BufferedOutputStream)
deriving (BufferedOutputStream -> BufferedOutputStream -> Bool
(BufferedOutputStream -> BufferedOutputStream -> Bool)
-> (BufferedOutputStream -> BufferedOutputStream -> Bool)
-> Eq BufferedOutputStream
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BufferedOutputStream -> BufferedOutputStream -> Bool
$c/= :: BufferedOutputStream -> BufferedOutputStream -> Bool
== :: BufferedOutputStream -> BufferedOutputStream -> Bool
$c== :: BufferedOutputStream -> BufferedOutputStream -> Bool
Eq)
instance SP.ManagedPtrNewtype BufferedOutputStream where
toManagedPtr :: BufferedOutputStream -> ManagedPtr BufferedOutputStream
toManagedPtr (BufferedOutputStream ManagedPtr BufferedOutputStream
p) = ManagedPtr BufferedOutputStream
p
foreign import ccall "g_buffered_output_stream_get_type"
c_g_buffered_output_stream_get_type :: IO B.Types.GType
instance B.Types.TypedObject BufferedOutputStream where
glibType :: IO GType
glibType = IO GType
c_g_buffered_output_stream_get_type
instance B.Types.GObject BufferedOutputStream
instance B.GValue.IsGValue BufferedOutputStream where
toGValue :: BufferedOutputStream -> IO GValue
toGValue BufferedOutputStream
o = do
GType
gtype <- IO GType
c_g_buffered_output_stream_get_type
BufferedOutputStream
-> (Ptr BufferedOutputStream -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr BufferedOutputStream
o (GType
-> (GValue -> Ptr BufferedOutputStream -> IO ())
-> Ptr BufferedOutputStream
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr BufferedOutputStream -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO BufferedOutputStream
fromGValue GValue
gv = do
Ptr BufferedOutputStream
ptr <- GValue -> IO (Ptr BufferedOutputStream)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr BufferedOutputStream)
(ManagedPtr BufferedOutputStream -> BufferedOutputStream)
-> Ptr BufferedOutputStream -> IO BufferedOutputStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr BufferedOutputStream -> BufferedOutputStream
BufferedOutputStream Ptr BufferedOutputStream
ptr
class (SP.GObject o, O.IsDescendantOf BufferedOutputStream o) => IsBufferedOutputStream o
instance (SP.GObject o, O.IsDescendantOf BufferedOutputStream o) => IsBufferedOutputStream o
instance O.HasParentTypes BufferedOutputStream
type instance O.ParentTypes BufferedOutputStream = '[Gio.FilterOutputStream.FilterOutputStream, Gio.OutputStream.OutputStream, GObject.Object.Object, Gio.Seekable.Seekable]
toBufferedOutputStream :: (MonadIO m, IsBufferedOutputStream o) => o -> m BufferedOutputStream
toBufferedOutputStream :: o -> m BufferedOutputStream
toBufferedOutputStream = IO BufferedOutputStream -> m BufferedOutputStream
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO BufferedOutputStream -> m BufferedOutputStream)
-> (o -> IO BufferedOutputStream) -> o -> m BufferedOutputStream
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr BufferedOutputStream -> BufferedOutputStream)
-> o -> IO BufferedOutputStream
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr BufferedOutputStream -> BufferedOutputStream
BufferedOutputStream
#if defined(ENABLE_OVERLOADING)
type family ResolveBufferedOutputStreamMethod (t :: Symbol) (o :: *) :: * where
ResolveBufferedOutputStreamMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveBufferedOutputStreamMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveBufferedOutputStreamMethod "canSeek" o = Gio.Seekable.SeekableCanSeekMethodInfo
ResolveBufferedOutputStreamMethod "canTruncate" o = Gio.Seekable.SeekableCanTruncateMethodInfo
ResolveBufferedOutputStreamMethod "clearPending" o = Gio.OutputStream.OutputStreamClearPendingMethodInfo
ResolveBufferedOutputStreamMethod "close" o = Gio.OutputStream.OutputStreamCloseMethodInfo
ResolveBufferedOutputStreamMethod "closeAsync" o = Gio.OutputStream.OutputStreamCloseAsyncMethodInfo
ResolveBufferedOutputStreamMethod "closeFinish" o = Gio.OutputStream.OutputStreamCloseFinishMethodInfo
ResolveBufferedOutputStreamMethod "flush" o = Gio.OutputStream.OutputStreamFlushMethodInfo
ResolveBufferedOutputStreamMethod "flushAsync" o = Gio.OutputStream.OutputStreamFlushAsyncMethodInfo
ResolveBufferedOutputStreamMethod "flushFinish" o = Gio.OutputStream.OutputStreamFlushFinishMethodInfo
ResolveBufferedOutputStreamMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveBufferedOutputStreamMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveBufferedOutputStreamMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveBufferedOutputStreamMethod "hasPending" o = Gio.OutputStream.OutputStreamHasPendingMethodInfo
ResolveBufferedOutputStreamMethod "isClosed" o = Gio.OutputStream.OutputStreamIsClosedMethodInfo
ResolveBufferedOutputStreamMethod "isClosing" o = Gio.OutputStream.OutputStreamIsClosingMethodInfo
ResolveBufferedOutputStreamMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveBufferedOutputStreamMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveBufferedOutputStreamMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveBufferedOutputStreamMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveBufferedOutputStreamMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveBufferedOutputStreamMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveBufferedOutputStreamMethod "seek" o = Gio.Seekable.SeekableSeekMethodInfo
ResolveBufferedOutputStreamMethod "splice" o = Gio.OutputStream.OutputStreamSpliceMethodInfo
ResolveBufferedOutputStreamMethod "spliceAsync" o = Gio.OutputStream.OutputStreamSpliceAsyncMethodInfo
ResolveBufferedOutputStreamMethod "spliceFinish" o = Gio.OutputStream.OutputStreamSpliceFinishMethodInfo
ResolveBufferedOutputStreamMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveBufferedOutputStreamMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveBufferedOutputStreamMethod "tell" o = Gio.Seekable.SeekableTellMethodInfo
ResolveBufferedOutputStreamMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveBufferedOutputStreamMethod "truncate" o = Gio.Seekable.SeekableTruncateMethodInfo
ResolveBufferedOutputStreamMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveBufferedOutputStreamMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveBufferedOutputStreamMethod "write" o = Gio.OutputStream.OutputStreamWriteMethodInfo
ResolveBufferedOutputStreamMethod "writeAll" o = Gio.OutputStream.OutputStreamWriteAllMethodInfo
ResolveBufferedOutputStreamMethod "writeAllAsync" o = Gio.OutputStream.OutputStreamWriteAllAsyncMethodInfo
ResolveBufferedOutputStreamMethod "writeAllFinish" o = Gio.OutputStream.OutputStreamWriteAllFinishMethodInfo
ResolveBufferedOutputStreamMethod "writeAsync" o = Gio.OutputStream.OutputStreamWriteAsyncMethodInfo
ResolveBufferedOutputStreamMethod "writeBytes" o = Gio.OutputStream.OutputStreamWriteBytesMethodInfo
ResolveBufferedOutputStreamMethod "writeBytesAsync" o = Gio.OutputStream.OutputStreamWriteBytesAsyncMethodInfo
ResolveBufferedOutputStreamMethod "writeBytesFinish" o = Gio.OutputStream.OutputStreamWriteBytesFinishMethodInfo
ResolveBufferedOutputStreamMethod "writeFinish" o = Gio.OutputStream.OutputStreamWriteFinishMethodInfo
ResolveBufferedOutputStreamMethod "writev" o = Gio.OutputStream.OutputStreamWritevMethodInfo
ResolveBufferedOutputStreamMethod "writevAll" o = Gio.OutputStream.OutputStreamWritevAllMethodInfo
ResolveBufferedOutputStreamMethod "writevAllAsync" o = Gio.OutputStream.OutputStreamWritevAllAsyncMethodInfo
ResolveBufferedOutputStreamMethod "writevAllFinish" o = Gio.OutputStream.OutputStreamWritevAllFinishMethodInfo
ResolveBufferedOutputStreamMethod "writevAsync" o = Gio.OutputStream.OutputStreamWritevAsyncMethodInfo
ResolveBufferedOutputStreamMethod "writevFinish" o = Gio.OutputStream.OutputStreamWritevFinishMethodInfo
ResolveBufferedOutputStreamMethod "getAutoGrow" o = BufferedOutputStreamGetAutoGrowMethodInfo
ResolveBufferedOutputStreamMethod "getBaseStream" o = Gio.FilterOutputStream.FilterOutputStreamGetBaseStreamMethodInfo
ResolveBufferedOutputStreamMethod "getBufferSize" o = BufferedOutputStreamGetBufferSizeMethodInfo
ResolveBufferedOutputStreamMethod "getCloseBaseStream" o = Gio.FilterOutputStream.FilterOutputStreamGetCloseBaseStreamMethodInfo
ResolveBufferedOutputStreamMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveBufferedOutputStreamMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveBufferedOutputStreamMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveBufferedOutputStreamMethod "setAutoGrow" o = BufferedOutputStreamSetAutoGrowMethodInfo
ResolveBufferedOutputStreamMethod "setBufferSize" o = BufferedOutputStreamSetBufferSizeMethodInfo
ResolveBufferedOutputStreamMethod "setCloseBaseStream" o = Gio.FilterOutputStream.FilterOutputStreamSetCloseBaseStreamMethodInfo
ResolveBufferedOutputStreamMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveBufferedOutputStreamMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveBufferedOutputStreamMethod "setPending" o = Gio.OutputStream.OutputStreamSetPendingMethodInfo
ResolveBufferedOutputStreamMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveBufferedOutputStreamMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveBufferedOutputStreamMethod t BufferedOutputStream, O.MethodInfo info BufferedOutputStream p) => OL.IsLabel t (BufferedOutputStream -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
getBufferedOutputStreamAutoGrow :: (MonadIO m, IsBufferedOutputStream o) => o -> m Bool
getBufferedOutputStreamAutoGrow :: o -> m Bool
getBufferedOutputStreamAutoGrow o
obj = 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
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"auto-grow"
setBufferedOutputStreamAutoGrow :: (MonadIO m, IsBufferedOutputStream o) => o -> Bool -> m ()
setBufferedOutputStreamAutoGrow :: o -> Bool -> m ()
setBufferedOutputStreamAutoGrow o
obj Bool
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Bool -> IO ()
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj String
"auto-grow" Bool
val
constructBufferedOutputStreamAutoGrow :: (IsBufferedOutputStream o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
constructBufferedOutputStreamAutoGrow :: Bool -> m (GValueConstruct o)
constructBufferedOutputStreamAutoGrow Bool
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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
$ String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool String
"auto-grow" Bool
val
#if defined(ENABLE_OVERLOADING)
data BufferedOutputStreamAutoGrowPropertyInfo
instance AttrInfo BufferedOutputStreamAutoGrowPropertyInfo where
type AttrAllowedOps BufferedOutputStreamAutoGrowPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint BufferedOutputStreamAutoGrowPropertyInfo = IsBufferedOutputStream
type AttrSetTypeConstraint BufferedOutputStreamAutoGrowPropertyInfo = (~) Bool
type AttrTransferTypeConstraint BufferedOutputStreamAutoGrowPropertyInfo = (~) Bool
type AttrTransferType BufferedOutputStreamAutoGrowPropertyInfo = Bool
type AttrGetType BufferedOutputStreamAutoGrowPropertyInfo = Bool
type AttrLabel BufferedOutputStreamAutoGrowPropertyInfo = "auto-grow"
type AttrOrigin BufferedOutputStreamAutoGrowPropertyInfo = BufferedOutputStream
attrGet = getBufferedOutputStreamAutoGrow
attrSet = setBufferedOutputStreamAutoGrow
attrTransfer _ v = do
return v
attrConstruct = constructBufferedOutputStreamAutoGrow
attrClear = undefined
#endif
getBufferedOutputStreamBufferSize :: (MonadIO m, IsBufferedOutputStream o) => o -> m Word32
getBufferedOutputStreamBufferSize :: o -> m Word32
getBufferedOutputStreamBufferSize o
obj = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Word32
forall a. GObject a => a -> String -> IO Word32
B.Properties.getObjectPropertyUInt32 o
obj String
"buffer-size"
setBufferedOutputStreamBufferSize :: (MonadIO m, IsBufferedOutputStream o) => o -> Word32 -> m ()
setBufferedOutputStreamBufferSize :: o -> Word32 -> m ()
setBufferedOutputStreamBufferSize o
obj Word32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Word32 -> IO ()
forall a. GObject a => a -> String -> Word32 -> IO ()
B.Properties.setObjectPropertyUInt32 o
obj String
"buffer-size" Word32
val
constructBufferedOutputStreamBufferSize :: (IsBufferedOutputStream o, MIO.MonadIO m) => Word32 -> m (GValueConstruct o)
constructBufferedOutputStreamBufferSize :: Word32 -> m (GValueConstruct o)
constructBufferedOutputStreamBufferSize Word32
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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
$ String -> Word32 -> IO (GValueConstruct o)
forall o. String -> Word32 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyUInt32 String
"buffer-size" Word32
val
#if defined(ENABLE_OVERLOADING)
data BufferedOutputStreamBufferSizePropertyInfo
instance AttrInfo BufferedOutputStreamBufferSizePropertyInfo where
type AttrAllowedOps BufferedOutputStreamBufferSizePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint BufferedOutputStreamBufferSizePropertyInfo = IsBufferedOutputStream
type AttrSetTypeConstraint BufferedOutputStreamBufferSizePropertyInfo = (~) Word32
type AttrTransferTypeConstraint BufferedOutputStreamBufferSizePropertyInfo = (~) Word32
type AttrTransferType BufferedOutputStreamBufferSizePropertyInfo = Word32
type AttrGetType BufferedOutputStreamBufferSizePropertyInfo = Word32
type AttrLabel BufferedOutputStreamBufferSizePropertyInfo = "buffer-size"
type AttrOrigin BufferedOutputStreamBufferSizePropertyInfo = BufferedOutputStream
attrGet = getBufferedOutputStreamBufferSize
attrSet = setBufferedOutputStreamBufferSize
attrTransfer _ v = do
return v
attrConstruct = constructBufferedOutputStreamBufferSize
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList BufferedOutputStream
type instance O.AttributeList BufferedOutputStream = BufferedOutputStreamAttributeList
type BufferedOutputStreamAttributeList = ('[ '("autoGrow", BufferedOutputStreamAutoGrowPropertyInfo), '("baseStream", Gio.FilterOutputStream.FilterOutputStreamBaseStreamPropertyInfo), '("bufferSize", BufferedOutputStreamBufferSizePropertyInfo), '("closeBaseStream", Gio.FilterOutputStream.FilterOutputStreamCloseBaseStreamPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
bufferedOutputStreamAutoGrow :: AttrLabelProxy "autoGrow"
bufferedOutputStreamAutoGrow = AttrLabelProxy
bufferedOutputStreamBufferSize :: AttrLabelProxy "bufferSize"
bufferedOutputStreamBufferSize = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList BufferedOutputStream = BufferedOutputStreamSignalList
type BufferedOutputStreamSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_buffered_output_stream_new" g_buffered_output_stream_new ::
Ptr Gio.OutputStream.OutputStream ->
IO (Ptr BufferedOutputStream)
bufferedOutputStreamNew ::
(B.CallStack.HasCallStack, MonadIO m, Gio.OutputStream.IsOutputStream a) =>
a
-> m BufferedOutputStream
bufferedOutputStreamNew :: a -> m BufferedOutputStream
bufferedOutputStreamNew a
baseStream = IO BufferedOutputStream -> m BufferedOutputStream
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO BufferedOutputStream -> m BufferedOutputStream)
-> IO BufferedOutputStream -> m BufferedOutputStream
forall a b. (a -> b) -> a -> b
$ do
Ptr OutputStream
baseStream' <- a -> IO (Ptr OutputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
baseStream
Ptr BufferedOutputStream
result <- Ptr OutputStream -> IO (Ptr BufferedOutputStream)
g_buffered_output_stream_new Ptr OutputStream
baseStream'
Text -> Ptr BufferedOutputStream -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bufferedOutputStreamNew" Ptr BufferedOutputStream
result
BufferedOutputStream
result' <- ((ManagedPtr BufferedOutputStream -> BufferedOutputStream)
-> Ptr BufferedOutputStream -> IO BufferedOutputStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr BufferedOutputStream -> BufferedOutputStream
BufferedOutputStream) Ptr BufferedOutputStream
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
baseStream
BufferedOutputStream -> IO BufferedOutputStream
forall (m :: * -> *) a. Monad m => a -> m a
return BufferedOutputStream
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_buffered_output_stream_new_sized" g_buffered_output_stream_new_sized ::
Ptr Gio.OutputStream.OutputStream ->
Word64 ->
IO (Ptr BufferedOutputStream)
bufferedOutputStreamNewSized ::
(B.CallStack.HasCallStack, MonadIO m, Gio.OutputStream.IsOutputStream a) =>
a
-> Word64
-> m BufferedOutputStream
bufferedOutputStreamNewSized :: a -> Word64 -> m BufferedOutputStream
bufferedOutputStreamNewSized a
baseStream Word64
size = IO BufferedOutputStream -> m BufferedOutputStream
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO BufferedOutputStream -> m BufferedOutputStream)
-> IO BufferedOutputStream -> m BufferedOutputStream
forall a b. (a -> b) -> a -> b
$ do
Ptr OutputStream
baseStream' <- a -> IO (Ptr OutputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
baseStream
Ptr BufferedOutputStream
result <- Ptr OutputStream -> Word64 -> IO (Ptr BufferedOutputStream)
g_buffered_output_stream_new_sized Ptr OutputStream
baseStream' Word64
size
Text -> Ptr BufferedOutputStream -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bufferedOutputStreamNewSized" Ptr BufferedOutputStream
result
BufferedOutputStream
result' <- ((ManagedPtr BufferedOutputStream -> BufferedOutputStream)
-> Ptr BufferedOutputStream -> IO BufferedOutputStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr BufferedOutputStream -> BufferedOutputStream
BufferedOutputStream) Ptr BufferedOutputStream
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
baseStream
BufferedOutputStream -> IO BufferedOutputStream
forall (m :: * -> *) a. Monad m => a -> m a
return BufferedOutputStream
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_buffered_output_stream_get_auto_grow" g_buffered_output_stream_get_auto_grow ::
Ptr BufferedOutputStream ->
IO CInt
bufferedOutputStreamGetAutoGrow ::
(B.CallStack.HasCallStack, MonadIO m, IsBufferedOutputStream a) =>
a
-> m Bool
bufferedOutputStreamGetAutoGrow :: a -> m Bool
bufferedOutputStreamGetAutoGrow a
stream = 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 BufferedOutputStream
stream' <- a -> IO (Ptr BufferedOutputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
CInt
result <- Ptr BufferedOutputStream -> IO CInt
g_buffered_output_stream_get_auto_grow Ptr BufferedOutputStream
stream'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data BufferedOutputStreamGetAutoGrowMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsBufferedOutputStream a) => O.MethodInfo BufferedOutputStreamGetAutoGrowMethodInfo a signature where
overloadedMethod = bufferedOutputStreamGetAutoGrow
#endif
foreign import ccall "g_buffered_output_stream_get_buffer_size" g_buffered_output_stream_get_buffer_size ::
Ptr BufferedOutputStream ->
IO Word64
bufferedOutputStreamGetBufferSize ::
(B.CallStack.HasCallStack, MonadIO m, IsBufferedOutputStream a) =>
a
-> m Word64
bufferedOutputStreamGetBufferSize :: a -> m Word64
bufferedOutputStreamGetBufferSize a
stream = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
Ptr BufferedOutputStream
stream' <- a -> IO (Ptr BufferedOutputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
Word64
result <- Ptr BufferedOutputStream -> IO Word64
g_buffered_output_stream_get_buffer_size Ptr BufferedOutputStream
stream'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result
#if defined(ENABLE_OVERLOADING)
data BufferedOutputStreamGetBufferSizeMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsBufferedOutputStream a) => O.MethodInfo BufferedOutputStreamGetBufferSizeMethodInfo a signature where
overloadedMethod = bufferedOutputStreamGetBufferSize
#endif
foreign import ccall "g_buffered_output_stream_set_auto_grow" g_buffered_output_stream_set_auto_grow ::
Ptr BufferedOutputStream ->
CInt ->
IO ()
bufferedOutputStreamSetAutoGrow ::
(B.CallStack.HasCallStack, MonadIO m, IsBufferedOutputStream a) =>
a
-> Bool
-> m ()
bufferedOutputStreamSetAutoGrow :: a -> Bool -> m ()
bufferedOutputStreamSetAutoGrow a
stream Bool
autoGrow = 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 BufferedOutputStream
stream' <- a -> IO (Ptr BufferedOutputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
let autoGrow' :: CInt
autoGrow' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
autoGrow
Ptr BufferedOutputStream -> CInt -> IO ()
g_buffered_output_stream_set_auto_grow Ptr BufferedOutputStream
stream' CInt
autoGrow'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BufferedOutputStreamSetAutoGrowMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsBufferedOutputStream a) => O.MethodInfo BufferedOutputStreamSetAutoGrowMethodInfo a signature where
overloadedMethod = bufferedOutputStreamSetAutoGrow
#endif
foreign import ccall "g_buffered_output_stream_set_buffer_size" g_buffered_output_stream_set_buffer_size ::
Ptr BufferedOutputStream ->
Word64 ->
IO ()
bufferedOutputStreamSetBufferSize ::
(B.CallStack.HasCallStack, MonadIO m, IsBufferedOutputStream a) =>
a
-> Word64
-> m ()
bufferedOutputStreamSetBufferSize :: a -> Word64 -> m ()
bufferedOutputStreamSetBufferSize a
stream Word64
size = 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 BufferedOutputStream
stream' <- a -> IO (Ptr BufferedOutputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
stream
Ptr BufferedOutputStream -> Word64 -> IO ()
g_buffered_output_stream_set_buffer_size Ptr BufferedOutputStream
stream' Word64
size
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
stream
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data BufferedOutputStreamSetBufferSizeMethodInfo
instance (signature ~ (Word64 -> m ()), MonadIO m, IsBufferedOutputStream a) => O.MethodInfo BufferedOutputStreamSetBufferSizeMethodInfo a signature where
overloadedMethod = bufferedOutputStreamSetBufferSize
#endif