forked from AttorneyOnline/AO2-Client
- Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfile_functions.cpp
More file actions
Latest commit
28 lines (22 loc) · 464 Bytes
/
Copy pathfile_functions.cpp
File metadata and controls
28 lines (22 loc) · 464 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include<QFileInfo>
#include<QDir>
#include"file_functions.h"
boolfile_exists(QString file_path)
{
QFileInfo check_file(file_path);
return check_file.exists() && check_file.isFile();
}
QString file_exists(QString file_path, QVector<QString> p_exts)
{
for(auto &ext : p_exts)
{
if(file_exists(file_path + ext))
return ext;
}
return"";
}
booldir_exists(QString dir_path)
{
QDir check_dir(dir_path);
return check_dir.exists();
}