paysages3d/src/system/FileSystem.cpp
Michaël Lemaire 2b65f1d26a Refactored layers system to work better as DefinitionNode
It now features undo/redo of layer creation and removal
2015-11-20 01:07:31 +01:00

22 lines
553 B
C++

#include "FileSystem.h"
#include <QDir>
#include <QFileInfo>
#include <cstdio>
std::string FileSystem::getTempFile(const std::string &filename) {
return QDir::temp().filePath(QString::fromStdString(filename)).toStdString();
}
bool FileSystem::isFile(const std::string &filepath) {
return QFileInfo(QString::fromStdString(filepath)).exists();
}
bool FileSystem::removeFile(const std::string &filepath) {
if (FileSystem::isFile(filepath)) {
remove(filepath.c_str());
return true;
} else {
return false;
}
}