From 907e0974e96a592d4bba99a3839354533d524b1b Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sat, 14 Aug 2021 23:48:52 +1000 Subject: [PATCH] - Add `GetLongName()` method to `FileSystem` class. --- source/common/filesystem/filesystem.cpp | 6 ++++++ source/common/filesystem/filesystem.h | 1 + 2 files changed, 7 insertions(+) diff --git a/source/common/filesystem/filesystem.cpp b/source/common/filesystem/filesystem.cpp index 4c5a5b910..1bf8c2f5a 100644 --- a/source/common/filesystem/filesystem.cpp +++ b/source/common/filesystem/filesystem.cpp @@ -899,6 +899,12 @@ LumpShortName& FileSystem::GetShortName(int i) return FileInfo[i].shortName; } +FString& FileSystem::GetLongName(int i) +{ + if ((unsigned)i >= NumEntries) I_Error("GetShortName: Invalid index"); + return FileInfo[i].longName; +} + void FileSystem::RenameFile(int num, const char* newfn) { if ((unsigned)num >= NumEntries) I_Error("RenameFile: Invalid index"); diff --git a/source/common/filesystem/filesystem.h b/source/common/filesystem/filesystem.h index 89cc288d3..5924e86c1 100644 --- a/source/common/filesystem/filesystem.h +++ b/source/common/filesystem/filesystem.h @@ -117,6 +117,7 @@ public: } LumpShortName& GetShortName(int i); // may only be called before the hash chains are set up. + FString& GetLongName(int i); // may only be called before the hash chains are set up. void RenameFile(int num, const char* fn); bool CreatePathlessCopy(const char* name, int id, int flags);