zenacy-html-2.0.0: A standard compliant HTML parsing library

Safe HaskellNone
LanguageHaskell2010

Zenacy.HTML.Internal.Buffer

Description

Defines an buffer type.

Synopsis

Documentation

data Buffer s Source #

A type of buffer used to hold bytes.

Constructors

Buffer 

Fields

bufferNew :: ST s (STRef s (Buffer s)) Source #

Makes a new buffer.

bufferCapacity :: STRef s (Buffer s) -> ST s (Int, Int) Source #

Gets the capacity of the buffer.

bufferSize :: STRef s (Buffer s) -> ST s Int Source #

Gets the size of the buffer.

bufferReset :: STRef s (Buffer s) -> ST s () Source #

Resets a buffer.

bufferAppend :: Word8 -> STRef s (Buffer s) -> ST s () Source #

Appends a word to a buffer.

bufferApply :: (Word8 -> ST s ()) -> STRef s (Buffer s) -> ST s () Source #

Applies an action to each word in the buffer.

bufferTake :: Int -> STRef s (Buffer s) -> ST s [Word8] Source #

Takes elements from the front of the buffer.

bufferContains :: [Word8] -> STRef s (Buffer s) -> ST s Bool Source #

Determines if a buffer has the specified contents.

bufferPack :: STRef s (Buffer s) -> ST s BS Source #

Packs a buffer into a byte string.

bufferString :: MVector s Word8 -> Int -> ST s BS Source #

Converts a storable vector to a byte string.