public ParseOPT(char?quote = null, char delimiter = ',', bool force = false, string root = null) { this.force = force; this.quote = quote; this.delimiter = delimiter; this.currentDocument = new OPTDocument(); this.root = root; }
protected override void EndProcessing() { base.EndProcessing(); OPTDocument output = parser.ReadEnd(); if (output != null) { WriteObject(output); } }
protected override void ProcessRecord() { base.ProcessRecord(); OPTDocument output = parser.ReadLine(inputString); if (output != null) { WriteObject(output); } }
public OPTDocument ReadLine(string line) { OPTPage page = parseLine(line); OPTDocument output = null; if (page.First && this.currentDocument.PageCount != 0) { output = this.currentDocument; this.currentDocument = new OPTDocument(); this.currentDocument.AddPage(page); } else { this.currentDocument.AddPage(page); } return(output); }
protected override void ProcessRecord() { base.ProcessRecord(); string line; while ((line = reader.ReadLine()) != null) { try { OPTDocument output = parser.ReadLine(line); if (output != null) { WriteObject(output); } } catch (InvalidDataException err) { WriteWarning(err.ToString()); } } }