-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add RFC 105 text: Add and use safe path manipulation functions #11640
base: master
Are you sure you want to change the base?
Conversation
9957c92
to
67631c8
Compare
doc/source/development/rfc/rfc105_safe_path_manipulation_functions.rst
Outdated
Show resolved
Hide resolved
doc/source/development/rfc/rfc105_safe_path_manipulation_functions.rst
Outdated
Show resolved
Hide resolved
doc/source/development/rfc/rfc105_safe_path_manipulation_functions.rst
Outdated
Show resolved
Hide resolved
doc/source/development/rfc/rfc105_safe_path_manipulation_functions.rst
Outdated
Show resolved
Hide resolved
doc/source/development/rfc/rfc105_safe_path_manipulation_functions.rst
Outdated
Show resolved
Hide resolved
Co-authored-by: Laurențiu Nicola <[email protected]>
Thank you @rouault . Great analysis. |
Are there plans to require C++17 "soon"? It has LGTM otherwise. |
This is already a requirement
My ambition doesn't go that far. It would be a significantly more invasive change. It is likely that our custom 25+ year functions do very similar things than std::filesystem::path (https://en.cppreference.com/w/cpp/filesystem/path), but I'd be afraid there are "subtle" differences that would prevent automatic replacement.
Our current methods require UTF-8 paths. |
I also would like to get to a point where these CPL functions are simple wrappers of I have a problem with the name "Safe", but no problem with the intention and proposed fixes. As a user of the function, of course I want to use "safe" things 😄 Maybe calling them |
That's the idea of this RFC, right? |
Indeed... How std::filesystem on MSVC would work with /vsi paths... ?
Even doing the "dumb" replacement I suggest in the RFC is going to be very painful, because there are several hundreds of locations where the sed magic isn't powerful enough to automate it and that will require hand editing. I'll let std::filesystem exploration to someone braver than me :-)
The change of the CPLxxxx() functions to return std::string and no longer use C concatenation function was the easy part and it is not that much (300 hundred lines of code maybe?)
Well, they are somewhat scary to use, so better have people ran away from them :-) Joke aside, I'm fine with the "2" is there's a consensus it is better than "Safe". I also considerd a "Cpp" suffix to indicate they are for use by C++ code, but wasn't convinced. We have some precedent of using "2" suffix. |
Rendered view