From c198596df0b0ee423b4c57aefdc5ad2d112375f0 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sat, 2 Jan 2010 21:58:46 +1300 Subject: [PATCH] added Exists() to FileSystem --- OpenRa.FileFormats/FileSystem.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/OpenRa.FileFormats/FileSystem.cs b/OpenRa.FileFormats/FileSystem.cs index 686f699c4a..b0c98d83ba 100644 --- a/OpenRa.FileFormats/FileSystem.cs +++ b/OpenRa.FileFormats/FileSystem.cs @@ -73,5 +73,20 @@ namespace OpenRa.FileFormats throw new FileNotFoundException( string.Format( "File not found: {0}", filename ), filename ); } + + public static bool Exists(string filename) + { + foreach (var folder in mountedFolders) + { + var s = folder.GetContent(filename); + if (s != null) + { + s.Dispose(); + return true; + } + } + + return false; + } } }