Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
837 views
in Technique[技术] by (71.8m points)

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

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...