Exemplo n.º 1
0
        /// <summary>
        /// Ctor.
        /// </summary>
        /// <param name="filePath"></param>
        /// <param name="source"></param>
        /// <param name="filters"></param>
        public LineReader(string filePath, string source, IEnumerable<ReadFilter> filters)
        {
            this.trie = new FilterTrie(filters);
            this.source = source;
            this.filePath = filePath;

            if (this.source == null)
            {
                if (File.Exists(filePath))
                {
                    this.source = File.ReadAllText(filePath);
                }
                else
                {
                    throw new FileError("File not found", filePath, 0, 0);
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Ctor.
        /// </summary>
        /// <param name="filePath"></param>
        /// <param name="source"></param>
        /// <param name="filters"></param>
        internal LineReader(string filePath, string source, IEnumerable<ReadFilter> filters)
        {
            this.trie = new FilterTrie(filters);
            this.source = source;
            this.filePath = filePath;

            if (this.source == null)
            {
                this.source = filePath;//Changed to direct content string instead of file.
                /*if (System.IO.File.Exists(filePath))
                {
                    this.source = System.IO.File.ReadAllText(filePath);
                }
                else
                {
                    throw new FileError("File not found", filePath, 0, 0);
                }*/
            }
        }