aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/dataloader/Dataloader.cpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-10-15 16:26:39 +0200
committer GitHub <noreply@github.com>2023-10-15 16:26:39 +0200
commit3249e21104bab6002676abe00450e7bd3f682303 (patch)
treec2a13a44d4c8553f6e87193f5f437052cf1d7067 /src/openvic-simulation/dataloader/Dataloader.cpp
parent17847e16e14ec52eb48a6fd0d9dc36ee93e457db (diff)
parentd26f9c2fb5a9666822a0f702d76b764600a390d7 (diff)
Merge pull request #52 from OpenVicProject/tgc-compat
TGC compatibility fixes + other cleanup
Diffstat (limited to 'src/openvic-simulation/dataloader/Dataloader.cpp')
-rw-r--r--src/openvic-simulation/dataloader/Dataloader.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/openvic-simulation/dataloader/Dataloader.cpp b/src/openvic-simulation/dataloader/Dataloader.cpp
index b9d7496..72e3113 100644
--- a/src/openvic-simulation/dataloader/Dataloader.cpp
+++ b/src/openvic-simulation/dataloader/Dataloader.cpp
@@ -46,8 +46,8 @@ constexpr bool path_equals(std::string_view lhs, std::string_view rhs) {
}
template<typename LT, typename RT>
-constexpr bool filename_equals(const LT& lhs, const RT& rhs) {
- std::string_view left, right;
+bool filename_equals(const LT& lhs, const RT& rhs) {
+ std::string left, right;
if constexpr (std::same_as<LT, std::filesystem::path>)
left = lhs.filename().string();
else left = lhs;
@@ -314,7 +314,7 @@ fs::path Dataloader::search_for_game_path(fs::path hint_path) {
return _cached_paths[hint_path] = _search_for_game_path(hint_path);
}
-bool Dataloader::set_roots(path_vector_t new_roots) {
+bool Dataloader::set_roots(path_vector_t const& new_roots) {
if (!roots.empty()) {
Logger::error("Overriding existing dataloader roots!");
roots.clear();
@@ -700,7 +700,7 @@ static bool _load_localisation_file(Dataloader::localisation_callback_t callback
return ret;
}
-bool Dataloader::load_localisation_files(localisation_callback_t callback, fs::path const& localisation_dir) {
+bool Dataloader::load_localisation_files(localisation_callback_t callback, fs::path const& localisation_dir) const {
return apply_to_files_in_dir(localisation_dir, ".csv",
[callback](fs::path path) -> bool {
return _load_localisation_file(callback, parse_csv(path).get_lines());