diff options
author | Spartan322 <Megacake1234@gmail.com> | 2024-05-11 20:37:50 +0200 |
---|---|---|
committer | Spartan322 <Megacake1234@gmail.com> | 2024-05-11 22:27:30 +0200 |
commit | 458180da5e61887cd9f820e573f307d0a640128d (patch) | |
tree | c0b7aa641b72b5f2650691cba22d17de335622f6 /src/openvic-dataloader/detail/Parser.cpp | |
parent | 725310939d2b324d79ea4193a72000e21dcc1a2a (diff) |
Fix bugs in #37fix/error-handling
Fix error handling dropping errors
Fix error handling segfaults
Improve error messages
Diffstat (limited to 'src/openvic-dataloader/detail/Parser.cpp')
-rw-r--r-- | src/openvic-dataloader/detail/Parser.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/openvic-dataloader/detail/Parser.cpp b/src/openvic-dataloader/detail/Parser.cpp index fd87687..bb5c612 100644 --- a/src/openvic-dataloader/detail/Parser.cpp +++ b/src/openvic-dataloader/detail/Parser.cpp @@ -1,3 +1,4 @@ +#include <filesystem> #include <iostream> #include <ostream> @@ -40,4 +41,10 @@ bool BasicParser::has_warning() const { std::string_view BasicParser::get_file_path() const { return _file_path; +} + +void BasicParser::set_file_path(std::string_view path) { + std::error_code error; + std::filesystem::path file_path = std::filesystem::weakly_canonical(path, error); + _file_path = file_path.string(); }
\ No newline at end of file |