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

Method setFile

src/Base/FileInfo.cpp:183–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183void FileInfo::setFile(std::string name)
184{
185 if (name.empty()) {
186 FileName.clear();
187 return;
188 }
189
190 FileName = std::move(name);
191
192 // keep the UNC paths intact
193 if (FileName.substr(0, 2) == std::string("\\\\")) {
194 std::replace(FileName.begin() + 2, FileName.end(), '\\', '/');
195 }
196 else {
197 std::replace(FileName.begin(), FileName.end(), '\\', '/');
198 }
199}
200
201std::string FileInfo::filePath() const
202{

Callers 15

setFileNameMethod · 0.45
loadUrlsMethod · 0.45
saveAsMethod · 0.45
sExportMethod · 0.45
extensionMethod · 0.45
openInternalMethod · 0.45
openVRMLMethod · 0.45
pixmapFromSvgMethod · 0.45
getSaveFileNameMethod · 0.45
loadMethod · 0.45
FileInfoTestMethod · 0.45
TEST_FFunction · 0.45

Calls 7

replaceFunction · 0.85
substrMethod · 0.80
moveFunction · 0.70
emptyMethod · 0.45
clearMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected