48 using namespace UTILSLIB;
56 std::ifstream infile(filePath);
64 return exists(filePath.c_str());
69 bool File::copy(
const char* sourcePath,
const char* destPath)
74 std::ifstream source(sourcePath, std::ios::binary);
75 std::ofstream destination(destPath, std::ios::binary);
77 if(destination << source.rdbuf()){
86 bool File::copy(
const std::string& sourcePath,
const std::string& destPath)
88 return copy(sourcePath.c_str(), destPath.c_str());
98 return !std::rename(sourcePath, destPath);
103 bool File::rename(
const std::string& sourcePath,
const std::string& destPath)
105 return rename(sourcePath.c_str(), destPath.c_str());
116 return !std::remove(filePath);
123 return remove(filePath.c_str());
134 std::ofstream a(filePath);
143 return create(filePath.c_str());
148 #ifdef QT_CORE_LIB // QString oveloads
151 return exists(filePath.toStdString().c_str());
156 bool File::copy(
const QString& sourcePath,
const QString& destPath)
158 return copy(sourcePath.toStdString().c_str(), destPath.toStdString().c_str());
163 bool File::rename(
const QString& sourcePath,
const QString& destPath)
165 return rename(sourcePath.toStdString().c_str(), destPath.toStdString().c_str());
172 return remove(filePath.toStdString().c_str());
179 return create(filePath.toStdString().c_str());