Core/VirtualDirectory: Fix some bugs and add more tests

This commit is contained in:
Jérôme Leclercq
2022-03-11 20:27:08 +01:00
parent bfaa428b39
commit 3d4271706a
3 changed files with 122 additions and 36 deletions

View File

@@ -39,6 +39,8 @@ namespace Nz
VirtualDirectory(VirtualDirectory&&) = delete;
~VirtualDirectory() = default;
bool Exists(std::string_view path);
template<typename F> void Foreach(F&& callback, bool includeDots = false);
template<typename F> bool GetEntry(std::string_view path, F&& callback);
@@ -80,7 +82,7 @@ namespace Nz
private:
template<typename F> bool GetEntryInternal(std::string_view name, F&& callback);
inline bool RetrieveDirectory(std::string_view path, bool allowCreation, std::shared_ptr<VirtualDirectory>& directory, std::string_view& entryName);
inline bool CreateOrRetrieveDirectory(std::string_view path, std::shared_ptr<VirtualDirectory>& directory, std::string_view& entryName);
template<typename T> T& StoreInternal(std::string name, T value);