Core/VirtualDirectory: Add Uproot property

This commit is contained in:
Lynix
2022-05-14 10:22:22 +02:00
parent b6ab3ba1b3
commit dd4be081aa
3 changed files with 104 additions and 63 deletions

View File

@@ -39,13 +39,17 @@ namespace Nz
VirtualDirectory(VirtualDirectory&&) = delete;
~VirtualDirectory() = default;
bool Exists(std::string_view path);
inline void AllowUproot(bool uproot = true);
inline 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);
template<typename F> bool GetFileContent(std::string_view path, F&& callback);
inline bool IsUprootAllowed() const;
inline DirectoryEntry& StoreDirectory(std::string_view path, VirtualDirectoryPtr directory);
inline PhysicalDirectoryEntry& StoreDirectory(std::string_view path, std::filesystem::path directoryPath);
inline FileContentEntry& StoreFile(std::string_view path, std::vector<UInt8> file);
@@ -99,6 +103,7 @@ namespace Nz
std::optional<std::filesystem::path> m_physicalPath;
std::vector<ContentEntry> m_content;
std::weak_ptr<VirtualDirectory> m_parent;
bool m_isUprootAllowed;
};
}