| 806 | } // namespace |
| 807 | |
| 808 | wxString |
| 809 | MakeSafeFilePath(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 | |
| 822 | wxString |
| 823 | MakeSafeProjectPath(const wxString& rootDir, const wxString& projectName) |
no test coverage detected