Core/AppFilesystemComponent: Add GetDirectory
This commit is contained in:
@@ -36,6 +36,7 @@ namespace Nz
|
|||||||
~AppFilesystemComponent() = default;
|
~AppFilesystemComponent() = default;
|
||||||
|
|
||||||
template<typename T> const typename T::Params* GetDefaultResourceParameters() const;
|
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, ExtraArgs&&... args);
|
||||||
template<typename T, typename... ExtraArgs> std::shared_ptr<T> Load(std::string_view assetPath, typename T::Params params, 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());
|
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>
|
template<typename T, typename... ExtraArgs>
|
||||||
std::shared_ptr<T> AppFilesystemComponent::Load(std::string_view assetPath, ExtraArgs&&... args)
|
std::shared_ptr<T> AppFilesystemComponent::Load(std::string_view assetPath, ExtraArgs&&... args)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user