aboutsummaryrefslogtreecommitdiff
path: root/src/openvic/dataloader/Dataloader.hpp
diff options
context:
space:
mode:
author Hop311 <hop3114@gmail.com>2023-08-26 00:25:12 +0200
committer Hop311 <hop3114@gmail.com>2023-09-03 12:53:52 +0200
commit366f1b3941315641bdcb0ee98465b4d2134eee86 (patch)
treeebb1e95b5e874c6eab09f19a323d721fd1fdac1b /src/openvic/dataloader/Dataloader.hpp
parentefa88c722fcb6c8fea7a86e1b3b8a83f1f59eb31 (diff)
Followup big dataloader commit
Diffstat (limited to 'src/openvic/dataloader/Dataloader.hpp')
-rw-r--r--src/openvic/dataloader/Dataloader.hpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/openvic/dataloader/Dataloader.hpp b/src/openvic/dataloader/Dataloader.hpp
index b080300..3c868a3 100644
--- a/src/openvic/dataloader/Dataloader.hpp
+++ b/src/openvic/dataloader/Dataloader.hpp
@@ -1,14 +1,23 @@
#pragma once
+#include <filesystem>
+
#include "openvic/types/Return.hpp"
+
#include "openvic-dataloader/v2script/Parser.hpp"
namespace OpenVic {
struct GameManager;
+ struct PopManager;
class Dataloader {
std::vector<std::filesystem::path> roots;
+ static ovdl::v2script::Parser parse_defines(std::filesystem::path const& path);
+ ovdl::v2script::Parser parse_defines_lookup(std::filesystem::path const& path) const;
+
+ return_t _load_pop_types(PopManager& pop_manager, std::filesystem::path const& pop_type_directory) const;
+
public:
Dataloader() = default;
@@ -16,7 +25,12 @@ namespace OpenVic {
return_t set_roots(std::vector<std::filesystem::path> new_roots);
std::filesystem::path lookup_file(std::filesystem::path const& path) const;
- std::vector<std::filesystem::path> lookup_files_in_dir(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;
+ return_t apply_to_files_in_dir(std::filesystem::path const& path,
+ std::function<return_t(std::filesystem::path const&)> callback,
+ std::filesystem::path const* extension = &TXT) const;
return_t load_defines(GameManager& game_manager) const;
return_t load_pop_history(GameManager& game_manager, std::filesystem::path const& path) const;