#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Objects.BufferedOutputStream
(
BufferedOutputStream(..) ,
IsBufferedOutputStream ,
toBufferedOutputStream ,
noBufferedOutputStream ,
#if ENABLE_OVERLOADING
BufferedOutputStreamGetAutoGrowMethodInfo,
#endif
bufferedOutputStreamGetAutoGrow ,
#if ENABLE_OVERLOADING
BufferedOutputStreamGetBufferSizeMethodInfo,
#endif
bufferedOutputStreamGetBufferSize ,
bufferedOutputStreamNew ,
bufferedOutputStreamNewSized ,
#if ENABLE_OVERLOADING
BufferedOutputStreamSetAutoGrowMethodInfo,
#endif
bufferedOutputStreamSetAutoGrow ,
#if ENABLE_OVERLOADING
BufferedOutputStreamSetBufferSizeMethodInfo,
#endif
bufferedOutputStreamSetBufferSize ,
#if ENABLE_OVERLOADING
BufferedOutputStreamAutoGrowPropertyInfo,
#endif
#if ENABLE_OVERLOADING
bufferedOutputStreamAutoGrow ,
#endif
constructBufferedOutputStreamAutoGrow ,
getBufferedOutputStreamAutoGrow ,
setBufferedOutputStreamAutoGrow ,
#if ENABLE_OVERLOADING
BufferedOutputStreamBufferSizePropertyInfo,
#endif
#if 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.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.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 (ManagedPtr BufferedOutputStream)
foreign import ccall "g_buffered_output_stream_get_type"
c_g_buffered_output_stream_get_type :: IO GType
instance GObject BufferedOutputStream where
gobjectType = c_g_buffered_output_stream_get_type
class (GObject o, O.IsDescendantOf BufferedOutputStream o) => IsBufferedOutputStream o
instance (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 = liftIO . unsafeCastTo BufferedOutputStream
noBufferedOutputStream :: Maybe BufferedOutputStream
noBufferedOutputStream = Nothing
#if 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 (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
getBufferedOutputStreamAutoGrow :: (MonadIO m, IsBufferedOutputStream o) => o -> m Bool
getBufferedOutputStreamAutoGrow obj = liftIO $ B.Properties.getObjectPropertyBool obj "auto-grow"
setBufferedOutputStreamAutoGrow :: (MonadIO m, IsBufferedOutputStream o) => o -> Bool -> m ()
setBufferedOutputStreamAutoGrow obj val = liftIO $ B.Properties.setObjectPropertyBool obj "auto-grow" val
constructBufferedOutputStreamAutoGrow :: (IsBufferedOutputStream o) => Bool -> IO (GValueConstruct o)
constructBufferedOutputStreamAutoGrow val = B.Properties.constructObjectPropertyBool "auto-grow" val
#if ENABLE_OVERLOADING
data BufferedOutputStreamAutoGrowPropertyInfo
instance AttrInfo BufferedOutputStreamAutoGrowPropertyInfo where
type AttrAllowedOps BufferedOutputStreamAutoGrowPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint BufferedOutputStreamAutoGrowPropertyInfo = (~) Bool
type AttrBaseTypeConstraint BufferedOutputStreamAutoGrowPropertyInfo = IsBufferedOutputStream
type AttrGetType BufferedOutputStreamAutoGrowPropertyInfo = Bool
type AttrLabel BufferedOutputStreamAutoGrowPropertyInfo = "auto-grow"
type AttrOrigin BufferedOutputStreamAutoGrowPropertyInfo = BufferedOutputStream
attrGet _ = getBufferedOutputStreamAutoGrow
attrSet _ = setBufferedOutputStreamAutoGrow
attrConstruct _ = constructBufferedOutputStreamAutoGrow
attrClear _ = undefined
#endif
getBufferedOutputStreamBufferSize :: (MonadIO m, IsBufferedOutputStream o) => o -> m Word32
getBufferedOutputStreamBufferSize obj = liftIO $ B.Properties.getObjectPropertyUInt32 obj "buffer-size"
setBufferedOutputStreamBufferSize :: (MonadIO m, IsBufferedOutputStream o) => o -> Word32 -> m ()
setBufferedOutputStreamBufferSize obj val = liftIO $ B.Properties.setObjectPropertyUInt32 obj "buffer-size" val
constructBufferedOutputStreamBufferSize :: (IsBufferedOutputStream o) => Word32 -> IO (GValueConstruct o)
constructBufferedOutputStreamBufferSize val = B.Properties.constructObjectPropertyUInt32 "buffer-size" val
#if ENABLE_OVERLOADING
data BufferedOutputStreamBufferSizePropertyInfo
instance AttrInfo BufferedOutputStreamBufferSizePropertyInfo where
type AttrAllowedOps BufferedOutputStreamBufferSizePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint BufferedOutputStreamBufferSizePropertyInfo = (~) Word32
type AttrBaseTypeConstraint BufferedOutputStreamBufferSizePropertyInfo = IsBufferedOutputStream
type AttrGetType BufferedOutputStreamBufferSizePropertyInfo = Word32
type AttrLabel BufferedOutputStreamBufferSizePropertyInfo = "buffer-size"
type AttrOrigin BufferedOutputStreamBufferSizePropertyInfo = BufferedOutputStream
attrGet _ = getBufferedOutputStreamBufferSize
attrSet _ = setBufferedOutputStreamBufferSize
attrConstruct _ = constructBufferedOutputStreamBufferSize
attrClear _ = undefined
#endif
#if 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 ENABLE_OVERLOADING
bufferedOutputStreamAutoGrow :: AttrLabelProxy "autoGrow"
bufferedOutputStreamAutoGrow = AttrLabelProxy
bufferedOutputStreamBufferSize :: AttrLabelProxy "bufferSize"
bufferedOutputStreamBufferSize = AttrLabelProxy
#endif
#if 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 baseStream = liftIO $ do
baseStream' <- unsafeManagedPtrCastPtr baseStream
result <- g_buffered_output_stream_new baseStream'
checkUnexpectedReturnNULL "bufferedOutputStreamNew" result
result' <- (wrapObject BufferedOutputStream) result
touchManagedPtr baseStream
return result'
#if 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 baseStream size = liftIO $ do
baseStream' <- unsafeManagedPtrCastPtr baseStream
result <- g_buffered_output_stream_new_sized baseStream' size
checkUnexpectedReturnNULL "bufferedOutputStreamNewSized" result
result' <- (wrapObject BufferedOutputStream) result
touchManagedPtr baseStream
return result'
#if 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 stream = liftIO $ do
stream' <- unsafeManagedPtrCastPtr stream
result <- g_buffered_output_stream_get_auto_grow stream'
let result' = (/= 0) result
touchManagedPtr stream
return result'
#if 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 stream = liftIO $ do
stream' <- unsafeManagedPtrCastPtr stream
result <- g_buffered_output_stream_get_buffer_size stream'
touchManagedPtr stream
return result
#if 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 stream autoGrow = liftIO $ do
stream' <- unsafeManagedPtrCastPtr stream
let autoGrow' = (fromIntegral . fromEnum) autoGrow
g_buffered_output_stream_set_auto_grow stream' autoGrow'
touchManagedPtr stream
return ()
#if 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 stream size = liftIO $ do
stream' <- unsafeManagedPtrCastPtr stream
g_buffered_output_stream_set_buffer_size stream' size
touchManagedPtr stream
return ()
#if ENABLE_OVERLOADING
data BufferedOutputStreamSetBufferSizeMethodInfo
instance (signature ~ (Word64 -> m ()), MonadIO m, IsBufferedOutputStream a) => O.MethodInfo BufferedOutputStreamSetBufferSizeMethodInfo a signature where
overloadedMethod _ = bufferedOutputStreamSetBufferSize
#endif