Safe Haskell | None |
---|---|
Language | Haskell98 |
- type SectionStart = Line -> Bool
- type SectionPast = Line -> Bool
- type AdjustSection = [Line] -> [Line]
- type InsertSection = [Line] -> [Line]
- adjustSection :: Desc -> SectionStart -> SectionPast -> AdjustSection -> InsertSection -> FilePath -> Property NoInfo
- type IniSection = String
- type IniKey = String
- containsIniSetting :: FilePath -> (IniSection, IniKey, String) -> Property NoInfo
- lacksIniSection :: FilePath -> IniSection -> Property NoInfo
Generic conffiles with sections
type SectionStart = Line -> Bool Source
find the line that is the start of the wanted section (eg, == "Foo")
type SectionPast = Line -> Bool Source
find a line that indicates we are past the section (eg, a new section header)
type AdjustSection = [Line] -> [Line] Source
run on all lines in the section, including the SectionStart line; can add, delete, and modify lines, or even delete entire section
type InsertSection = [Line] -> [Line] Source
if SectionStart does not find the section in the file, this is used to insert the section somewhere within it
adjustSection :: Desc -> SectionStart -> SectionPast -> AdjustSection -> InsertSection -> FilePath -> Property NoInfo Source
Adjusts a section of conffile.
Windows .ini files
type IniSection = String Source
Name of a section of an .ini file. This value is put in square braces to generate the section header.
containsIniSetting :: FilePath -> (IniSection, IniKey, String) -> Property NoInfo Source
Ensures that a .ini file exists and contains a section with a key=value setting.
lacksIniSection :: FilePath -> IniSection -> Property NoInfo Source
Ensures that a .ini file does not contain the specified section.