예제 #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;
 }
예제 #2
0
        protected override void EndProcessing()
        {
            base.EndProcessing();
            OPTDocument output = parser.ReadEnd();

            if (output != null)
            {
                WriteObject(output);
            }
        }
예제 #3
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            OPTDocument output = parser.ReadLine(inputString);

            if (output != null)
            {
                WriteObject(output);
            }
        }
예제 #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);
        }
예제 #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());
                }
            }
        }