Пример #1
0
        /// <summary>
        /// Requests a new enumerator.
        /// </summary>
        /// <returns></returns>
        public System.Collections.Generic.IEnumerator <string[]> GetEnumerator()
        {
            if (_reader != null)
            {
                throw new InvalidOperationException("A GTFSSourceFileStream can only spawn one enumerator.");
            }
            if (_customSeperator.HasValue)
            { // create reader with custom seperator.
                _reader = new CSVStreamReader(_stream, _customSeperator.Value);
            }
            else
            { // no seperator here!
                _reader = new CSVStreamReader(_stream);
            }

            _reader.LinePreprocessor = this.LinePreprocessor;
            return(_reader);
        }
Пример #2
0
        /// <summary>
        /// Requests a new enumerator.
        /// </summary>
        /// <returns></returns>
        public System.Collections.Generic.IEnumerator<string[]> GetEnumerator()
        {
            if(_reader != null)
            {
                throw new InvalidOperationException("A GTFSSourceFileStream can only spawn one enumerator.");
            }
            if (_customSeperator.HasValue)
            { // create reader with custom seperator.
                _reader = new CSVStreamReader(_stream, _customSeperator.Value);
            }
            else
            { // no seperator here!
                _reader = new CSVStreamReader(_stream);
            }

            _reader.LinePreprocessor = this.LinePreprocessor;
            return _reader;
        }