2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-07-11 13:41:50 +00:00

chore: parse includes and assetlists while parsing zone definition

This commit is contained in:
Jan
2025-01-01 18:13:23 +01:00
parent 9852f52a15
commit aa212e0958
74 changed files with 530 additions and 437 deletions

View File

@ -0,0 +1,48 @@
#pragma once
#include "ISearchPath.h"
#include <string>
#include <vector>
class SearchPaths final : public ISearchPath
{
std::vector<ISearchPath*> m_search_paths;
std::vector<std::unique_ptr<ISearchPath>> m_owned_search_paths;
public:
using iterator = std::vector<ISearchPath*>::iterator;
SearchPaths() = default;
~SearchPaths() override = default;
SearchPathOpenFile Open(const std::string& fileName) override;
const std::string& GetPath() override;
void Find(const SearchPathSearchOptions& options, const std::function<void(const std::string&)>& callback) override;
SearchPaths(const SearchPaths& other) = delete;
SearchPaths(SearchPaths&& other) noexcept = default;
SearchPaths& operator=(const SearchPaths& other) = delete;
SearchPaths& operator=(SearchPaths&& other) noexcept = default;
/**
* \brief Adds a search path that gets deleted upon destruction of the \c SearchPaths object.
* \param searchPath The search path to add.
*/
void CommitSearchPath(std::unique_ptr<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(const ISearchPath* searchPath);
iterator begin();
iterator end();
};