mirror of
https://github.com/reactos/CMake.git
synced 2025-03-03 09:27:12 +00:00
cmSystemTool: Let EscapeQuotes accept a cm::string_view
This commit is contained in:
parent
ad3183db8c
commit
2c5454f227
@ -176,15 +176,15 @@ void cmSystemTools::ExpandRegistryValues(std::string& source,
|
||||
}
|
||||
#endif
|
||||
|
||||
std::string cmSystemTools::EscapeQuotes(const std::string& str)
|
||||
std::string cmSystemTools::EscapeQuotes(cm::string_view str)
|
||||
{
|
||||
std::string result;
|
||||
result.reserve(str.size());
|
||||
for (const char* ch = str.c_str(); *ch != '\0'; ++ch) {
|
||||
if (*ch == '"') {
|
||||
for (const char ch : str) {
|
||||
if (ch == '"') {
|
||||
result += '\\';
|
||||
}
|
||||
result += *ch;
|
||||
result += ch;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ public:
|
||||
KeyWOW64 view = KeyWOW64_Default);
|
||||
|
||||
//! Escape quotes in a string.
|
||||
static std::string EscapeQuotes(const std::string& str);
|
||||
static std::string EscapeQuotes(cm::string_view str);
|
||||
|
||||
/** Map help document name to file name. */
|
||||
static std::string HelpFileName(std::string);
|
||||
|
Loading…
x
Reference in New Issue
Block a user