module Text.LDIF.Types (
LDIF(..),
ContentRecord(..),
ChangeRecord(..),
Change(..),
Modify(..),
DN(..),
Attribute, Value, AttrValue
)
where
import Data.Char
type Attribute = String
type Value = String
type AttrValue = (Attribute, Value)
data LDIF = LDIFContent { lcVersion :: Maybe String, lcEntries :: [ContentRecord] }
| LDIFChanges { lcVersion :: Maybe String, lcChanges :: [ChangeRecord] } deriving (Show, Eq)
data ContentRecord =ContentRecord { coDN :: DN, coAttrVals :: [AttrValue] } deriving (Show, Eq)
data ChangeRecord = ChangeRecord { chDN :: DN, chOp :: Change } deriving (Show, Eq)
data Change = ChangeAdd { chAttrVals :: [AttrValue] }
| ChangeDelete
| ChangeModify { chMods :: [Modify] }
| ChangeModDN deriving (Show, Eq)
data Modify = ModAdd { modAttr :: Attribute, modAttrVals :: [Value] }
| ModDelete { modAttr :: Attribute, modAttrVals :: [Value] }
| ModReplace { modAttr :: Attribute, modAttrVals :: [Value] } deriving (Show, Eq)
data DN = DN { dnAttrVals :: [AttrValue] } deriving (Show, Eq)