Check whether a string is a valid filename with Qt

后端 未结 6 1489
一个人的身影
一个人的身影 2021-02-18 22:08

Is there a way with Qt 4.6 to check if a given QString is a valid filename (or directory name) on the current operating system ? I want to check for th

6条回答
  •  旧巷少年郎
    2021-02-18 22:52

    I don't think that Qt has a built-in function, but if Boost is an option, you can use Boost.Filesystem's name_check functions.

    If Boost isn't an option, its page on name_check functions is still a good overview of what to check for on various platforms.

提交回复
热议问题