MCPcopy Create free account
hub / github.com/cafali/SnapKey / RestoreConfigFromBackup

Function RestoreConfigFromBackup

SnapKey.cpp:358–367  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

356}
357
358void RestoreConfigFromBackup(const std::string& backupFilename, const std::string& destinationFilename) {
359 std::string sourcePath = "meta\\" + backupFilename;
360 std::string destinationPath = destinationFilename;
361
362 if (CopyFile(sourcePath.c_str(), destinationPath.c_str(), FALSE)) {
363 MessageBox(NULL, TEXT("Default config restored from backup successfully."), TEXT("SnapKey"), MB_ICONINFORMATION | MB_OK);
364 } else {
365 MessageBox(NULL, TEXT("Failed to restore config from backup."), TEXT("SnapKey Error"), MB_ICONERROR | MB_OK);
366 }
367}
368
369void CreateDefaultConfig(const std::string& filename) {
370 RestoreConfigFromBackup("backup.snapkey", filename);

Callers 1

CreateDefaultConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected