Example #1
0
        public static IEnumerable <string> ReadLines(string path)
        {
            if (path == null)
            {
                throw new ArgumentNullException(nameof(path));
            }
            if (path.Length == 0)
            {
                throw new ArgumentException(SR.Argument_EmptyPath, nameof(path));
            }

            return(ReadLinesIterator.CreateIterator(path, Encoding.UTF8));
        }
Example #2
0
        /// <summary>
        /// </summary>
        /// <param name="path">
        /// </param>
        /// <returns>
        /// </returns>
        /// <exception cref="ArgumentNullException">
        /// </exception>
        /// <exception cref="ArgumentException">
        /// </exception>
        public static IEnumerable <string> ReadLines(string path)
        {
            if (path == null)
            {
                throw new ArgumentNullException("path");
            }

            if (path.Length == 0)
            {
                throw new ArgumentException(Environment.GetResourceString("Argument_EmptyPath"), "path");
            }

            return(ReadLinesIterator.CreateIterator(path, Encoding.UTF8));
        }
Example #3
0
        public static IEnumerable <String> ReadLines(String path)
        {
            if (path == null)
            {
                throw new ArgumentNullException("path");
            }
            if (path.Length == 0)
            {
                throw new ArgumentException(SR.Argument_EmptyPath, "path");
            }
            Contract.EndContractBlock();

            return(ReadLinesIterator.CreateIterator(path, Encoding.UTF8));
        }
Example #4
0
        public static IEnumerable <String> ReadLines(String path)
        {
            if (path == null)
            {
                throw new ArgumentNullException(nameof(path));
            }
            if (path.Length == 0)
            {
                throw new ArgumentException(Environment.GetResourceString("Argument_EmptyPath"), nameof(path));
            }
            Contract.EndContractBlock();

            return(ReadLinesIterator.CreateIterator(path, Encoding.UTF8));
        }
Example #5
0
        public static IEnumerable <string> ReadLines(string path, Encoding encoding)
        {
            if (path == null)
            {
                throw new ArgumentNullException(nameof(path));
            }
            if (encoding == null)
            {
                throw new ArgumentNullException(nameof(encoding));
            }
            if (path.Length == 0)
            {
                throw new ArgumentException(SR.Argument_EmptyPath, nameof(path));
            }
            Contract.EndContractBlock();

            return(ReadLinesIterator.CreateIterator(path, encoding));
        }
Example #6
0
        public static IEnumerable <string> ReadLines(string path, Encoding encoding)
        {
            Validate(path, encoding);

            return(ReadLinesIterator.CreateIterator(path, encoding));
        }
Example #7
0
 internal static ReadLinesIterator CreateIterator(string path, Encoding encoding)
 {
     return(ReadLinesIterator.CreateIterator(path, encoding, (StreamReader)null));
 }
Example #8
0
 protected override Iterator <string> Clone()
 {
     return((Iterator <string>)ReadLinesIterator.CreateIterator(this._path, this._encoding, this._reader));
 }