From 7046987fed87302dc8d069a0c2417707659b949c Mon Sep 17 00:00:00 2001 From: morkt Date: Tue, 2 Jan 2018 06:27:17 +0400 Subject: [PATCH] (VFS.ChangeFileName): new static method. --- GameRes/FileSystem.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/GameRes/FileSystem.cs b/GameRes/FileSystem.cs index 19c13700..a7de4f9f 100644 --- a/GameRes/FileSystem.cs +++ b/GameRes/FileSystem.cs @@ -806,6 +806,15 @@ namespace GameRes int filename_portion_length = path.Length - filename_index; return filename.Length == filename_portion_length; } + + /// + /// Change filename portion of the to . + /// + public static string ChangeFileName (string path, string target) + { + var dir_name = GetDirectoryName (path); + return CombinePath (dir_name, target); + } } public class FileNameGlob