Unlinker/ObjLoading: Add skeleton for dynamically loading search paths based on current zone

This commit is contained in:
Jan
2019-12-30 23:52:33 +01:00
parent 5f833969f9
commit 153f8f2e89
15 changed files with 727 additions and 178 deletions

View File

@ -6,19 +6,41 @@
class SearchPaths final : public ISearchPath
{
std::vector<ISearchPath*> m_search_paths;
std::vector<ISearchPath*> m_to_free;
public:
using iterator = std::vector<ISearchPath*>::iterator;
SearchPaths();
~SearchPaths() override;
FileAPI::IFile* Open(const std::string& fileName) override;
void FindAll(std::function<void(const std::string&)> callback) override;
void FindAllOnDisk(std::function<void(const std::string&)> callback) override;
void FindByExtension(const std::string& extension, std::function<void(const std::string&)> callback) override;
void FindOnDiskByExtension(const std::string& extension, std::function<void(const std::string&)> callback) override;
SearchPaths(const SearchPaths& other);
SearchPaths(SearchPaths&& other) noexcept;
SearchPaths& operator=(const SearchPaths& other);
SearchPaths& operator=(SearchPaths&& other) noexcept;
void AddSearchPath(ISearchPath* searchPath);
/**
* \brief Adds a search path that gets deleted upon destruction of the \c SearchPaths object.
* \param searchPath The search path to add.
*/
void CommitSearchPath(ISearchPath* searchPath);
/**
* \brief Adds a search path that does \b NOT get deleted upon destruction of the \c SearchPaths object.
* \param searchPath The search path to add.
*/
void IncludeSearchPath(ISearchPath* searchPath);
/**
* \brief Removes a search path from the \c SearchPaths object. If the search path was committed then it will \b NOT be deleted when destructing the \c SearchPaths object.
* \param searchPath The search path to remove.
*/
void RemoveSearchPath(ISearchPath* searchPath);
iterator begin();