haskus-system-0.6.0.0: Haskus system programming framework

Safe HaskellNone
LanguageHaskell2010

Haskus.Format.String

Contents

Description

Various String formats (C string, etc.)

Synopsis

Documentation

data CChar :: * #

Haskell type representing the C char type.

Instances

Bounded CChar 
Enum CChar 
Eq CChar 

Methods

(==) :: CChar -> CChar -> Bool #

(/=) :: CChar -> CChar -> Bool #

Integral CChar 
Num CChar 
Ord CChar 

Methods

compare :: CChar -> CChar -> Ordering #

(<) :: CChar -> CChar -> Bool #

(<=) :: CChar -> CChar -> Bool #

(>) :: CChar -> CChar -> Bool #

(>=) :: CChar -> CChar -> Bool #

max :: CChar -> CChar -> CChar #

min :: CChar -> CChar -> CChar #

Read CChar 
Real CChar 

Methods

toRational :: CChar -> Rational #

Show CChar 

Methods

showsPrec :: Int -> CChar -> ShowS #

show :: CChar -> String #

showList :: [CChar] -> ShowS #

Storable CChar 

Methods

sizeOf :: CChar -> Int #

alignment :: CChar -> Int #

peekElemOff :: Ptr CChar -> Int -> IO CChar #

pokeElemOff :: Ptr CChar -> Int -> CChar -> IO () #

peekByteOff :: Ptr b -> Int -> IO CChar #

pokeByteOff :: Ptr b -> Int -> CChar -> IO () #

peek :: Ptr CChar -> IO CChar #

poke :: Ptr CChar -> CChar -> IO () #

Bits CChar 
FiniteBits CChar 
Storable CChar Source # 

type CString = Ptr CChar #

A C string is a reference to an array of C characters terminated by NUL.

withCString :: MonadInIO m => String -> (Ptr CChar -> m a) -> m a Source #

Use a String a a null-terminated string

withCStringLen :: MonadInIO m => String -> (Ptr CChar -> Word -> m a) -> m a Source #

Use a String a a null-terminated string

castCCharToChar :: CChar -> Char Source #

Convert a CChar into a Char

castCharToCChar :: Char -> CChar Source #

Convert a Char into a CChar

peekCStringLen :: MonadIO m => Word -> Ptr CChar -> m String Source #

Peek a CString whose size is known

peekCString :: MonadIO m => Ptr CChar -> m String Source #

Peek a CString

Fixed-size CString buffer

fromCStringBuffer :: KnownNat n => CStringBuffer (n :: Nat) -> String Source #

Convert a 0-terminal vector into a string

toCStringBuffer :: KnownNat n => String -> CStringBuffer (n :: Nat) Source #

Convert from a String into a 0-terminal vector