From 9fabf0f7eedb070a9b0f417dbe793602100501fd Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Fri, 18 Sep 2020 05:12:35 -0700 Subject: [PATCH] Some StringViewification --- BeefLibs/Beefy2D/src/Utils.bf | 5 ++--- BeefLibs/corlib/src/IO/Path.bf | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/BeefLibs/Beefy2D/src/Utils.bf b/BeefLibs/Beefy2D/src/Utils.bf index b858b290..06fd2d66 100644 --- a/BeefLibs/Beefy2D/src/Utils.bf +++ b/BeefLibs/Beefy2D/src/Utils.bf @@ -157,15 +157,14 @@ namespace Beefy return .Ok; } - public static Result LoadTextFile(String fileName, String outBuffer, bool autoRetry = true, delegate void() onPreFilter = null) + public static Result LoadTextFile(StringView filePath, String outBuffer, bool autoRetry = true, delegate void() onPreFilter = null) { FileStream sr = scope .(); - // Retry for a while if the other side is still writing out the file for (int i = 0; i < 100; i++) { - if (sr.Open(fileName, .Read, .Read) case .Err(let fileOpenErr)) + if (sr.Open(filePath, .Read, .Read) case .Err(let fileOpenErr)) { bool retry = false; if (autoRetry) diff --git a/BeefLibs/corlib/src/IO/Path.bf b/BeefLibs/corlib/src/IO/Path.bf index 788aa0c2..61ff9337 100644 --- a/BeefLibs/corlib/src/IO/Path.bf +++ b/BeefLibs/corlib/src/IO/Path.bf @@ -254,7 +254,7 @@ namespace System.IO return (char8[]) InvalidFileNameChars.Clone(); } */ - public static void GetFileNameWithoutExtension(String inPath, String outFileName) + public static void GetFileNameWithoutExtension(StringView inPath, String outFileName) { int lastSlash = Math.Max(inPath.LastIndexOf('\\'), inPath.LastIndexOf('/'));