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 |
- Exported types
- Methods
- byteWriterEnsureFreeSpace
- byteWriterFill
- byteWriterFree
- byteWriterFreeAndGetBuffer
- byteWriterFreeAndGetData
- byteWriterGetRemaining
- byteWriterInit
- byteWriterInitWithData
- byteWriterInitWithSize
- byteWriterPutBuffer
- byteWriterPutData
- byteWriterPutFloat32Be
- byteWriterPutFloat32Le
- byteWriterPutFloat64Be
- byteWriterPutFloat64Le
- byteWriterPutInt16Be
- byteWriterPutInt16Le
- byteWriterPutInt24Be
- byteWriterPutInt24Le
- byteWriterPutInt32Be
- byteWriterPutInt32Le
- byteWriterPutInt64Be
- byteWriterPutInt64Le
- byteWriterPutInt8
- byteWriterPutStringUtf16
- byteWriterPutStringUtf32
- byteWriterPutStringUtf8
- byteWriterPutUint16Be
- byteWriterPutUint16Le
- byteWriterPutUint24Be
- byteWriterPutUint24Le
- byteWriterPutUint32Be
- byteWriterPutUint32Le
- byteWriterPutUint64Be
- byteWriterPutUint64Le
- byteWriterPutUint8
- byteWriterReset
- byteWriterResetAndGetBuffer
- byteWriterResetAndGetData
- Properties
#GstByteWriter provides a byte writer and reader that can write/read different integer and floating point types to/from a memory buffer. It provides functions for writingreading signedunsigned, little/big endian integers of 8, 16, 24, 32 and 64 bits and functions for reading little/big endian floating points numbers of 32 and 64 bits. It also provides functions to write/read NUL-terminated strings in various character encodings.
- newtype ByteWriter = ByteWriter (ForeignPtr ByteWriter)
- newZeroByteWriter :: MonadIO m => m ByteWriter
- noByteWriter :: Maybe ByteWriter
- data ByteWriterEnsureFreeSpaceMethodInfo
- byteWriterEnsureFreeSpace :: MonadIO m => ByteWriter -> Word32 -> m Bool
- data ByteWriterFillMethodInfo
- byteWriterFill :: MonadIO m => ByteWriter -> Word8 -> Word32 -> m Bool
- data ByteWriterFreeMethodInfo
- byteWriterFree :: MonadIO m => ByteWriter -> m ()
- data ByteWriterFreeAndGetBufferMethodInfo
- byteWriterFreeAndGetBuffer :: MonadIO m => ByteWriter -> m Buffer
- data ByteWriterFreeAndGetDataMethodInfo
- byteWriterFreeAndGetData :: MonadIO m => ByteWriter -> m Word8
- data ByteWriterGetRemainingMethodInfo
- byteWriterGetRemaining :: MonadIO m => ByteWriter -> m Word32
- data ByteWriterInitMethodInfo
- byteWriterInit :: MonadIO m => ByteWriter -> m ()
- data ByteWriterInitWithDataMethodInfo
- byteWriterInitWithData :: MonadIO m => ByteWriter -> ByteString -> Bool -> m ()
- data ByteWriterInitWithSizeMethodInfo
- byteWriterInitWithSize :: MonadIO m => ByteWriter -> Word32 -> Bool -> m ()
- data ByteWriterPutBufferMethodInfo
- byteWriterPutBuffer :: MonadIO m => ByteWriter -> Buffer -> Word64 -> Int64 -> m Bool
- data ByteWriterPutDataMethodInfo
- byteWriterPutData :: MonadIO m => ByteWriter -> ByteString -> m Bool
- data ByteWriterPutFloat32BeMethodInfo
- byteWriterPutFloat32Be :: MonadIO m => ByteWriter -> Float -> m Bool
- data ByteWriterPutFloat32LeMethodInfo
- byteWriterPutFloat32Le :: MonadIO m => ByteWriter -> Float -> m Bool
- data ByteWriterPutFloat64BeMethodInfo
- byteWriterPutFloat64Be :: MonadIO m => ByteWriter -> Double -> m Bool
- data ByteWriterPutFloat64LeMethodInfo
- byteWriterPutFloat64Le :: MonadIO m => ByteWriter -> Double -> m Bool
- data ByteWriterPutInt16BeMethodInfo
- byteWriterPutInt16Be :: MonadIO m => ByteWriter -> Int16 -> m Bool
- data ByteWriterPutInt16LeMethodInfo
- byteWriterPutInt16Le :: MonadIO m => ByteWriter -> Int16 -> m Bool
- data ByteWriterPutInt24BeMethodInfo
- byteWriterPutInt24Be :: MonadIO m => ByteWriter -> Int32 -> m Bool
- data ByteWriterPutInt24LeMethodInfo
- byteWriterPutInt24Le :: MonadIO m => ByteWriter -> Int32 -> m Bool
- data ByteWriterPutInt32BeMethodInfo
- byteWriterPutInt32Be :: MonadIO m => ByteWriter -> Int32 -> m Bool
- data ByteWriterPutInt32LeMethodInfo
- byteWriterPutInt32Le :: MonadIO m => ByteWriter -> Int32 -> m Bool
- data ByteWriterPutInt64BeMethodInfo
- byteWriterPutInt64Be :: MonadIO m => ByteWriter -> Int64 -> m Bool
- data ByteWriterPutInt64LeMethodInfo
- byteWriterPutInt64Le :: MonadIO m => ByteWriter -> Int64 -> m Bool
- data ByteWriterPutInt8MethodInfo
- byteWriterPutInt8 :: MonadIO m => ByteWriter -> Int8 -> m Bool
- data ByteWriterPutStringUtf16MethodInfo
- byteWriterPutStringUtf16 :: MonadIO m => ByteWriter -> [Word16] -> m Bool
- data ByteWriterPutStringUtf32MethodInfo
- byteWriterPutStringUtf32 :: MonadIO m => ByteWriter -> [Word32] -> m Bool
- data ByteWriterPutStringUtf8MethodInfo
- byteWriterPutStringUtf8 :: MonadIO m => ByteWriter -> [Text] -> m Bool
- data ByteWriterPutUint16BeMethodInfo
- byteWriterPutUint16Be :: MonadIO m => ByteWriter -> Word16 -> m Bool
- data ByteWriterPutUint16LeMethodInfo
- byteWriterPutUint16Le :: MonadIO m => ByteWriter -> Word16 -> m Bool
- data ByteWriterPutUint24BeMethodInfo
- byteWriterPutUint24Be :: MonadIO m => ByteWriter -> Word32 -> m Bool
- data ByteWriterPutUint24LeMethodInfo
- byteWriterPutUint24Le :: MonadIO m => ByteWriter -> Word32 -> m Bool
- data ByteWriterPutUint32BeMethodInfo
- byteWriterPutUint32Be :: MonadIO m => ByteWriter -> Word32 -> m Bool
- data ByteWriterPutUint32LeMethodInfo
- byteWriterPutUint32Le :: MonadIO m => ByteWriter -> Word32 -> m Bool
- data ByteWriterPutUint64BeMethodInfo
- byteWriterPutUint64Be :: MonadIO m => ByteWriter -> Word64 -> m Bool
- data ByteWriterPutUint64LeMethodInfo
- byteWriterPutUint64Le :: MonadIO m => ByteWriter -> Word64 -> m Bool
- data ByteWriterPutUint8MethodInfo
- byteWriterPutUint8 :: MonadIO m => ByteWriter -> Word8 -> m Bool
- data ByteWriterResetMethodInfo
- byteWriterReset :: MonadIO m => ByteWriter -> m ()
- data ByteWriterResetAndGetBufferMethodInfo
- byteWriterResetAndGetBuffer :: MonadIO m => ByteWriter -> m Buffer
- data ByteWriterResetAndGetDataMethodInfo
- byteWriterResetAndGetData :: MonadIO m => ByteWriter -> m (Ptr Word8)
- byteWriterReadAllocSize :: ByteWriter -> IO Word32
- byteWriterReadFixed :: ByteWriter -> IO Bool
- byteWriterReadOwned :: ByteWriter -> IO Bool
- byteWriterReadParent :: ByteWriter -> IO ByteReader
Exported types
newtype ByteWriter Source
newZeroByteWriter :: MonadIO m => m ByteWriter Source
Construct a ByteWriter
struct initialized to zero.
Methods
byteWriterEnsureFreeSpace
data ByteWriterEnsureFreeSpaceMethodInfo Source
((~) (TYPE Lifted) signature (Word32 -> m Bool), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterEnsureFreeSpaceMethodInfo ByteWriter signature Source | |
byteWriterEnsureFreeSpace :: MonadIO m => ByteWriter -> Word32 -> m Bool Source
byteWriterFill
data ByteWriterFillMethodInfo Source
((~) (TYPE Lifted) signature (Word8 -> Word32 -> m Bool), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterFillMethodInfo ByteWriter signature Source | |
byteWriterFill :: MonadIO m => ByteWriter -> Word8 -> Word32 -> m Bool Source
byteWriterFree
data ByteWriterFreeMethodInfo Source
((~) (TYPE Lifted) signature (m ()), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterFreeMethodInfo ByteWriter signature Source | |
byteWriterFree :: MonadIO m => ByteWriter -> m () Source
byteWriterFreeAndGetBuffer
data ByteWriterFreeAndGetBufferMethodInfo Source
((~) (TYPE Lifted) signature (m Buffer), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterFreeAndGetBufferMethodInfo ByteWriter signature Source | |
byteWriterFreeAndGetBuffer :: MonadIO m => ByteWriter -> m Buffer Source
byteWriterFreeAndGetData
data ByteWriterFreeAndGetDataMethodInfo Source
((~) (TYPE Lifted) signature (m Word8), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterFreeAndGetDataMethodInfo ByteWriter signature Source | |
byteWriterFreeAndGetData :: MonadIO m => ByteWriter -> m Word8 Source
byteWriterGetRemaining
data ByteWriterGetRemainingMethodInfo Source
((~) (TYPE Lifted) signature (m Word32), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterGetRemainingMethodInfo ByteWriter signature Source | |
byteWriterGetRemaining :: MonadIO m => ByteWriter -> m Word32 Source
byteWriterInit
data ByteWriterInitMethodInfo Source
((~) (TYPE Lifted) signature (m ()), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterInitMethodInfo ByteWriter signature Source | |
byteWriterInit :: MonadIO m => ByteWriter -> m () Source
byteWriterInitWithData
data ByteWriterInitWithDataMethodInfo Source
((~) (TYPE Lifted) signature (ByteString -> Bool -> m ()), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterInitWithDataMethodInfo ByteWriter signature Source | |
byteWriterInitWithData :: MonadIO m => ByteWriter -> ByteString -> Bool -> m () Source
byteWriterInitWithSize
data ByteWriterInitWithSizeMethodInfo Source
((~) (TYPE Lifted) signature (Word32 -> Bool -> m ()), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterInitWithSizeMethodInfo ByteWriter signature Source | |
byteWriterInitWithSize :: MonadIO m => ByteWriter -> Word32 -> Bool -> m () Source
byteWriterPutBuffer
data ByteWriterPutBufferMethodInfo Source
((~) (TYPE Lifted) signature (Buffer -> Word64 -> Int64 -> m Bool), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterPutBufferMethodInfo ByteWriter signature Source | |
byteWriterPutBuffer :: MonadIO m => ByteWriter -> Buffer -> Word64 -> Int64 -> m Bool Source
byteWriterPutData
data ByteWriterPutDataMethodInfo Source
((~) (TYPE Lifted) signature (ByteString -> m Bool), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterPutDataMethodInfo ByteWriter signature Source | |
byteWriterPutData :: MonadIO m => ByteWriter -> ByteString -> m Bool Source
byteWriterPutFloat32Be
data ByteWriterPutFloat32BeMethodInfo Source
((~) (TYPE Lifted) signature (Float -> m Bool), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterPutFloat32BeMethodInfo ByteWriter signature Source | |
byteWriterPutFloat32Be :: MonadIO m => ByteWriter -> Float -> m Bool Source
byteWriterPutFloat32Le
data ByteWriterPutFloat32LeMethodInfo Source
((~) (TYPE Lifted) signature (Float -> m Bool), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterPutFloat32LeMethodInfo ByteWriter signature Source | |
byteWriterPutFloat32Le :: MonadIO m => ByteWriter -> Float -> m Bool Source
byteWriterPutFloat64Be
data ByteWriterPutFloat64BeMethodInfo Source
((~) (TYPE Lifted) signature (Double -> m Bool), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterPutFloat64BeMethodInfo ByteWriter signature Source | |
byteWriterPutFloat64Be :: MonadIO m => ByteWriter -> Double -> m Bool Source
byteWriterPutFloat64Le
data ByteWriterPutFloat64LeMethodInfo Source
((~) (TYPE Lifted) signature (Double -> m Bool), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterPutFloat64LeMethodInfo ByteWriter signature Source | |
byteWriterPutFloat64Le :: MonadIO m => ByteWriter -> Double -> m Bool Source
byteWriterPutInt16Be
data ByteWriterPutInt16BeMethodInfo Source
((~) (TYPE Lifted) signature (Int16 -> m Bool), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterPutInt16BeMethodInfo ByteWriter signature Source | |
byteWriterPutInt16Be :: MonadIO m => ByteWriter -> Int16 -> m Bool Source
byteWriterPutInt16Le
data ByteWriterPutInt16LeMethodInfo Source
((~) (TYPE Lifted) signature (Int16 -> m Bool), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterPutInt16LeMethodInfo ByteWriter signature Source | |
byteWriterPutInt16Le :: MonadIO m => ByteWriter -> Int16 -> m Bool Source
byteWriterPutInt24Be
data ByteWriterPutInt24BeMethodInfo Source
((~) (TYPE Lifted) signature (Int32 -> m Bool), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterPutInt24BeMethodInfo ByteWriter signature Source | |
byteWriterPutInt24Be :: MonadIO m => ByteWriter -> Int32 -> m Bool Source
byteWriterPutInt24Le
data ByteWriterPutInt24LeMethodInfo Source
((~) (TYPE Lifted) signature (Int32 -> m Bool), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterPutInt24LeMethodInfo ByteWriter signature Source | |
byteWriterPutInt24Le :: MonadIO m => ByteWriter -> Int32 -> m Bool Source
byteWriterPutInt32Be
data ByteWriterPutInt32BeMethodInfo Source
((~) (TYPE Lifted) signature (Int32 -> m Bool), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterPutInt32BeMethodInfo ByteWriter signature Source | |
byteWriterPutInt32Be :: MonadIO m => ByteWriter -> Int32 -> m Bool Source
byteWriterPutInt32Le
data ByteWriterPutInt32LeMethodInfo Source
((~) (TYPE Lifted) signature (Int32 -> m Bool), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterPutInt32LeMethodInfo ByteWriter signature Source | |
byteWriterPutInt32Le :: MonadIO m => ByteWriter -> Int32 -> m Bool Source
byteWriterPutInt64Be
data ByteWriterPutInt64BeMethodInfo Source
((~) (TYPE Lifted) signature (Int64 -> m Bool), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterPutInt64BeMethodInfo ByteWriter signature Source | |
byteWriterPutInt64Be :: MonadIO m => ByteWriter -> Int64 -> m Bool Source
byteWriterPutInt64Le
data ByteWriterPutInt64LeMethodInfo Source
((~) (TYPE Lifted) signature (Int64 -> m Bool), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterPutInt64LeMethodInfo ByteWriter signature Source | |
byteWriterPutInt64Le :: MonadIO m => ByteWriter -> Int64 -> m Bool Source
byteWriterPutInt8
data ByteWriterPutInt8MethodInfo Source
((~) (TYPE Lifted) signature (Int8 -> m Bool), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterPutInt8MethodInfo ByteWriter signature Source | |
byteWriterPutInt8 :: MonadIO m => ByteWriter -> Int8 -> m Bool Source
byteWriterPutStringUtf16
data ByteWriterPutStringUtf16MethodInfo Source
((~) (TYPE Lifted) signature ([Word16] -> m Bool), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterPutStringUtf16MethodInfo ByteWriter signature Source | |
byteWriterPutStringUtf16 :: MonadIO m => ByteWriter -> [Word16] -> m Bool Source
byteWriterPutStringUtf32
data ByteWriterPutStringUtf32MethodInfo Source
((~) (TYPE Lifted) signature ([Word32] -> m Bool), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterPutStringUtf32MethodInfo ByteWriter signature Source | |
byteWriterPutStringUtf32 :: MonadIO m => ByteWriter -> [Word32] -> m Bool Source
byteWriterPutStringUtf8
data ByteWriterPutStringUtf8MethodInfo Source
((~) (TYPE Lifted) signature ([Text] -> m Bool), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterPutStringUtf8MethodInfo ByteWriter signature Source | |
byteWriterPutStringUtf8 :: MonadIO m => ByteWriter -> [Text] -> m Bool Source
byteWriterPutUint16Be
data ByteWriterPutUint16BeMethodInfo Source
((~) (TYPE Lifted) signature (Word16 -> m Bool), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterPutUint16BeMethodInfo ByteWriter signature Source | |
byteWriterPutUint16Be :: MonadIO m => ByteWriter -> Word16 -> m Bool Source
byteWriterPutUint16Le
data ByteWriterPutUint16LeMethodInfo Source
((~) (TYPE Lifted) signature (Word16 -> m Bool), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterPutUint16LeMethodInfo ByteWriter signature Source | |
byteWriterPutUint16Le :: MonadIO m => ByteWriter -> Word16 -> m Bool Source
byteWriterPutUint24Be
data ByteWriterPutUint24BeMethodInfo Source
((~) (TYPE Lifted) signature (Word32 -> m Bool), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterPutUint24BeMethodInfo ByteWriter signature Source | |
byteWriterPutUint24Be :: MonadIO m => ByteWriter -> Word32 -> m Bool Source
byteWriterPutUint24Le
data ByteWriterPutUint24LeMethodInfo Source
((~) (TYPE Lifted) signature (Word32 -> m Bool), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterPutUint24LeMethodInfo ByteWriter signature Source | |
byteWriterPutUint24Le :: MonadIO m => ByteWriter -> Word32 -> m Bool Source
byteWriterPutUint32Be
data ByteWriterPutUint32BeMethodInfo Source
((~) (TYPE Lifted) signature (Word32 -> m Bool), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterPutUint32BeMethodInfo ByteWriter signature Source | |
byteWriterPutUint32Be :: MonadIO m => ByteWriter -> Word32 -> m Bool Source
byteWriterPutUint32Le
data ByteWriterPutUint32LeMethodInfo Source
((~) (TYPE Lifted) signature (Word32 -> m Bool), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterPutUint32LeMethodInfo ByteWriter signature Source | |
byteWriterPutUint32Le :: MonadIO m => ByteWriter -> Word32 -> m Bool Source
byteWriterPutUint64Be
data ByteWriterPutUint64BeMethodInfo Source
((~) (TYPE Lifted) signature (Word64 -> m Bool), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterPutUint64BeMethodInfo ByteWriter signature Source | |
byteWriterPutUint64Be :: MonadIO m => ByteWriter -> Word64 -> m Bool Source
byteWriterPutUint64Le
data ByteWriterPutUint64LeMethodInfo Source
((~) (TYPE Lifted) signature (Word64 -> m Bool), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterPutUint64LeMethodInfo ByteWriter signature Source | |
byteWriterPutUint64Le :: MonadIO m => ByteWriter -> Word64 -> m Bool Source
byteWriterPutUint8
data ByteWriterPutUint8MethodInfo Source
((~) (TYPE Lifted) signature (Word8 -> m Bool), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterPutUint8MethodInfo ByteWriter signature Source | |
byteWriterPutUint8 :: MonadIO m => ByteWriter -> Word8 -> m Bool Source
byteWriterReset
data ByteWriterResetMethodInfo Source
((~) (TYPE Lifted) signature (m ()), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterResetMethodInfo ByteWriter signature Source | |
byteWriterReset :: MonadIO m => ByteWriter -> m () Source
byteWriterResetAndGetBuffer
data ByteWriterResetAndGetBufferMethodInfo Source
((~) (TYPE Lifted) signature (m Buffer), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterResetAndGetBufferMethodInfo ByteWriter signature Source | |
byteWriterResetAndGetBuffer :: MonadIO m => ByteWriter -> m Buffer Source
byteWriterResetAndGetData
data ByteWriterResetAndGetDataMethodInfo Source
((~) (TYPE Lifted) signature (m (Ptr Word8)), MonadIO m) => MethodInfo (TYPE Lifted) ByteWriterResetAndGetDataMethodInfo ByteWriter signature Source | |
byteWriterResetAndGetData :: MonadIO m => ByteWriter -> m (Ptr Word8) Source