Moduleos-string-2.0.7Haskell2010
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.
- 2 types
- 38 values
- Packageos-string-2.0.7
- 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.