From 7c0a90bd7d012296eefbe2bfb07327752654b37c Mon Sep 17 00:00:00 2001 From: Sigbjorn Finne Date: Sat, 31 Jan 2009 08:27:34 -0800 Subject: haddock additions --- Codec/MIME/QuotedPrintable.hs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'Codec/MIME/QuotedPrintable.hs') diff --git a/Codec/MIME/QuotedPrintable.hs b/Codec/MIME/QuotedPrintable.hs index ec57ba5..92e468a 100644 --- a/Codec/MIME/QuotedPrintable.hs +++ b/Codec/MIME/QuotedPrintable.hs @@ -1,16 +1,16 @@ -------------------------------------------------------------------- -- | -- Module : Codec.MIME.QuotedPrintable --- Copyright : (c) Galois, Inc. 2008 +-- Copyright : (c) 2006-2009, Galois, Inc. -- License : BSD3 -- -- Maintainer: Sigbjorn Finne -- Stability : provisional -- Portability: -- +-- +-- -------------------------------------------------------------------- - - module Codec.MIME.QuotedPrintable ( decode -- :: String -> String , encode -- :: String -> String @@ -19,7 +19,9 @@ module Codec.MIME.QuotedPrintable import Data.Char -- | 'decode' incoming quoted-printable content, stripping --- out soft line breaks and +-- out soft line breaks and translating @=XY@ sequences +-- into their decoded byte\/octet. The output encoding\/representation +-- is still a String, not a sequence of bytes. decode :: String -> String decode "" = "" decode ('=':'\r':'\n':xs) = decode xs -- soft line break. @@ -38,6 +40,10 @@ decode (x1:xs) = x1:decode xs encode :: String -> String encode xs = encodeLength 0 xs +-- | @encodeLength llen str@ is the worker function during encoding. +-- The extra argument @llen@ tracks the current column for the line +-- being processed. Soft line breaks are inserted if a line exceeds +-- a max length. encodeLength :: Int -> String -> String encodeLength _ "" = "" encodeLength n (x:xs) -- cgit v1.2.3