| Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
| Safe Haskell | None |
| Language | Haskell2010 |
GI.GLib.Structs.ByteArray
Description
Contains the public fields of a GByteArray.
- newtype ByteArray = ByteArray (ManagedPtr ByteArray)
- newZeroByteArray :: MonadIO m => m ByteArray
- noByteArray :: Maybe ByteArray
- byteArrayFree :: (HasCallStack, MonadIO m) => ByteString -> Bool -> m Word8
- byteArrayFreeToBytes :: (HasCallStack, MonadIO m) => ByteString -> m Bytes
- byteArrayNew :: (HasCallStack, MonadIO m) => m ByteString
- byteArrayNewTake :: (HasCallStack, MonadIO m) => ByteString -> m ByteString
- byteArrayUnref :: (HasCallStack, MonadIO m) => ByteString -> m ()
- byteArray_data :: AttrLabelProxy "data"
- getByteArrayData :: MonadIO m => ByteArray -> m Word8
- setByteArrayData :: MonadIO m => ByteArray -> Word8 -> m ()
- byteArray_len :: AttrLabelProxy "len"
- getByteArrayLen :: MonadIO m => ByteArray -> m Word32
- setByteArrayLen :: MonadIO m => ByteArray -> Word32 -> m ()
Exported types
Constructors
| ByteArray (ManagedPtr ByteArray) |
Instances
| BoxedObject ByteArray Source # | |
| (~) AttrOpTag tag AttrSet => Constructible ByteArray tag Source # | |
| ((~) * info (ResolveByteArrayMethod t ByteArray), MethodInfo * info ByteArray p) => IsLabel t (ByteArray -> p) Source # | |
| ((~) * info (ResolveByteArrayMethod t ByteArray), MethodInfo * info ByteArray p) => IsLabelProxy t (ByteArray -> p) Source # | |
| HasAttributeList * ByteArray Source # | |
| type AttributeList ByteArray Source # | |
newZeroByteArray :: MonadIO m => m ByteArray Source #
Construct a ByteArray struct initialized to zero.
Methods
free
Arguments
| :: (HasCallStack, MonadIO m) | |
| => ByteString |
|
| -> Bool |
|
| -> m Word8 | Returns: the element data if |
freeToBytes
Arguments
| :: (HasCallStack, MonadIO m) | |
| => ByteString |
|
| -> m Bytes | Returns: a new immutable |
Transfers the data from the ByteArray into a new immutable Bytes.
The ByteArray is freed unless the reference count of array is greater
than one, the ByteArray wrapper is preserved but the size of array
will be set to zero.
This is identical to using bytesNewTake and byteArrayFree
together.
Since: 2.32
new
Arguments
| :: (HasCallStack, MonadIO m) | |
| => m ByteString | Returns: the new |
Creates a new ByteArray with a reference count of 1.
newTake
Arguments
| :: (HasCallStack, MonadIO m) | |
| => ByteString |
|
| -> m ByteString | Returns: a new |
unref
Arguments
| :: (HasCallStack, MonadIO m) | |
| => ByteString |
|
| -> m () |
Atomically decrements the reference count of array by one. If the
reference count drops to 0, all memory allocated by the array is
released. This function is thread-safe and may be called from any
thread.
Since: 2.22
Properties
data
byteArray_data :: AttrLabelProxy "data" Source #
len
byteArray_len :: AttrLabelProxy "len" Source #