MCPcopy Create free account
hub / github.com/LunarG/VulkanTools / Backup

Method Backup

vkconfig_core/path.cpp:192–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192bool Path::Backup() const {
193 if (this->IsFile()) {
194 QFile file(this->AbsolutePath().c_str());
195
196 QDateTime date_time = QDateTime::currentDateTime();
197 std::string date = date_time.toString(Qt::ISODate).toStdString();
198 std::replace(date.begin(), date.end(), ':', '-');
199
200 std::string path = this->AbsolutePath();
201 std::string extension = path.substr(path.find_last_of("."));
202 std::string prefix = path.substr(0, path.find_last_of("."));
203 //"vkconfig-" + date_time.toString(Qt::ISODate).toStdString() + ".json";
204
205 std::string dest = prefix + "-" + date + extension;
206
207 bool result = file.copy(dest.c_str());
208 return result;
209 } else {
210 return false;
211 }
212}
213
214bool Path::Remove() const {
215 if (!this->Exists()) {

Callers 1

ResetMethod · 0.80

Calls 2

IsFileMethod · 0.95
AbsolutePathMethod · 0.95

Tested by

no test coverage detected