From a8e51f86d7f1fba7e93e948392ad0b06249bf1e9 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 5 Jul 2020 10:22:53 -0400 Subject: [PATCH] CVirtualDirectory: Add const getters Allows data retrieval even with const variants of virtual directories. --- src/Core/GameProject/CVirtualDirectory.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Core/GameProject/CVirtualDirectory.h b/src/Core/GameProject/CVirtualDirectory.h index 58ef9e5e..fcb69b7e 100644 --- a/src/Core/GameProject/CVirtualDirectory.h +++ b/src/Core/GameProject/CVirtualDirectory.h @@ -52,10 +52,12 @@ public: bool IsRoot() const { return !mpParent; } TString Name() const { return mName; } - uint32 NumSubdirectories() const { return mSubdirectories.size(); } - CVirtualDirectory* SubdirectoryByIndex(uint32 Index) { return mSubdirectories[Index]; } - uint32 NumResources() const { return mResources.size(); } - CResourceEntry* ResourceByIndex(uint32 Index) { return mResources[Index]; } + uint32 NumSubdirectories() const { return mSubdirectories.size(); } + CVirtualDirectory* SubdirectoryByIndex(uint32 Index) { return mSubdirectories[Index]; } + const CVirtualDirectory* SubdirectoryByIndex(uint32 Index) const { return mSubdirectories[Index]; } + uint32 NumResources() const { return mResources.size(); } + CResourceEntry* ResourceByIndex(uint32 Index) { return mResources[Index]; } + const CResourceEntry* ResourceByIndex(uint32 Index) const { return mResources[Index]; } }; #endif // CVIRTUALDIRECTORY