MCPcopy Create free account
hub / github.com/audacity/audacity / MakeSafeFilePath

Function MakeSafeFilePath

libraries/lib-cloud-audiocom/sync/CloudSyncDTO.cpp:808–820  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

806} // namespace
807
808wxString
809MakeSafeFilePath(const wxString& rootDir, const wxString& fileName, const wxString& fileExtension)
810{
811 const auto safeName = SafeName(fileName);
812
813 auto path = wxFileNameWrapper { rootDir, safeName, fileExtension };
814
815 int iteration = 0;
816 while (path.FileExists())
817 path.SetName(wxString::Format("%s_%d", safeName, ++iteration));
818
819 return path.GetFullPath();
820}
821
822wxString
823MakeSafeProjectPath(const wxString& rootDir, const wxString& projectName)

Callers 2

DownloadAudioMethod · 0.85
MakeSafeProjectPathFunction · 0.85

Calls 2

SafeNameFunction · 0.85
SetNameMethod · 0.45

Tested by

no test coverage detected