Safe HaskellNone

Data.Bini

Contents

Description

Compressed binary configuration files in the (B)INI format.

Parsing example:

 r <- readBiniFromFile "loadouts.ini"
 case r of
  Left s -> print s
  Right bini -> writeFile "loadouts.ini.txt" (show bini)

Outputfile:

 [Loadout]
 nickname = msn_playerloadout
 archetype = ge_fighter
 equip = ge_gf1_engine_01
 equip = shield01_mark01_lf, HpShield01
 equip = ge_fighter_power01
 ...

Synopsis

Reading

readBiniFromFile :: String -> IO (Either String Bini)

Parse a Binifile

Types

data Bini

The abstract representation of the Bini

Constructors

Bini 

Fields

version :: Int
 
sections :: [Section]
 

Instances

Show Bini 

data Section

The abstract representation of a section

Constructors

Section 

Fields

name :: String
 
entries :: [Entry]
 

Instances

Show Section 

data Entry

The abstract representation of an entry

Constructors

Entry 

Fields

varname :: String
 
values :: [BiniVal]
 

Instances

Show Entry 

data BiniVal

The abstract representation of a bini-value

Constructors

BiniInt Int 
BiniFloat Float 
BiniString String 

Instances

Show BiniVal