public IEnumerable <T> Values()
        {
            using (var file = new StreamReader(_path))
            {
                string line;
                while ((line = file.ReadLine()) != null)
                {
                    var value = _rowParser.Parse(line);
                    if (value == null)
                    {
                        continue;
                    }

                    yield return(value);
                }
            }
        }
Exemple #2
0
        public IEnumerable <Row> GetNewLines()
        {
            var previousReadBytes = _bytes;
            var ret = new List <Row>();

            using (var x = new FileStream(_filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
            {
                x.Seek(previousReadBytes, SeekOrigin.Begin);

                using (var y = new StreamReader(x))
                {
                    while (!y.EndOfStream)
                    {
                        var row = _rowParser.Parse(y.ReadLine());
                        row.RowNumber = ++_rowNum;
                        ret.Add(row);
                    }

                    _bytes = x.Length;
                }
            }

            return(ret);
        }
Exemple #3
0
        public string[] ReadNextRow(StreamReader reader)
        {
            string line = reader.ReadLine();

            return(rowParser.Parse(line));
        }