Core/AppFilesystemComponent: Add GetDirectory
This commit is contained in:
parent
4f3542356d
commit
1bb4b8fa0d
|
|
@ -36,6 +36,7 @@ namespace Nz
|
|||
~AppFilesystemComponent() = default;
|
||||
|
||||
template<typename T> const typename T::Params* GetDefaultResourceParameters() const;
|
||||
inline VirtualDirectoryPtr GetDirectory(std::string_view assetPath);
|
||||
|
||||
template<typename T, typename... ExtraArgs> std::shared_ptr<T> Load(std::string_view assetPath, ExtraArgs&&... args);
|
||||
template<typename T, typename... ExtraArgs> std::shared_ptr<T> Load(std::string_view assetPath, typename T::Params params, ExtraArgs&&... args);
|
||||
|
|
|
|||
|
|
@ -34,6 +34,17 @@ namespace Nz
|
|||
return static_cast<const typename T::Params*>(m_defaultParameters[resourceIndex].get());
|
||||
}
|
||||
|
||||
VirtualDirectoryPtr AppFilesystemComponent::GetDirectory(std::string_view assetPath)
|
||||
{
|
||||
VirtualDirectoryPtr dir;
|
||||
m_rootDirectory->GetDirectoryEntry(assetPath, [&](const Nz::VirtualDirectory::DirectoryEntry& dirEntry)
|
||||
{
|
||||
dir = dirEntry.directory;
|
||||
});
|
||||
|
||||
return dir;
|
||||
}
|
||||
|
||||
template<typename T, typename... ExtraArgs>
|
||||
std::shared_ptr<T> AppFilesystemComponent::Load(std::string_view assetPath, ExtraArgs&&... args)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue