#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Objects.MemoryOutputStream
(
MemoryOutputStream(..) ,
IsMemoryOutputStream ,
toMemoryOutputStream ,
noMemoryOutputStream ,
#if ENABLE_OVERLOADING
MemoryOutputStreamGetDataMethodInfo ,
#endif
memoryOutputStreamGetData ,
#if ENABLE_OVERLOADING
MemoryOutputStreamGetDataSizeMethodInfo ,
#endif
memoryOutputStreamGetDataSize ,
#if ENABLE_OVERLOADING
MemoryOutputStreamGetSizeMethodInfo ,
#endif
memoryOutputStreamGetSize ,
memoryOutputStreamNewResizable ,
#if ENABLE_OVERLOADING
MemoryOutputStreamStealAsBytesMethodInfo,
#endif
memoryOutputStreamStealAsBytes ,
#if ENABLE_OVERLOADING
MemoryOutputStreamStealDataMethodInfo ,
#endif
memoryOutputStreamStealData ,
#if ENABLE_OVERLOADING
MemoryOutputStreamDataPropertyInfo ,
#endif
constructMemoryOutputStreamData ,
getMemoryOutputStreamData ,
#if ENABLE_OVERLOADING
memoryOutputStreamData ,
#endif
#if ENABLE_OVERLOADING
MemoryOutputStreamDataSizePropertyInfo ,
#endif
getMemoryOutputStreamDataSize ,
#if ENABLE_OVERLOADING
memoryOutputStreamDataSize ,
#endif
#if ENABLE_OVERLOADING
MemoryOutputStreamSizePropertyInfo ,
#endif
constructMemoryOutputStreamSize ,
getMemoryOutputStreamSize ,
#if ENABLE_OVERLOADING
memoryOutputStreamSize ,
#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.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.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Interfaces.PollableOutputStream as Gio.PollableOutputStream
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Seekable as Gio.Seekable
import {-# SOURCE #-} qualified GI.Gio.Objects.OutputStream as Gio.OutputStream
newtype MemoryOutputStream = MemoryOutputStream (ManagedPtr MemoryOutputStream)
foreign import ccall "g_memory_output_stream_get_type"
c_g_memory_output_stream_get_type :: IO GType
instance GObject MemoryOutputStream where
gobjectType = c_g_memory_output_stream_get_type
class (GObject o, O.IsDescendantOf MemoryOutputStream o) => IsMemoryOutputStream o
instance (GObject o, O.IsDescendantOf MemoryOutputStream o) => IsMemoryOutputStream o
instance O.HasParentTypes MemoryOutputStream
type instance O.ParentTypes MemoryOutputStream = '[Gio.OutputStream.OutputStream, GObject.Object.Object, Gio.PollableOutputStream.PollableOutputStream, Gio.Seekable.Seekable]
toMemoryOutputStream :: (MonadIO m, IsMemoryOutputStream o) => o -> m MemoryOutputStream
toMemoryOutputStream = liftIO . unsafeCastTo MemoryOutputStream
noMemoryOutputStream :: Maybe MemoryOutputStream
noMemoryOutputStream = Nothing
#if ENABLE_OVERLOADING
type family ResolveMemoryOutputStreamMethod (t :: Symbol) (o :: *) :: * where
ResolveMemoryOutputStreamMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveMemoryOutputStreamMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveMemoryOutputStreamMethod "canPoll" o = Gio.PollableOutputStream.PollableOutputStreamCanPollMethodInfo
ResolveMemoryOutputStreamMethod "canSeek" o = Gio.Seekable.SeekableCanSeekMethodInfo
ResolveMemoryOutputStreamMethod "canTruncate" o = Gio.Seekable.SeekableCanTruncateMethodInfo
ResolveMemoryOutputStreamMethod "clearPending" o = Gio.OutputStream.OutputStreamClearPendingMethodInfo
ResolveMemoryOutputStreamMethod "close" o = Gio.OutputStream.OutputStreamCloseMethodInfo
ResolveMemoryOutputStreamMethod "closeAsync" o = Gio.OutputStream.OutputStreamCloseAsyncMethodInfo
ResolveMemoryOutputStreamMethod "closeFinish" o = Gio.OutputStream.OutputStreamCloseFinishMethodInfo
ResolveMemoryOutputStreamMethod "createSource" o = Gio.PollableOutputStream.PollableOutputStreamCreateSourceMethodInfo
ResolveMemoryOutputStreamMethod "flush" o = Gio.OutputStream.OutputStreamFlushMethodInfo
ResolveMemoryOutputStreamMethod "flushAsync" o = Gio.OutputStream.OutputStreamFlushAsyncMethodInfo
ResolveMemoryOutputStreamMethod "flushFinish" o = Gio.OutputStream.OutputStreamFlushFinishMethodInfo
ResolveMemoryOutputStreamMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveMemoryOutputStreamMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveMemoryOutputStreamMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveMemoryOutputStreamMethod "hasPending" o = Gio.OutputStream.OutputStreamHasPendingMethodInfo
ResolveMemoryOutputStreamMethod "isClosed" o = Gio.OutputStream.OutputStreamIsClosedMethodInfo
ResolveMemoryOutputStreamMethod "isClosing" o = Gio.OutputStream.OutputStreamIsClosingMethodInfo
ResolveMemoryOutputStreamMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveMemoryOutputStreamMethod "isWritable" o = Gio.PollableOutputStream.PollableOutputStreamIsWritableMethodInfo
ResolveMemoryOutputStreamMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveMemoryOutputStreamMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveMemoryOutputStreamMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveMemoryOutputStreamMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveMemoryOutputStreamMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveMemoryOutputStreamMethod "seek" o = Gio.Seekable.SeekableSeekMethodInfo
ResolveMemoryOutputStreamMethod "splice" o = Gio.OutputStream.OutputStreamSpliceMethodInfo
ResolveMemoryOutputStreamMethod "spliceAsync" o = Gio.OutputStream.OutputStreamSpliceAsyncMethodInfo
ResolveMemoryOutputStreamMethod "spliceFinish" o = Gio.OutputStream.OutputStreamSpliceFinishMethodInfo
ResolveMemoryOutputStreamMethod "stealAsBytes" o = MemoryOutputStreamStealAsBytesMethodInfo
ResolveMemoryOutputStreamMethod "stealData" o = MemoryOutputStreamStealDataMethodInfo
ResolveMemoryOutputStreamMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveMemoryOutputStreamMethod "tell" o = Gio.Seekable.SeekableTellMethodInfo
ResolveMemoryOutputStreamMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveMemoryOutputStreamMethod "truncate" o = Gio.Seekable.SeekableTruncateMethodInfo
ResolveMemoryOutputStreamMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveMemoryOutputStreamMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveMemoryOutputStreamMethod "write" o = Gio.OutputStream.OutputStreamWriteMethodInfo
ResolveMemoryOutputStreamMethod "writeAll" o = Gio.OutputStream.OutputStreamWriteAllMethodInfo
ResolveMemoryOutputStreamMethod "writeAllAsync" o = Gio.OutputStream.OutputStreamWriteAllAsyncMethodInfo
ResolveMemoryOutputStreamMethod "writeAllFinish" o = Gio.OutputStream.OutputStreamWriteAllFinishMethodInfo
ResolveMemoryOutputStreamMethod "writeAsync" o = Gio.OutputStream.OutputStreamWriteAsyncMethodInfo
ResolveMemoryOutputStreamMethod "writeBytes" o = Gio.OutputStream.OutputStreamWriteBytesMethodInfo
ResolveMemoryOutputStreamMethod "writeBytesAsync" o = Gio.OutputStream.OutputStreamWriteBytesAsyncMethodInfo
ResolveMemoryOutputStreamMethod "writeBytesFinish" o = Gio.OutputStream.OutputStreamWriteBytesFinishMethodInfo
ResolveMemoryOutputStreamMethod "writeFinish" o = Gio.OutputStream.OutputStreamWriteFinishMethodInfo
ResolveMemoryOutputStreamMethod "writeNonblocking" o = Gio.PollableOutputStream.PollableOutputStreamWriteNonblockingMethodInfo
ResolveMemoryOutputStreamMethod "writev" o = Gio.OutputStream.OutputStreamWritevMethodInfo
ResolveMemoryOutputStreamMethod "writevAll" o = Gio.OutputStream.OutputStreamWritevAllMethodInfo
ResolveMemoryOutputStreamMethod "writevAllAsync" o = Gio.OutputStream.OutputStreamWritevAllAsyncMethodInfo
ResolveMemoryOutputStreamMethod "writevAllFinish" o = Gio.OutputStream.OutputStreamWritevAllFinishMethodInfo
ResolveMemoryOutputStreamMethod "writevAsync" o = Gio.OutputStream.OutputStreamWritevAsyncMethodInfo
ResolveMemoryOutputStreamMethod "writevFinish" o = Gio.OutputStream.OutputStreamWritevFinishMethodInfo
ResolveMemoryOutputStreamMethod "writevNonblocking" o = Gio.PollableOutputStream.PollableOutputStreamWritevNonblockingMethodInfo
ResolveMemoryOutputStreamMethod "getData" o = MemoryOutputStreamGetDataMethodInfo
ResolveMemoryOutputStreamMethod "getDataSize" o = MemoryOutputStreamGetDataSizeMethodInfo
ResolveMemoryOutputStreamMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveMemoryOutputStreamMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveMemoryOutputStreamMethod "getSize" o = MemoryOutputStreamGetSizeMethodInfo
ResolveMemoryOutputStreamMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveMemoryOutputStreamMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveMemoryOutputStreamMethod "setPending" o = Gio.OutputStream.OutputStreamSetPendingMethodInfo
ResolveMemoryOutputStreamMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveMemoryOutputStreamMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveMemoryOutputStreamMethod t MemoryOutputStream, O.MethodInfo info MemoryOutputStream p) => OL.IsLabel t (MemoryOutputStream -> 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
getMemoryOutputStreamData :: (MonadIO m, IsMemoryOutputStream o) => o -> m (Ptr ())
getMemoryOutputStreamData obj = liftIO $ B.Properties.getObjectPropertyPtr obj "data"
constructMemoryOutputStreamData :: (IsMemoryOutputStream o) => Ptr () -> IO (GValueConstruct o)
constructMemoryOutputStreamData val = B.Properties.constructObjectPropertyPtr "data" val
#if ENABLE_OVERLOADING
data MemoryOutputStreamDataPropertyInfo
instance AttrInfo MemoryOutputStreamDataPropertyInfo where
type AttrAllowedOps MemoryOutputStreamDataPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint MemoryOutputStreamDataPropertyInfo = (~) (Ptr ())
type AttrBaseTypeConstraint MemoryOutputStreamDataPropertyInfo = IsMemoryOutputStream
type AttrGetType MemoryOutputStreamDataPropertyInfo = (Ptr ())
type AttrLabel MemoryOutputStreamDataPropertyInfo = "data"
type AttrOrigin MemoryOutputStreamDataPropertyInfo = MemoryOutputStream
attrGet _ = getMemoryOutputStreamData
attrSet _ = undefined
attrConstruct _ = constructMemoryOutputStreamData
attrClear _ = undefined
#endif
getMemoryOutputStreamDataSize :: (MonadIO m, IsMemoryOutputStream o) => o -> m CULong
getMemoryOutputStreamDataSize obj = liftIO $ B.Properties.getObjectPropertyULong obj "data-size"
#if ENABLE_OVERLOADING
data MemoryOutputStreamDataSizePropertyInfo
instance AttrInfo MemoryOutputStreamDataSizePropertyInfo where
type AttrAllowedOps MemoryOutputStreamDataSizePropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint MemoryOutputStreamDataSizePropertyInfo = (~) ()
type AttrBaseTypeConstraint MemoryOutputStreamDataSizePropertyInfo = IsMemoryOutputStream
type AttrGetType MemoryOutputStreamDataSizePropertyInfo = CULong
type AttrLabel MemoryOutputStreamDataSizePropertyInfo = "data-size"
type AttrOrigin MemoryOutputStreamDataSizePropertyInfo = MemoryOutputStream
attrGet _ = getMemoryOutputStreamDataSize
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getMemoryOutputStreamSize :: (MonadIO m, IsMemoryOutputStream o) => o -> m CULong
getMemoryOutputStreamSize obj = liftIO $ B.Properties.getObjectPropertyULong obj "size"
constructMemoryOutputStreamSize :: (IsMemoryOutputStream o) => CULong -> IO (GValueConstruct o)
constructMemoryOutputStreamSize val = B.Properties.constructObjectPropertyULong "size" val
#if ENABLE_OVERLOADING
data MemoryOutputStreamSizePropertyInfo
instance AttrInfo MemoryOutputStreamSizePropertyInfo where
type AttrAllowedOps MemoryOutputStreamSizePropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint MemoryOutputStreamSizePropertyInfo = (~) CULong
type AttrBaseTypeConstraint MemoryOutputStreamSizePropertyInfo = IsMemoryOutputStream
type AttrGetType MemoryOutputStreamSizePropertyInfo = CULong
type AttrLabel MemoryOutputStreamSizePropertyInfo = "size"
type AttrOrigin MemoryOutputStreamSizePropertyInfo = MemoryOutputStream
attrGet _ = getMemoryOutputStreamSize
attrSet _ = undefined
attrConstruct _ = constructMemoryOutputStreamSize
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList MemoryOutputStream
type instance O.AttributeList MemoryOutputStream = MemoryOutputStreamAttributeList
type MemoryOutputStreamAttributeList = ('[ '("data", MemoryOutputStreamDataPropertyInfo), '("dataSize", MemoryOutputStreamDataSizePropertyInfo), '("size", MemoryOutputStreamSizePropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
memoryOutputStreamData :: AttrLabelProxy "data"
memoryOutputStreamData = AttrLabelProxy
memoryOutputStreamDataSize :: AttrLabelProxy "dataSize"
memoryOutputStreamDataSize = AttrLabelProxy
memoryOutputStreamSize :: AttrLabelProxy "size"
memoryOutputStreamSize = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList MemoryOutputStream = MemoryOutputStreamSignalList
type MemoryOutputStreamSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_memory_output_stream_new_resizable" g_memory_output_stream_new_resizable ::
IO (Ptr MemoryOutputStream)
memoryOutputStreamNewResizable ::
(B.CallStack.HasCallStack, MonadIO m) =>
m MemoryOutputStream
memoryOutputStreamNewResizable = liftIO $ do
result <- g_memory_output_stream_new_resizable
checkUnexpectedReturnNULL "memoryOutputStreamNewResizable" result
result' <- (wrapObject MemoryOutputStream) result
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "g_memory_output_stream_get_data" g_memory_output_stream_get_data ::
Ptr MemoryOutputStream ->
IO (Ptr ())
memoryOutputStreamGetData ::
(B.CallStack.HasCallStack, MonadIO m, IsMemoryOutputStream a) =>
a
-> m (Ptr ())
memoryOutputStreamGetData ostream = liftIO $ do
ostream' <- unsafeManagedPtrCastPtr ostream
result <- g_memory_output_stream_get_data ostream'
touchManagedPtr ostream
return result
#if ENABLE_OVERLOADING
data MemoryOutputStreamGetDataMethodInfo
instance (signature ~ (m (Ptr ())), MonadIO m, IsMemoryOutputStream a) => O.MethodInfo MemoryOutputStreamGetDataMethodInfo a signature where
overloadedMethod _ = memoryOutputStreamGetData
#endif
foreign import ccall "g_memory_output_stream_get_data_size" g_memory_output_stream_get_data_size ::
Ptr MemoryOutputStream ->
IO Word64
memoryOutputStreamGetDataSize ::
(B.CallStack.HasCallStack, MonadIO m, IsMemoryOutputStream a) =>
a
-> m Word64
memoryOutputStreamGetDataSize ostream = liftIO $ do
ostream' <- unsafeManagedPtrCastPtr ostream
result <- g_memory_output_stream_get_data_size ostream'
touchManagedPtr ostream
return result
#if ENABLE_OVERLOADING
data MemoryOutputStreamGetDataSizeMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsMemoryOutputStream a) => O.MethodInfo MemoryOutputStreamGetDataSizeMethodInfo a signature where
overloadedMethod _ = memoryOutputStreamGetDataSize
#endif
foreign import ccall "g_memory_output_stream_get_size" g_memory_output_stream_get_size ::
Ptr MemoryOutputStream ->
IO Word64
memoryOutputStreamGetSize ::
(B.CallStack.HasCallStack, MonadIO m, IsMemoryOutputStream a) =>
a
-> m Word64
memoryOutputStreamGetSize ostream = liftIO $ do
ostream' <- unsafeManagedPtrCastPtr ostream
result <- g_memory_output_stream_get_size ostream'
touchManagedPtr ostream
return result
#if ENABLE_OVERLOADING
data MemoryOutputStreamGetSizeMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsMemoryOutputStream a) => O.MethodInfo MemoryOutputStreamGetSizeMethodInfo a signature where
overloadedMethod _ = memoryOutputStreamGetSize
#endif
foreign import ccall "g_memory_output_stream_steal_as_bytes" g_memory_output_stream_steal_as_bytes ::
Ptr MemoryOutputStream ->
IO (Ptr GLib.Bytes.Bytes)
memoryOutputStreamStealAsBytes ::
(B.CallStack.HasCallStack, MonadIO m, IsMemoryOutputStream a) =>
a
-> m GLib.Bytes.Bytes
memoryOutputStreamStealAsBytes ostream = liftIO $ do
ostream' <- unsafeManagedPtrCastPtr ostream
result <- g_memory_output_stream_steal_as_bytes ostream'
checkUnexpectedReturnNULL "memoryOutputStreamStealAsBytes" result
result' <- (wrapBoxed GLib.Bytes.Bytes) result
touchManagedPtr ostream
return result'
#if ENABLE_OVERLOADING
data MemoryOutputStreamStealAsBytesMethodInfo
instance (signature ~ (m GLib.Bytes.Bytes), MonadIO m, IsMemoryOutputStream a) => O.MethodInfo MemoryOutputStreamStealAsBytesMethodInfo a signature where
overloadedMethod _ = memoryOutputStreamStealAsBytes
#endif
foreign import ccall "g_memory_output_stream_steal_data" g_memory_output_stream_steal_data ::
Ptr MemoryOutputStream ->
IO (Ptr ())
memoryOutputStreamStealData ::
(B.CallStack.HasCallStack, MonadIO m, IsMemoryOutputStream a) =>
a
-> m (Ptr ())
memoryOutputStreamStealData ostream = liftIO $ do
ostream' <- unsafeManagedPtrCastPtr ostream
result <- g_memory_output_stream_steal_data ostream'
touchManagedPtr ostream
return result
#if ENABLE_OVERLOADING
data MemoryOutputStreamStealDataMethodInfo
instance (signature ~ (m (Ptr ())), MonadIO m, IsMemoryOutputStream a) => O.MethodInfo MemoryOutputStreamStealDataMethodInfo a signature where
overloadedMethod _ = memoryOutputStreamStealData
#endif