diff options
author | George L. Albany <Megacake1234@gmail.com> | 2024-07-07 20:58:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-07 20:58:13 +0200 |
commit | 2275b40b519bdbc8ee707ca2373ea167a72625ab (patch) | |
tree | d38d333b55e6ec42c28adf4554153aad378159fc /src/openvic-simulation/dataloader/Dataloader.cpp | |
parent | 8c8b9349e26b4f606e18810a201ff378eaac19b2 (diff) | |
parent | 71b846dc5dd1ac49626c8b479571050224a4cca1 (diff) |
Merge pull request #169 from OpenVicProject/dryad
Update OpenVicProject/OpenVic-Dataloader@4a49007
Diffstat (limited to 'src/openvic-simulation/dataloader/Dataloader.cpp')
-rw-r--r-- | src/openvic-simulation/dataloader/Dataloader.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/openvic-simulation/dataloader/Dataloader.cpp b/src/openvic-simulation/dataloader/Dataloader.cpp index dab479f..f42a518 100644 --- a/src/openvic-simulation/dataloader/Dataloader.cpp +++ b/src/openvic-simulation/dataloader/Dataloader.cpp @@ -204,7 +204,7 @@ template<std::derived_from<detail::BasicParser> Parser, bool (*parse_func)(Parse static Parser _run_ovdl_parser(fs::path const& path) { Parser parser; std::string buffer; - auto error_log_stream = detail::CallbackStream { + auto error_log_stream = detail::make_callback_stream<char>( [](void const* s, std::streamsize n, void* user_data) -> std::streamsize { if (s != nullptr && n > 0 && user_data != nullptr) { static_cast<std::string*>(user_data)->append(static_cast<char const*>(s), n); @@ -215,7 +215,7 @@ static Parser _run_ovdl_parser(fs::path const& path) { } }, &buffer - }; + ); parser.set_error_log_to(error_log_stream); parser.load_from_file(path); if (!buffer.empty()) { @@ -255,12 +255,12 @@ v2script::Parser Dataloader::parse_lua_defines(fs::path const& path) { return _run_ovdl_parser<v2script::Parser, &_lua_parse>(path); } -static bool _csv_parse(csv::Windows1252Parser& parser) { +static bool _csv_parse(csv::Parser& parser) { return parser.parse_csv(); } -csv::Windows1252Parser Dataloader::parse_csv(fs::path const& path) { - return _run_ovdl_parser<csv::Windows1252Parser, &_csv_parse>(path); +csv::Parser Dataloader::parse_csv(fs::path const& path) { + return _run_ovdl_parser<csv::Parser, &_csv_parse>(path); } v2script::Parser& Dataloader::parse_defines_cached(fs::path const& path) { |