summaryrefslogtreecommitdiffstats
path: root/Source/cmStringCommand.h
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-10-17 13:10:20 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-10-17 13:10:20 (GMT)
commit6e5cdd6de72de0d9d8f91c9971f0c13e10511c73 (patch)
tree03b8912732fb9070de978fc883cfb8e70ade305d /Source/cmStringCommand.h
parent33ac18891ff73863b088ca3f373eb90620637c11 (diff)
downloadCMake-6e5cdd6de72de0d9d8f91c9971f0c13e10511c73.zip
CMake-6e5cdd6de72de0d9d8f91c9971f0c13e10511c73.tar.gz
CMake-6e5cdd6de72de0d9d8f91c9971f0c13e10511c73.tar.bz2
ENH: Add regular string replace (not regex), and relative path command. Also add tests
Diffstat (limited to 'Source/cmStringCommand.h')
-rw-r--r--Source/cmStringCommand.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/cmStringCommand.h b/Source/cmStringCommand.h
index 91463c4..cbdf811 100644
--- a/Source/cmStringCommand.h
+++ b/Source/cmStringCommand.h
@@ -71,6 +71,9 @@ public:
" STRING(REGEX REPLACE <regular_expression>\n"
" <replace_expression> <output variable>\n"
" <input> [<input>...])\n"
+ " STRING(REPLACE <match_expression>\n"
+ " <replace_expression> <output variable>\n"
+ " <input> [<input>...])\n"
" STRING(COMPARE EQUAL <string1> <string2> <output variable>)\n"
" STRING(COMPARE NOTEQUAL <string1> <string2> <output variable>)\n"
" STRING(COMPARE LESS <string1> <string2> <output variable>)\n"
@@ -90,6 +93,12 @@ public:
"subexpressions of the match using \\1, \\2, ..., \\9. Note that "
"two backslashes (\\\\1) are required in CMake code to get a "
"backslash through argument parsing.\n"
+ "REPLACE will match the given expression "
+ "and substitute the replacement expression for the match "
+ "in the output. The replace expression may refer to paren-delimited "
+ "subexpressions of the match using \\1, \\2, ..., \\9. Note that "
+ "two backslashes (\\\\1) are required in CMake code to get a "
+ "backslash through argument parsing.\n"
"COMPARE EQUAL/NOTEQUAL/LESS/GREATER will compare the strings and "
"store true or false in the output variable.\n"
"ASCII will convert all numbers into corresponding ASCII characters.\n"
@@ -108,6 +117,7 @@ protected:
bool RegexReplace(std::vector<std::string> const& args);
bool HandleToUpperLowerCommand(std::vector<std::string> const& args, bool toUpper);
bool HandleCompareCommand(std::vector<std::string> const& args);
+ bool HandleReplaceCommand(std::vector<std::string> const& args);
class RegexReplacement
{