CVirtualDirectory: Add const getters

Allows data retrieval even with const variants of virtual directories.
This commit is contained in:
Lioncash 2020-07-05 10:22:53 -04:00
parent 97fa0c7f2d
commit a8e51f86d7
1 changed files with 6 additions and 4 deletions

View File

@ -52,10 +52,12 @@ public:
bool IsRoot() const { return !mpParent; } bool IsRoot() const { return !mpParent; }
TString Name() const { return mName; } TString Name() const { return mName; }
uint32 NumSubdirectories() const { return mSubdirectories.size(); } uint32 NumSubdirectories() const { return mSubdirectories.size(); }
CVirtualDirectory* SubdirectoryByIndex(uint32 Index) { return mSubdirectories[Index]; } CVirtualDirectory* SubdirectoryByIndex(uint32 Index) { return mSubdirectories[Index]; }
uint32 NumResources() const { return mResources.size(); } const CVirtualDirectory* SubdirectoryByIndex(uint32 Index) const { return mSubdirectories[Index]; }
CResourceEntry* ResourceByIndex(uint32 Index) { return mResources[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 #endif // CVIRTUALDIRECTORY