paysages3d/src/system/FileSystem.cpp

23 lines
533 B
C++
Raw Normal View History

2014-08-21 07:58:11 +00:00
#include "FileSystem.h"
#include <QDir>
#include <QFileInfo>
#include <cstdio>
2014-08-21 07:58:11 +00:00
2015-12-10 23:36:50 +00:00
string FileSystem::getTempFile(const string &filename) {
2014-08-21 07:58:11 +00:00
return QDir::temp().filePath(QString::fromStdString(filename)).toStdString();
}
2015-12-10 23:36:50 +00:00
bool FileSystem::isFile(const string &filepath) {
return QFileInfo(QString::fromStdString(filepath)).exists();
}
2015-12-10 23:36:50 +00:00
bool FileSystem::removeFile(const string &filepath) {
if (FileSystem::isFile(filepath)) {
remove(filepath.c_str());
return true;
} else {
return false;
}
}