openage
openage copied to clipboard
Updating headers with std::filesystem for Win
There were some problems in the past regarding std::filesystem
, MSVC 2017 and 2019 added support so we would be able to update our sources correspondingly.
I would recommend to replace our custom path handling within libopenage/util/fslike/directory.h
to use std::filesystem
instead of our custom implementation.
The frontent, our path and filesystem abstraction (openage/util/fslike/
and libopenage/util/fslike/
) should stay and then be a wrapper around std::filesystem
.
This is because our path system supports passing paths between C++ and Python, and std::filesystem
can only be used for native C++ paths.
I would recommend to replace our custom path handling within
libopenage/util/fslike/directory.h
to usestd::filesystem
instead of our custom implementation. The frontent, our path and filesystem abstraction (openage/util/fslike/
andlibopenage/util/fslike/
) should stay and then be a wrapper aroundstd::filesystem
.This is because our path system supports passing paths between C++ and Python, and
std::filesystem
can only be used for native C++ paths.
I think with a bit of support I'll be able to tackle this one as my first contribution :)
I think with a bit of support I'll be able to tackle this one as my first contribution :)
Nice, and for sure we will be able to support ;-) As a starter you could read a small workflow recommendation by us so here: https://github.com/SFTtech/openage/blob/master/doc/contributing.md#workflow
For example just by making your Draft-PR early and marking it [WIP] we will be able to look easily into things, you and we can comment on lines of code with questions, feedback or explanations etc.
heads up, though, is that std::filesystem is (or at least was) very crashy-crashy with msvc so I'd suggest a lot of testing before merging anything.
iirc I ended up blaming some internal refcounting in their path objects, it seemed to go away once I switched to always convert to strings in freeaoe (instead of storing std::filesystem::path
s). aaand remember generic_string() vs string().