halfs-0.2: Haskell File SystemSource codeContentsIndex
Halfs.Buffer
PortabilityGHC
Stabilityalpha
MaintainerIsaac Jones <ijones@galois.com>
Description

Explanation: The Buffer represents the filesystem's IO buffer. BinHandle for the FS. All of the conversion to-and-from strings and cstrings assume that each byte interpreted is a Char. The conversion functions which don't take a length assume that the entire buffer is a string. Use get if you have a string whose length is stored at the beginning. There are functions for taking a certain number of characters and interpreting them as strings, however.

FIX: Clean up types.

Synopsis
data Buffer
strToBuff :: String -> Buffer -> IO ()
strToNewBuff :: String -> IO Buffer
buffToStrSize :: Int -> Buffer -> IO String
buffToStr :: Buffer -> IO String
withBuffSize :: Int -> (Buffer -> IO a) -> IO a
buffToCBuff :: Buffer -> Ptr Word8 -> CSize -> IO ()
cBuffToBuff :: Buffer -> Ptr Word8 -> CSize -> IO ()
plusBuff :: Buffer -> Int -> IO ()
buffSeek :: Buffer -> Int -> IO ()
buffGetHandle :: Buffer -> BinHandle
newBuff :: Int -> IO Buffer
buffSize :: Buffer -> IO Int
Documentation
data Buffer Source
strToBuff :: String -> Buffer -> IO ()Source
Convert this string into a file buffer. Starts at the beginning of the buffer.
strToNewBuff :: String -> IO BufferSource
Allocate a new buffer to fit this entire string.
buffToStrSize :: Int -> Buffer -> IO StringSource
Extract sz characters from this buffer and interpret them as a string. Starts at beginning of buffer.
buffToStr :: Buffer -> IO StringSource
Evaluate this entire buffer as a string, starting from the beginning.
withBuffSize :: Int -> (Buffer -> IO a) -> IO aSource
Allocate a new buffer of the given size and perform the given function on that buffer. FIX: Free the buffer when done?
buffToCBuff :: Buffer -> Ptr Word8 -> CSize -> IO ()Source
Convert this Halfs Buffer to a C Buffer, starting at the current pointer. The buffer's pointer will be returned to its location.
cBuffToBuff :: Buffer -> Ptr Word8 -> CSize -> IO ()Source
Convert this C buffer to a Halfs Buffer, starting at the current pointer. The buffer's pointer will be returned to its location.
plusBuff :: Buffer -> Int -> IO ()Source
Move the buffer's pointer forward.
buffSeek :: Buffer -> Int -> IO ()Source
Seek forward or backward on this buffer.
buffGetHandle :: Buffer -> BinHandleSource
Get the BinHandle out of this buffer.
newBuff :: Int -> IO BufferSource
buffSize :: Buffer -> IO IntSource
Produced by Haddock version 2.4.2