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

Function RegexQuote

Source/cmStringCommand.cxx:290–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288}
289
290bool RegexQuote(std::vector<std::string> const& args,
291 cmExecutionStatus& status)
292{
293 //"STRING(REGEX QUOTE <output variable> <input> [<input>...]\n"
294 std::string const& outvar = args[2];
295 cm::CMakeString data{ cmMakeRange(args).advance(3) };
296
297 try {
298 // Escape all regex special characters
299 data.Quote();
300 // Store the output in the provided variable.
301 status.GetMakefile().AddDefinition(outvar, data);
302 return true;
303 } catch (std::exception const& e) {
304 status.SetError(
305 cmStrCat("sub-command REGEX, mode QUOTE: ", e.what(), '.'));
306 return false;
307 }
308}
309
310bool HandleFindCommand(std::vector<std::string> const& args,
311 cmExecutionStatus& status)

Callers 1

HandleRegexCommandFunction · 0.85

Calls 8

cmMakeRangeFunction · 0.85
cmStrCatFunction · 0.70
advanceMethod · 0.45
QuoteMethod · 0.45
AddDefinitionMethod · 0.45
GetMakefileMethod · 0.45
SetErrorMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…