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

Method RegexFromLiteral

Source/cmFindLibraryCommand.cxx:341–357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

339}
340
341void cmFindLibraryHelper::RegexFromLiteral(std::string& out,
342 std::string const& in,
343 cmSystemTools::DirCase dirCase)
344{
345 for (char ch : in) {
346 if (ch == '[' || ch == ']' || ch == '(' || ch == ')' || ch == '\\' ||
347 ch == '.' || ch == '*' || ch == '+' || ch == '?' || ch == '-' ||
348 ch == '^' || ch == '$') {
349 out += "\\";
350 }
351 if (dirCase == cmSystemTools::DirCase::Insensitive) {
352 out += static_cast<char>(cmsysString_tolower(ch));
353 } else {
354 out += ch;
355 }
356 }
357}
358
359void cmFindLibraryHelper::RegexFromList(std::string& out, cmList const& in,
360 cmSystemTools::DirCase dirCase)

Callers 2

RegexFromListMethod · 0.95
AddNameMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected