如何验证(在MS VS 2013中的Visual C ++中)字符串内容是否适合文件夹的完全限定路径或文件夹的相对限定路径?我有以下代码:
int _tmain(int argc, _TCHAR* argv[])
{
// If command line contains a path to folder:
if (argc == 2)
{
string folderPath = argv[1];
// If this path doesn't exceed 248 characters:
if (folderPath.size() <= MAX_PATH - 12)
{
/*
Here I must verify that the value of folderPath string variable
fits to fully qualified or relative qualified path to folder.
*/
}
}
return 0;
}
Visual C ++中是否有任何函数可以验证folderPath字符串变量的值是否适合文件夹的完全或相对限定路径?我的应用程序是没有MFC支持的C ++控制台应用程序,我不使用BOOST。在我的应用程序中,我使用多字节字符集但不使用unicode。我非常感谢你的帮助。