MCPcopy Create free account
hub / github.com/MITK/MITK / GetSafeName

Function GetSafeName

Modules/Segmentation/cmdapps/ContoursToImage.cpp:49–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49std::string GetSafeName(const mitk::IPropertyProvider* propertyProvider)
50{
51 std::string name;
52
53 if (propertyProvider != nullptr)
54 {
55 name = propertyProvider->GetConstProperty("name")->GetValueAsString();
56
57 if (!name.empty())
58 {
59 boost::trim(name);
60 boost::replace_all(name, "/", "_");
61 boost::replace_all(name, "\\", "_");
62
63 // If you read this, feel free to handle invalid filename characters here. :)
64 }
65 }
66
67 return name;
68}
69
70void CreateParentDirectories(const fs::path& path)
71{

Callers 1

mainFunction · 0.85

Calls 3

GetValueAsStringMethod · 0.45
GetConstPropertyMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected