Exemplo n.º 1
0
        /// <summary>
        /// Reads the entire file and returns the contents as a string enumberable, with each item representing a different line.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <returns>A string enumberable representing the contents of the file.</returns>
        public static IEnumerable<string> ReadLines(AFile file)
        {
            Exceptions.NotNullException<AFile>(file, nameof(file));

            return file.ReadAllLines();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Reads the entire file and returns the contents as a string list, with each item representing a different line.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <returns>A string list representing the contents of the file.</returns>
        public static List<string> ReadLinesList(AFile file)
        {
            Exceptions.NotNullException<AFile>(file, nameof(file));

            return new List<string>(file.ReadAllLines());
        }
Exemplo n.º 3
0
        /// <summary>
        /// Reads the entire file and returns the contents as a string array, with each item representing a different line.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <returns>A string array representing the contents of the file.</returns>
        public static string[] ReadAllLines(AFile file)
        {
            Exceptions.NotNullException<AFile>(file, nameof(file));

            return file.ReadAllLines();
        }