MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / renameFile

Method renameFile

src/Base/FileInfo.cpp:472–485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

470}
471
472bool FileInfo::renameFile(const char* NewName)
473{
474 try {
475 fs::path old_path = stringToPath(FileName);
476 fs::path new_path = stringToPath(NewName);
477 fs::rename(old_path, new_path);
478 FileName = NewName;
479 return true;
480 }
481 catch (const fs::filesystem_error& e) {
482 std::clog << "Error in renameFile: " << e.what() << '\n';
483 return false;
484 }
485}
486
487bool FileInfo::copyTo(const char* NewName) const
488{

Callers 9

onChangedMethod · 0.80
replaceProjectFileMethod · 0.80
applyStandardMethod · 0.80
applyTimeStampMethod · 0.80
renameFileNoEraseMethod · 0.80
setValueMethod · 0.80
CopyMethod · 0.80
PasteMethod · 0.80
TEST_FFunction · 0.80

Calls 1

whatMethod · 0.45

Tested by

no test coverage detected