There is no change in behavior. This just helps prepare for the
transition from boost::filesystem to std::filesystem by avoiding calls
to methods which will be unsafe after the transaction to std::filesystem
to due lack of a boost::filesystem::path::imbue equivalent and inability
to set a predictable locale.Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
Co-authored-by: Kiminuo <kiminuo@protonmail.com>
Co-authored-by: MarcoFalke <falke.marco@gmail.com>
This is a partial backport of core#22937 [2a/2g]
https://github.com/bitcoin/bitcoin/pull/22937/commits/6544ea5035268025207d2402db2f7d90fde947a6
The backport for this commit was split in to multiple commits to make review easier.
This first commit does mainly two things:
- add a couple of necessary methods to fs::path: quoted and operator+ to be used in subsequent commits to migrate away from methods that will be unsafe when we will transition from boost::filesystem to std::filesystem.
- use fs::ofstream instead of std::ostream because the former defines a constructor for fs::path, and pass in fs::path directly when constructing fs::ofstream instead of a c string. This removes the need to to path to string conversions that depend on the the BOOST version.