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
fs::path <> string interoperability #7817
base: master
Are you sure you want to change the base?
Conversation
it will cause some test errors with stuff like |
+1 for path return type everywhere. for the failing tests they should be updated to explicitly perform the string conversion: ofxTestEq(ofPathToString(ofToDataPath("movies\\",true)).back(), '\\', "absolute ofToDataPath with \\ should end in \\"); (incidentally it's more or less what someone holding to some legacy code using string methods directly on the return of ofDataPath might need to do, but method chaining is not prevalent in user code) |
Great. if we decide to proceed with this idea I'll complete the work in this same PR. |
I've finally finished this one. I've updated the tests accordingly. opinions? @ofTheo @NickHardeman @artificiel @danoli3 |
Wow. Awesome!
Did you run into anything with the tests that might indicate breaking changes for old projects?
|
In the tests the things I had to change is something like ofToDataPath("").back() string resultado = ofSystem("open " + ofToDataPath(fullFileName)); I had to switch to something like: string resultado = ofSystem("open " + ofPathToString(ofToDataPath(fullFileName)));
or
string resultado = ofSystem("open " + ofToDataPath(fullFileName).string()); |
ahh so does that mean any code that has I guess that is the downside - but the upside is support for non English filesystems right? |
Yes exactly. support for different encodings end to end inside core. |
this PR is to experiment interoperability between fs::path and string.
I think this was not happening before because of some systems were using
std::experimental::filesystem::v1::__cxx11::path
which caused errors when converting fs::path to string.I've updated ofConstants.h in this PR so __cxx11 is not being used anymore