1. 错误控制;
2. 创建配置文件的文件夹;
This commit is contained in:
@ -88,3 +88,36 @@ void swap(unsigned short * a, unsigned short * b)
|
||||
*a=*b;
|
||||
*b=tmp;
|
||||
}
|
||||
|
||||
|
||||
bool createDir(QString fullPath)
|
||||
{
|
||||
QDir dir(fullPath);
|
||||
if (dir.exists()) {
|
||||
return true;
|
||||
} else {
|
||||
bool ok = dir.mkpath(fullPath);//创建多级目录
|
||||
return ok;
|
||||
}
|
||||
}
|
||||
|
||||
QList<QString> getFileInfo(QString file)
|
||||
{
|
||||
QFileInfo fileInfo = QFileInfo(file);
|
||||
|
||||
QString fileName, fileSuffix, filePath;
|
||||
filePath = fileInfo.absolutePath();//绝对路径
|
||||
fileName = fileInfo.fileName();//文件名
|
||||
fileSuffix = fileInfo.suffix();//文件后缀
|
||||
|
||||
// qDebug() << fileName <<endl
|
||||
// << fileSuffix<< endl
|
||||
// << filePath<< endl;
|
||||
|
||||
QList<QString> result;
|
||||
result.append(filePath);
|
||||
result.append(fileName);
|
||||
result.append(fileSuffix);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user