ITK
ITK copied to clipboard
WIP: Use std filesystem path
Add std::filesystem::path to ImageIOBase for eventual wchar support for paths.
This proposes an approach to remove direct access to m_FileName, with the eventual end goal to use GetFilePath and "legacy" GetFileName methods.
Add Set/Get FilePath member functions to ImageIOBase, with the future
plan to replace the m_FileName member variable with these access
member functions. The m_FileName is directly access by derived ImageIO
classes.
The m_FileName is now "constant" to disallow derived classes from
directly writing to the variable. The SetFilePath method updates the
legacy const m_FileName to maintain compatibility.
@blowekamp Very interesting, thanks! I definitely like having a separate type for file paths, rather than just "std::string", for improved type safety. I'm also curious to see if it does improve non-ASCII character support in file names, on Windows.
It looks like adopting std::filesystem
would require increasing ITK's minimum macOS to 10.15:
https://stackoverflow.com/questions/58667853/does-use-of-c17-stdfilesystem-require-macos-10-15-xcode-11-1
Even though C++17 compilers exist on older version of macOS, the STL shipped on older versions does not support std::filesystem
, from what I gather.
That would suck for me, I still support back to 10.13.
I still support back to 10.13.
Our Python packages also require 10.11.