How to check if path is valid in boost::filesystem?

boost, c++

Solution

Have a look here:

http://www.boost.org/doc/libs/release/libs/filesystem/doc/portability_guide.htm

This describes various functions for checking whether filenames are valid or not.

Problem

I am setting a `boost::filesystem::path` from an edit field. I notice that the constructor is happy to accept invalid characters for the filename. How can I use `boost::filesystem` to check if the `boost::filesystem::path` object represents a valid filename?

Original source