-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Enumerator tools for text-based network protocols -- -- Enumerator tools for text-based network protocols. This includes, -- among other things, an enumeratee to split an incoming ByteString -- stream to a length-limited line stream in a safe manner (i.e. in -- constant space). @package netlines @version 0.3.0 -- | Enumerator tools for working with text-based network protocols. module Data.Enumerator.NetLines -- | Get the next nonempty line from the stream using netLineEmpty. netLine :: Monad m => Int -> Iteratee ByteString m (Maybe ByteString) -- | Get the next line from the stream, length-limited by the given -- Int. This iteratee is error-tolerant by using LF as the line -- terminator and simply ignoring all CR characters. netLineEmpty :: Monad m => Int -> Iteratee ByteString m (Maybe ByteString) -- | Get the next nonempty word from the stream with the given maximum -- length. Based on netWordEmpty. netWord :: Monad m => Int -> Iteratee ByteString m (Maybe ByteString) -- | Get the next word from the stream with the given maximum length. This -- iteratee is error-tolerant by using ASCII whitespace as splitting -- characters. netWordEmpty :: Monad m => Int -> Iteratee ByteString m (Maybe ByteString) -- | Convert a raw byte stream to a stream of lines based on -- netLine. netLines :: Monad m => Int -> Enumeratee ByteString ByteString m b -- | Convert a raw byte stream to a stream of lines based on -- netLineEmpty. netLinesEmpty :: Monad m => Int -> Enumeratee ByteString ByteString m b -- | Split the raw byte stream into words based on netWord. netWords :: Monad m => Int -> Enumeratee ByteString ByteString m b -- | Split the raw byte stream into words based on netWords. netWordsEmpty :: Monad m => Int -> Enumeratee ByteString ByteString m b -- | Get the next token, where tokens are splitted by the first given -- predicate and filtered by the second. Tokens are length-limited by the -- given Int and are truncated safely in constant space. netSplitBy :: Monad m => (Word8 -> Bool) -> (Word8 -> Bool) -> Int -> Iteratee ByteString m (Maybe ByteString) -- | Split the stream using the supplied iteratee. netSplitsBy :: Monad m => Iteratee ByteString m (Maybe ByteString) -> Enumeratee ByteString ByteString m b -- | Enumerate from a handle with the given buffer size (first argument) -- and timeout in milliseconds (second argument). If the timeout is -- exceeded an exception is thrown via throwError. enumHandleTimeout :: MonadIO m => Int -> Int -> Handle -> Enumerator ByteString m b