Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #6
0
        public static IEnumerable <string> ReadLines(string path, Encoding encoding)
        {
            Validate(path, encoding);

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