bytedump-1.0: Flexible byte dump helpers for human readers.

License | BSD-style
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | experimental
Portability | unknown
Safe Haskell | Safe-Inferred
Language | Haskell98

Text.Bytedump

Contents

- Formatted string configuration
- Dump bytes into not formatted strings
- Dump bytes into formatted strings using a specific config
- Dump bytes into formatted strings using default config
- Dump 2 set of bytes into formatted side-by-side strings using default config

Description

A module containing some routines to debug data dump

Synopsis

- hexString :: Word8 -> String
- data BytedumpConfig = BytedumpConfig {
  - configRowSize :: Int
  - configRowGroupSize :: Int
  - configRowGroupSep :: String
  - configRowLeft :: String
  - configRowRight :: String
  - configCellSep :: String
  - configPrintChar :: Bool
  }
- defaultConfig :: BytedumpConfig
- dumpRaw :: [Word8] -> String
- dumpRawS :: String -> String
- dumpRawBS :: ByteString -> String
- dumpRawLBS :: ByteString -> String
- dumpWith :: BytedumpConfig -> [Word8] -> String
- dumpWithS :: BytedumpConfig -> String -> String
- dumpWithBS :: BytedumpConfig -> ByteString -> String
- dumpWithLBS :: BytedumpConfig -> ByteString -> String
- dump :: [Word8] -> String
- dumpS :: String -> String
- dumpBS :: ByteString -> String
- dumpLBS :: ByteString -> String
- dumpDiff :: [Word8] -> [Word8] -> String
- dumpDiffS :: String -> String -> String
- dumpDiffBS :: ByteString -> ByteString -> String
- dumpDiffLBS :: ByteString -> ByteString -> String

# Documentation

hexString :: Word8 -> String Source #

Dump one byte into a 2 hexadecimal characters.

# Formatted string configuration

data BytedumpConfig Source #

Configuration structure used for formatting functions

Constructors

BytedumpConfig |

Fields

- configRowSize :: Int

  number of bytes per row.

- configRowGroupSize :: Int

  number of bytes per group per row.

- configRowGroupSep :: String

  string separating groups.

- configRowLeft :: String

  string on the left of the row.

- configRowRight :: String

  string on the right of the row.

- configCellSep :: String

  string separating cells in row.

- configPrintChar :: Bool

  if the printable ascii table is displayed.

#### Instances

Instances details

Show BytedumpConfig Source # |
Instance details Defined in Text.Bytedump Methods showsPrec :: Int -> BytedumpConfig -> ShowS Source # show :: BytedumpConfig -> String Source # showList :: [BytedumpConfig] -> ShowS Source #
Eq BytedumpConfig Source # |
Instance details Defined in Text.Bytedump Methods (==) :: BytedumpConfig -> BytedumpConfig -> Bool Source # (/=) :: BytedumpConfig -> BytedumpConfig -> Bool Source #

defaultConfig :: BytedumpConfig Source #

Default Config using 16 bytes by row with a separation at the 8th byte, and dumping printable ascii character on the right.

# Dump bytes into not formatted strings

dumpRaw :: [Word8] -> String Source #

Dump a list of word8 into a raw string of hex value

dumpRawS :: String -> String Source #

Dump a string into a raw string of hex value

dumpRawBS :: ByteString -> String Source #

Dump a bytestring into a raw string of hex value

dumpRawLBS :: ByteString -> String Source #

Dump a lazy bytestring into a raw string of hex value

# Dump bytes into formatted strings using a specific config

dumpWith :: BytedumpConfig -> [Word8] -> String Source #

Dump a list of bytes into formatted strings using a specific config

dumpWithS :: BytedumpConfig -> String -> String Source #

Dump a string into formatted strings using a specific config

dumpWithBS :: BytedumpConfig -> ByteString -> String Source #

Dump a bytestring into formatted strings using a specific config

dumpWithLBS :: BytedumpConfig -> ByteString -> String Source #

Dump a lazy bytestring into formatted strings using a specific config

# Dump bytes into formatted strings using default config

dump :: [Word8] -> String Source #

Dump a list of word8 into a formatted string of hex value

dumpS :: String -> String Source #

Dump a string into a formatted string of hex value

dumpBS :: ByteString -> String Source #

Dump a bytestring into a formatted string of hex value

dumpLBS :: ByteString -> String Source #

Dump a lazy bytestring into a formatted string of hex value

# Dump 2 set of bytes into formatted side-by-side strings using default config

dumpDiff :: [Word8] -> [Word8] -> String Source #

Dump two list of word8 into a formatted string of hex value side by side

dumpDiffS :: String -> String -> String Source #

Dump a string into a formatted string of hex value

dumpDiffBS :: ByteString -> ByteString -> String Source #

Dump a bytestring into a formatted string of hex value

dumpDiffLBS :: ByteString -> ByteString -> String Source #

Dump a lazy bytestring into a formatted string of hex value