From 4acc2cca677124c827bca69990c1150d43dd78ef Mon Sep 17 00:00:00 2001 From: disarray2077 <86157825+disarray2077@users.noreply.github.com> Date: Sat, 1 Jan 2022 21:19:44 -0300 Subject: [PATCH] Add doAppend parameter to WriteAllLines --- BeefLibs/corlib/src/IO/File.bf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/BeefLibs/corlib/src/IO/File.bf b/BeefLibs/corlib/src/IO/File.bf index 555a6d95..31ef4530 100644 --- a/BeefLibs/corlib/src/IO/File.bf +++ b/BeefLibs/corlib/src/IO/File.bf @@ -107,7 +107,7 @@ namespace System.IO return .Ok; } - public static Result WriteAllLines(StringView path, IEnumerator enumerator) + public static Result WriteAllLines(StringView path, IEnumerator enumerator, bool doAppend = false) { String strBuf = scope String(); for (var str in enumerator) @@ -115,10 +115,10 @@ namespace System.IO strBuf.Append(str); strBuf.Append(Environment.NewLine); } - return WriteAllText(path, strBuf); + return WriteAllText(path, strBuf, doAppend); } - public static Result WriteAllLines(StringView path, IEnumerator enumerator) + public static Result WriteAllLines(StringView path, IEnumerator enumerator, bool doAppend = false) { String strBuf = scope String(); for (var str in enumerator) @@ -126,7 +126,7 @@ namespace System.IO strBuf.Append(str); strBuf.Append(Environment.NewLine); } - return WriteAllText(path, strBuf); + return WriteAllText(path, strBuf, doAppend); } /*public static Result>> ReadLines(String fileName)