/// <summary> /// Interprets the file as a text file /// </summary> /// <returns></returns> public static TextFile AsTextFile(this IFilePath path) => path.IsUnspecified() ? TextFile.Empty : new TextFile(path.FileSystemPath);
/// <summary> /// Reads all lines of text from the file /// </summary> /// <returns></returns> public static Lst <string> ReadAllLines(this IFilePath path) => path.IsUnspecified() ? list <string>() : Lst.make(File.ReadAllLines(path.FileSystemPath));
/// <summary> /// Presuming the represented file is a text file, reads and returns the contained text /// </summary> public static string ReadAllText(this IFilePath path, Encoding encoding) => path.IsUnspecified() ? String.Empty : File.ReadAllText(path.FileSystemPath, encoding);