/// <summary> /// The default constructor creates a root section (typically a IniFile instance) and a set of parse options /// </summary> /// <param name="rootSection">Root section</param> /// <param name="options">Parse options</param> public IniFileParser( IniFileSection rootSection, IniFileOptions options = IniFileOptions.KeepComments | IniFileOptions.KeepFlat | IniFileOptions.StripEmptyLines) { RootSection = rootSection; Options = options; CurrentSection = rootSection; CreateSectionFromName = CreateFlatSectionFromName; }
public IniFile(Stream stream, IniFileOptions options) { sectionList = new IniFileSectionList(); this.options = options; TextReader ts = new StreamReader(stream); List <string> strings = new List <string>(); string sLine = ts.ReadLine(); while (sLine != null) { strings.Add(sLine); sLine = ts.ReadLine(); } FillSectionList(strings); FillInfos(); }