what4-1.0: Solver-agnostic symbolic values support for issuing queries

Copyright(c) Galois Inc 2019-2020
LicenseBSD3
MaintainerRob Dockins <rdockins@galois.com>
Stabilityprovisional
Safe HaskellSafe
LanguageHaskell2010

What4.Utils.Word16String

Description

 
Synopsis

Documentation

data Word16String Source #

A string of Word16 values, encoded as a bytestring in little endian (LE) order.

We maintain the invariant that Word16Strings are represented by an even number of bytes.

fromLEByteString :: ByteString -> Word16String Source #

Generate a Word16String from a bytestring where the 16bit words are encoded as two bytes in little-endian order.

PRECONDITION: the input bytestring must have a length which is a multiple of 2.

toLEByteString :: Word16String -> ByteString Source #

Return the underlying little endian bytestring.

empty :: Word16String Source #

Return the empty string

singleton :: Word16 -> Word16String Source #

Compute the string containing just the given character

null :: Word16String -> Bool Source #

Test if the given string is empty

index :: Word16String -> Int -> Word16 Source #

Retrive the nth character of the string. Out of bounds accesses will cause an error.

foldl' :: (a -> Word16 -> a) -> a -> Word16String -> a Source #

findSubstring :: Word16String -> Word16String -> Maybe Int Source #

Find the first index (if it exists) where the first string appears as a substring in the second

isInfixOf :: Word16String -> Word16String -> Bool Source #

Returns true if the first string appears somewhere in the second string.