/// <summary> /// Create new .json reader. /// </summary> /// <param name="ext"></param> /// <param name="lineFactory"></param> public JsonLinesReader(string ext, ILineFactory lineFactory) { this.Extension = ext ?? throw new ArgumentNullException(nameof(ext)); this.lineFormat = new LineFormat(" :\\", false, " :\\", false, lineFactory, null) ?? throw new ArgumentNullException(nameof(lineFactory)); this.LineFactory = lineFactory; lineFactory.TryGetResolver(out resolver); }
/// <summary> /// Create new xml reader /// </summary> /// <param name="extension"></param> /// <param name="lineFactory">Line factory that converts parameters into <see cref="ILine"/>s.</param> /// <param name="xmlReaderSettings"></param> public XmlLinesReader(string extension, ILineFactory lineFactory, XmlReaderSettings xmlReaderSettings = default) { this.Extension = extension; this.xmlReaderSettings = xmlReaderSettings ?? CreateXmlReaderSettings(); this.LineFactory = lineFactory ?? throw new ArgumentNullException(nameof(lineFactory)); // Extract resolver from line factory lineFactory.TryGetResolver(out resolver); }
/// <summary> /// Create new ini file reader. /// </summary> /// <param name="ext"></param> /// <param name="lineFactory"></param> public IniLinesReader(string ext, ILineFactory lineFactory) { this.Extension = ext ?? throw new ArgumentNullException(nameof(ext)); this.LineFactory = lineFactory ?? throw new ArgumentNullException(nameof(LineFactory)); this.escaper_section = new LineFormat("\\:[]", true, "\\:[]", true, lineFactory, null); this.escaper_key = new LineFormat("\\:= ", true, "\\:= ", true, lineFactory, null); this.LineFactory = lineFactory; lineFactory.TryGetResolver(out resolver); }