Safe Haskell | None |
---|---|
Language | Haskell2010 |
Extensions to ConfigFile
and utility functions for dealing with
configuration in general and reading/writing files.
Synopsis
- addSectionCP :: MonadError CPError m => CPDocument -> CPSectionSpec -> m CPDocument
- setShowCP :: (Show a, MonadError CPError m) => CPDocument -> CPSectionSpec -> CPOptionSpec -> a -> m CPDocument
- setCP :: MonadError CPError m => CPDocument -> CPSectionSpec -> CPOptionSpec -> String -> m CPDocument
- readCP :: (CPGet a, MonadError CPError m) => CPDocument -> CPSectionSpec -> CPOptionSpec -> m a
- mergeCP :: CPDocument -> CPDocument -> CPDocument
- toStringCP :: CPDocument -> String
- sectionsCP :: CPDocument -> [SectionSpec]
- emptyCP :: ConfigParser
- type CPGet a = Get_C a
- type CPOptionSpec = OptionSpec
- type CPSectionSpec = SectionSpec
- type CPDocument = ConfigParser
- type CPError = (CPErrorData, String)
- readCPDocument :: MonadIO m => SystemPath -> m CPDocument
- data CPReadException = CPReadException FilePath CPError
Documentation
addSectionCP :: MonadError CPError m => CPDocument -> CPSectionSpec -> m CPDocument Source #
An alias for add_section
.
setShowCP :: (Show a, MonadError CPError m) => CPDocument -> CPSectionSpec -> CPOptionSpec -> a -> m CPDocument Source #
An alias for setshow
.
setCP :: MonadError CPError m => CPDocument -> CPSectionSpec -> CPOptionSpec -> String -> m CPDocument Source #
An alias for set
.
readCP :: (CPGet a, MonadError CPError m) => CPDocument -> CPSectionSpec -> CPOptionSpec -> m a Source #
An alias for get
.
mergeCP :: CPDocument -> CPDocument -> CPDocument Source #
An alias for merge
.
toStringCP :: CPDocument -> String Source #
An alias for to_string
sectionsCP :: CPDocument -> [SectionSpec] Source #
An alias for sections
.
emptyCP :: ConfigParser #
The default empty ConfigFile
object.
The content contains only an empty mandatory DEFAULT
section.
optionxform
is set to map toLower
.
usedefault
is set to True
.
accessfunc
is set to simpleAccess
.
type CPOptionSpec = OptionSpec Source #
An alias for OptionSpec
type CPSectionSpec = SectionSpec Source #
An alias for SectionSpec
.
type CPDocument = ConfigParser Source #
An alias for ConfigParser
type CPError = (CPErrorData, String) #
Indicates an error occurred. The String is an explanation of the location of the error.
readCPDocument :: MonadIO m => SystemPath -> m CPDocument Source #
Read a file and try to parse the contents as a CPDocument
, if something
goes wrong throw a CPReadException
data CPReadException Source #
An exception thrown by readCPDocument
.
Instances
Show CPReadException Source # | |
Defined in Data.ConfigFile.B9Extras showsPrec :: Int -> CPReadException -> ShowS # show :: CPReadException -> String # showList :: [CPReadException] -> ShowS # | |
Exception CPReadException Source # | |
Defined in Data.ConfigFile.B9Extras |