| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Vulkan.CStruct.Utils
Synopsis
- pokeFixedLengthByteString :: forall n. KnownNat n => Ptr (FixedArray n Word8) -> ByteString -> IO ()
- pokeFixedLengthNullTerminatedByteString :: forall n. KnownNat n => Ptr (FixedArray n CChar) -> ByteString -> IO ()
- peekByteStringFromSizedVectorPtr :: forall n. KnownNat n => Ptr (FixedArray n Word8) -> IO ByteString
- lowerArrayPtr :: forall a n. Ptr (FixedArray n a) -> Ptr a
- advancePtrBytes :: Ptr a -> Int -> Ptr a
- data FixedArray (n :: Nat) (a :: Type)
Documentation
pokeFixedLengthByteString :: forall n. KnownNat n => Ptr (FixedArray n Word8) -> ByteString -> IO () Source #
Store a ByteString in a fixed amount of space, truncating if necessary.
If the ByteString is not long enough to fill the space the remaining
bytes are unchanged
pokeFixedLengthNullTerminatedByteString :: forall n. KnownNat n => Ptr (FixedArray n CChar) -> ByteString -> IO () Source #
Store a ByteString in a fixed amount of space inserting a null
character at the end and truncating if necessary.
If the ByteString is not long enough to fill the space the remaining
bytes are unchanged
Note that if the ByteString is exactly long enough the last byte will
still be replaced with 0
peekByteStringFromSizedVectorPtr :: forall n. KnownNat n => Ptr (FixedArray n Word8) -> IO ByteString Source #
Peek a ByteString from a fixed sized array of bytes
lowerArrayPtr :: forall a n. Ptr (FixedArray n a) -> Ptr a Source #
Get the pointer to the first element in the array