MCPcopy Create free account
hub / github.com/Kitware/CMake / CreateSafeObjectFileName

Method CreateSafeObjectFileName

Source/cmLocalGenerator.cxx:4167–4186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4165}
4166
4167std::string cmLocalGenerator::CreateSafeObjectFileName(
4168 std::string const& sin) const
4169{
4170 // Start with the original name.
4171 std::string ssin = sin;
4172
4173 // Avoid full paths by removing leading slashes.
4174 ssin.erase(0, ssin.find_first_not_of('/'));
4175
4176 // Avoid full paths by removing colons.
4177 std::replace(ssin.begin(), ssin.end(), ':', '_');
4178
4179 // Avoid relative paths that go up the tree.
4180 cmSystemTools::ReplaceString(ssin, "../", "__/");
4181
4182 // Avoid spaces.
4183 std::replace(ssin.begin(), ssin.end(), ' ', '_');
4184
4185 return ssin;
4186}
4187
4188void cmLocalGenerator::ComputeSourceGroupSearchIndex()
4189{

Calls 4

eraseMethod · 0.80
find_first_not_ofMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected