shortbytestring-0.1.0.0: Additional ShortByteString API
Safe HaskellNone
LanguageHaskell2010

Data.ByteString.Short.Internal

Synopsis

Documentation

create :: Int -> (forall s. MBA s -> ST s ()) -> ShortByteString Source #

data BA Source #

Constructors

BA# ByteArray# 

data MBA s Source #

Constructors

MBA# (MutableByteArray# s) 

copyByteArray :: BA -> Int -> MBA s -> Int -> Int -> ST s () Source #

useAsCString :: ShortByteString -> (CString -> IO a) -> IO a #

O(n) construction. Use a ShortByteString with a function requiring a null-terminated CString. The CString is a copy and will be freed automatically; it must not be stored or used after the subcomputation finishes.

Since: bytestring-0.10.10.0

useAsCStringLen :: ShortByteString -> (CStringLen -> IO a) -> IO a #

O(n) construction. Use a ShortByteString with a function requiring a CStringLen. As for useAsCString this function makes a copy of the original ShortByteString. It must not be stored or used after the subcomputation finishes.

Since: bytestring-0.10.10.0

useAsCWString :: ShortByteString -> (CWString -> IO a) -> IO a Source #

O(n) construction. Use a ShortByteString with a function requiring a null-terminated CWString. The CWString is a copy and will be freed automatically; it must not be stored or used after the subcomputation finishes.

Since: 0.10.10.0

useAsCWStringLen :: ShortByteString -> (CWStringLen -> IO a) -> IO a Source #

O(n) construction. Use a ShortByteString with a function requiring a CWStringLen. As for useAsCWString this function makes a copy of the original ShortByteString. It must not be stored or used after the subcomputation finishes.

Since: 0.10.10.0

packCString :: CString -> IO ShortByteString #

O(n). Construct a new ShortByteString from a CString. The resulting ShortByteString is an immutable copy of the original CString, and is managed on the Haskell heap. The original CString must be null terminated.

Since: bytestring-0.10.10.0

packCStringLen :: CStringLen -> IO ShortByteString #

O(n). Construct a new ShortByteString from a CStringLen. The resulting ShortByteString is an immutable copy of the original CStringLen. The ShortByteString is a normal Haskell value and will be managed on the Haskell heap.

Since: bytestring-0.10.10.0

packCWString :: CWString -> IO ShortByteString Source #

O(n). Construct a new ShortByteString from a CWString. The resulting ShortByteString is an immutable copy of the original CWString, and is managed on the Haskell heap. The original CWString must be null terminated.

Since: 0.10.10.0

packCWStringLen :: CWStringLen -> IO ShortByteString Source #

O(n). Construct a new ShortByteString from a CWStringLen. The resulting ShortByteString is an immutable copy of the original CWStringLen. The ShortByteString is a normal Haskell value and will be managed on the Haskell heap.

Since: 0.10.10.0

newCWString :: ShortByteString -> IO CWString Source #

O(n) construction. Use a ShortByteString with a function requiring a CWStringLen. As for useAsCWString this function makes a copy of the original ShortByteString. It must not be stored or used after the subcomputation finishes.

Since: 0.10.10.0