MCPcopy Create free account
hub / github.com/ElyPrismLauncher/Launcher / overrideFolder

Function overrideFolder

launcher/FileSystem.cpp:1137–1156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1135}
1136
1137bool overrideFolder(QString overwritten_path, QString override_path)
1138{
1139 using copy_opts = fs::copy_options;
1140
1141 if (!FS::ensureFolderPathExists(overwritten_path))
1142 return false;
1143
1144 std::error_code err;
1145 fs::copy_options opt = copy_opts::recursive | copy_opts::overwrite_existing;
1146
1147 // FIXME: hello traveller! Apparently std::copy does NOT overwrite existing files on GNU libstdc++ on Windows?
1148 fs::copy(StringUtils::toStdString(override_path), StringUtils::toStdString(overwritten_path), opt, err);
1149
1150 if (err) {
1151 qCritical() << QString("Failed to apply override from %1 to %2").arg(override_path, overwritten_path);
1152 qCritical() << "Reason:" << QString::fromStdString(err.message());
1153 }
1154
1155 return err.value() == 0;
1156}
1157
1158QString getFilesystemTypeName(FilesystemType type)
1159{

Callers 2

commitStagedInstanceMethod · 0.85
createInstanceMethod · 0.85

Calls 6

ensureFolderPathExistsFunction · 0.85
copyClass · 0.85
toStdStringFunction · 0.85
fromStdStringFunction · 0.85
valueMethod · 0.80
QStringClass · 0.70

Tested by

no test coverage detected