Moduleos-string-2.0.11Haskell2010
System.OsString.Data.ByteString.Short.Internal
Internal low-level utilities mostly for System.OsPath.Data.ByteString.Short.Word16,
such as byte-array operations and other stuff not meant to be exported from Word16 module.
Synopsis
- value _nul
- value isSpace
- value word16ToChar
- value create
- value asBA
- data BA
- data MBA
- value newPinnedByteArray
- value newByteArray
- value copyByteArray
- value unsafeFreezeByteArray
- value copyAddrToByteArray
- value packCWString
- value packCWStringLen
- value useAsCWString
- value useAsCWStringLen
- value newCWString
- value moduleErrorIO
- value moduleErrorMsg
- value packWord16
- value packLenWord16
- value unpackWord16
- value packWord16Rev
- value packLenWord16Rev
- value writeWord16Array
- value indexWord8Array
- value indexWord16Array
- value word16ToLE#
- value word16FromLE#
- value setByteArray
- value copyMutableByteArray
- value createAndTrim
- value createAndTrim'
- value createAndTrim''
- value findIndexOrLength
- value findFromEndUntil
- value assertEven
- value errorEmptySBS
- value moduleError
- value compareByteArraysOff
- Packageos-string-2.0.11
- Exports40
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceInternal.hs
Total conversion to char.
Constructors
Constructors
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.
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.
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.
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.
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.
Encode Word16 as little-endian.
Decode Word16 from little-endian.
Given the maximum size needed and a function to make the contents of a ShortByteString, createAndTrim makes the ShortByteString. The generating function is required to return the actual final size (<= the maximum size) and the result value. The resulting byte array is realloced to this size.
Returns the length of the substring matching, not the index. If no match, returns 0.