Skip to content

Commit 2f6495e

Browse files
author
Sebastian Holtermann
committed
cmSystemTools: Remove ExpandListArgument methods
1 parent f4f3c68 commit 2f6495e

File tree

2 files changed

+0
-116
lines changed

2 files changed

+0
-116
lines changed

Source/cmSystemTools.cxx

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,79 +1089,6 @@ void cmSystemTools::GlobDirs(const std::string& path,
10891089
}
10901090
}
10911091

1092-
void cmSystemTools::ExpandListArgument(cm::string_view arg,
1093-
std::vector<std::string>& argsOut,
1094-
bool emptyArgs)
1095-
{
1096-
// If argument is empty, it is an empty list.
1097-
if (!emptyArgs && arg.empty()) {
1098-
return;
1099-
}
1100-
1101-
// if there are no ; in the name then just copy the current string
1102-
if (arg.find(';') == cm::string_view::npos) {
1103-
argsOut.emplace_back(arg);
1104-
return;
1105-
}
1106-
1107-
std::string newArg;
1108-
// Break the string at non-escaped semicolons not nested in [].
1109-
int squareNesting = 0;
1110-
cm::string_view::iterator last = arg.begin();
1111-
cm::string_view::iterator const cend = arg.end();
1112-
for (cm::string_view::iterator c = last; c != cend; ++c) {
1113-
switch (*c) {
1114-
case '\\': {
1115-
// We only want to allow escaping of semicolons. Other
1116-
// escapes should not be processed here.
1117-
cm::string_view::iterator cnext = c + 1;
1118-
if ((cnext != cend) && *cnext == ';') {
1119-
newArg.append(last, c);
1120-
// Skip over the escape character
1121-
last = cnext;
1122-
c = cnext;
1123-
}
1124-
} break;
1125-
case '[': {
1126-
++squareNesting;
1127-
} break;
1128-
case ']': {
1129-
--squareNesting;
1130-
} break;
1131-
case ';': {
1132-
// Break the string here if we are not nested inside square
1133-
// brackets.
1134-
if (squareNesting == 0) {
1135-
newArg.append(last, c);
1136-
// Skip over the semicolon
1137-
last = c + 1;
1138-
if (!newArg.empty() || emptyArgs) {
1139-
// Add the last argument if the string is not empty.
1140-
argsOut.push_back(newArg);
1141-
newArg.clear();
1142-
}
1143-
}
1144-
} break;
1145-
default: {
1146-
// Just append this character.
1147-
} break;
1148-
}
1149-
}
1150-
newArg.append(last, cend);
1151-
if (!newArg.empty() || emptyArgs) {
1152-
// Add the last argument if the string is not empty.
1153-
argsOut.push_back(std::move(newArg));
1154-
}
1155-
}
1156-
1157-
std::vector<std::string> cmSystemTools::ExpandedListArgument(
1158-
cm::string_view arg, bool emptyArgs)
1159-
{
1160-
std::vector<std::string> argsOut;
1161-
ExpandListArgument(arg, argsOut, emptyArgs);
1162-
return argsOut;
1163-
}
1164-
11651092
bool cmSystemTools::SimpleGlob(const std::string& glob,
11661093
std::vector<std::string>& files,
11671094
int type /* = 0 */)

Source/cmSystemTools.h

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -28,49 +28,6 @@ class cmSystemTools : public cmsys::SystemTools
2828
typedef cmsys::SystemTools Superclass;
2929
typedef cmProcessOutput::Encoding Encoding;
3030

31-
/**
32-
* Expand the ; separated string @a arg into multiple arguments.
33-
* All found arguments are appended to @a argsOut.
34-
*/
35-
static void ExpandListArgument(cm::string_view arg,
36-
std::vector<std::string>& argsOut,
37-
bool emptyArgs = false);
38-
39-
/**
40-
* Expand out any arguments in the string range [@a first, @a last) that have
41-
* ; separated strings into multiple arguments. All found arguments are
42-
* appended to @a argsOut.
43-
*/
44-
template <class InputIt>
45-
static void ExpandLists(InputIt first, InputIt last,
46-
std::vector<std::string>& argsOut)
47-
{
48-
for (; first != last; ++first) {
49-
cmExpandList(*first, argsOut);
50-
}
51-
}
52-
53-
/**
54-
* Same as ExpandListArgument but a new vector is created containing
55-
* the expanded arguments from the string @a arg.
56-
*/
57-
static std::vector<std::string> ExpandedListArgument(cm::string_view arg,
58-
bool emptyArgs = false);
59-
60-
/**
61-
* Same as ExpandList but a new vector is created containing the expanded
62-
* versions of all arguments in the string range [@a first, @a last).
63-
*/
64-
template <class InputIt>
65-
static std::vector<std::string> ExpandedLists(InputIt first, InputIt last)
66-
{
67-
std::vector<std::string> argsOut;
68-
for (; first != last; ++first) {
69-
ExpandListArgument(*first, argsOut);
70-
}
71-
return argsOut;
72-
}
73-
7431
/**
7532
* Look for and replace registry values in a string
7633
*/

0 commit comments

Comments
 (0)