diff options
author | Hop311 <hop3114@gmail.com> | 2023-09-09 16:00:23 +0200 |
---|---|---|
committer | Hop311 <hop3114@gmail.com> | 2023-09-09 22:50:29 +0200 |
commit | b4220ad73e14e3b497b2fdeb83d76a6633664764 (patch) | |
tree | 72aee7b62ca2a1714799ff8f477ca1e50407eca8 /src/openvic-simulation/dataloader/Dataloader.hpp | |
parent | 7772f8871348b7b52cb0a478bb76df68d8799a07 (diff) |
PR feedback + Logger::warning
Diffstat (limited to 'src/openvic-simulation/dataloader/Dataloader.hpp')
-rw-r--r-- | src/openvic-simulation/dataloader/Dataloader.hpp | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/src/openvic-simulation/dataloader/Dataloader.hpp b/src/openvic-simulation/dataloader/Dataloader.hpp index f723803..20538a6 100644 --- a/src/openvic-simulation/dataloader/Dataloader.hpp +++ b/src/openvic-simulation/dataloader/Dataloader.hpp @@ -5,31 +5,36 @@ #include <vector> namespace OpenVic { + namespace fs = std::filesystem; + struct GameManager; struct PopManager; struct Map; class Dataloader { - std::vector<std::filesystem::path> roots; + public: + using path_vector_t = std::vector<fs::path>; + private: + path_vector_t roots; - bool _load_pop_types(PopManager& pop_manager, std::filesystem::path const& pop_type_directory) const; - bool _load_map_dir(Map& map, std::filesystem::path const& map_directory) const; + bool _load_pop_types(PopManager& pop_manager, fs::path const& pop_type_directory) const; + bool _load_map_dir(Map& map, fs::path const& map_directory) const; public: Dataloader() = default; /* In reverse-load order, so base defines first and final loaded mod last */ - bool set_roots(std::vector<std::filesystem::path> new_roots); + bool set_roots(path_vector_t new_roots); - std::filesystem::path lookup_file(std::filesystem::path const& path) const; - static const std::filesystem::path TXT; - std::vector<std::filesystem::path> lookup_files_in_dir(std::filesystem::path const& path, - std::filesystem::path const* extension = &TXT) const; - bool apply_to_files_in_dir(std::filesystem::path const& path, - std::function<bool(std::filesystem::path const&)> callback, - std::filesystem::path const* extension = &TXT) const; + fs::path lookup_file(fs::path const& path) const; + static const fs::path TXT; + path_vector_t lookup_files_in_dir(fs::path const& path, + fs::path const* extension = &TXT) const; + bool apply_to_files_in_dir(fs::path const& path, + std::function<bool(fs::path const&)> callback, + fs::path const* extension = &TXT) const; bool load_defines(GameManager& game_manager) const; - bool load_pop_history(GameManager& game_manager, std::filesystem::path const& path) const; + bool load_pop_history(GameManager& game_manager, fs::path const& path) const; }; } |