From cb54e20e56cc3e9ed696ffe79abaad50c69f49a0 Mon Sep 17 00:00:00 2001 From: morkt Date: Sun, 31 Dec 2017 09:00:24 +0400 Subject: [PATCH] (ArchiveFormat.IsValidEntryName): new static method. --- GameRes/ArchiveFormat.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/GameRes/ArchiveFormat.cs b/GameRes/ArchiveFormat.cs index 4bfa0568..4e561d45 100644 --- a/GameRes/ArchiveFormat.cs +++ b/GameRes/ArchiveFormat.cs @@ -133,6 +133,14 @@ namespace GameRes { return count > 0 && count < 0x20000; } + + /// + /// Whether represents a valid archive entry name. + /// + public static bool IsValidEntryName (string name) + { + return !string.IsNullOrWhiteSpace (name) && !Path.IsPathRooted (name); + } } public enum ArchiveOperation