MXS-1220: Deprecate whitespace in object names

All whitespace in object names is now converted to a compacted format with
whitespace replaced with hyphens. If a conversion takes place, a warning
is logged.

Converted some of the tests into C++ as they directly include .cc files.
This commit is contained in:
Markus Mäkelä
2017-04-17 19:44:37 +03:00
committed by Markus Mäkelä
parent aa16980cec
commit 47c1e9d533
4 changed files with 82 additions and 7 deletions

View File

@ -490,6 +490,22 @@ char* trim(char *str)
return str;
}
/**
* @brief Replace whitespace with hyphens
*
* @param str String to replace
*/
void replace_whitespace(char* str)
{
for (char* s = str; *s; s++)
{
if (isspace(*s))
{
*s = '-';
}
}
}
/**
* Replace all whitespace with spaces and squeeze repeating whitespace characters
*