Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
        protected override void EndProcessing()
        {
            base.EndProcessing();
            OPTDocument output = parser.ReadEnd();

            if (output != null)
            {
                WriteObject(output);
            }
        }
Ejemplo n.º 3
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            OPTDocument output = parser.ReadLine(inputString);

            if (output != null)
            {
                WriteObject(output);
            }
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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());
                }
            }
        }