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

Function SafeName

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

Source from the content-addressed store, hash-verified

789namespace
790{
791wxString SafeName(wxString name)
792{
793 static const std::unordered_set<wxChar> invalidChars {
794 L'/', L'\\', L':', L'*', L'?', L'"', L'\'', L'<', L'>', L'|', L'@',
795 L'&', '$', L'%', L'^', L';', L'~', L'`', L'[', L']', L'{', L'}',
796 };
797
798 for (size_t i = 0; i < name.length(); ++i)
799 {
800 if (invalidChars.find(name[i]) != invalidChars.end())
801 name[i] = wxT('_');
802 }
803
804 return name;
805}
806} // namespace
807
808wxString

Callers 1

MakeSafeFilePathFunction · 0.85

Calls 3

lengthMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected