I need to determine that a string entered by a user is OK to create a file with that name. My application is built on Qt and runs on Windows and Mac OS.
I've found a check function in boost.filesystem, namely native(). The documentation says, 'Returns true for names considered valid by the operating system's native file systems.' Sounds like what I need, but the function doesn't work properly and returns false always. I've tried both back and forward slashes in the path, and tested the function with both existing and non-existing paths—all these tests failed on Windows. Thanks to chris (see a comment below) who pointed that the function may be intentionally broken (I tend to agree with that).
So the question is: how to achieve what I need?