cmAlgorithms: Rename cmRange to cmMakeRange.

This commit is contained in:
Stephen Kelly 2015-07-18 10:45:18 +02:00 committed by Brad King
parent 265b9db7c2
commit 8ea0b81d20
14 changed files with 30 additions and 29 deletions

View File

@ -179,14 +179,14 @@ private:
}
template<typename Iter1, typename Iter2>
ContainerAlgorithms::Range<Iter1> cmRange(Iter1 begin, Iter2 end)
ContainerAlgorithms::Range<Iter1> cmMakeRange(Iter1 begin, Iter2 end)
{
return ContainerAlgorithms::Range<Iter1>(begin, end);
}
template<typename Range>
ContainerAlgorithms::Range<typename Range::const_iterator>
cmRange(Range const& range)
cmMakeRange(Range const& range)
{
return ContainerAlgorithms::Range<typename Range::const_iterator>(
range.begin(), range.end());

View File

@ -270,7 +270,7 @@ bool cmFileCommand::HandleWriteCommand(std::vector<std::string> const& args,
this->SetError(error);
return false;
}
std::string message = cmJoin(cmRange(i, args.end()), std::string());
std::string message = cmJoin(cmMakeRange(i, args.end()), std::string());
file << message;
file.close();
if(mode)

View File

@ -170,8 +170,8 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
else
{
this->VariableDocumentation += "one of the ";
this->VariableDocumentation += cmJoin(cmRange(this->Names).retreat(1),
", ");
this->VariableDocumentation +=
cmJoin(cmMakeRange(this->Names).retreat(1), ", ");
this->VariableDocumentation += " or "
+ this->Names[this->Names.size() - 1] + " libraries be found";
}

View File

@ -125,7 +125,7 @@ bool cmFunctionHelperCommand::InvokeInitialPass
std::string argvDef = cmJoin(expandedArgs, ";");
std::vector<std::string>::const_iterator eit
= expandedArgs.begin() + (this->Args.size()-1);
std::string argnDef = cmJoin(cmRange(eit, expandedArgs.end()), ";");
std::string argnDef = cmJoin(cmMakeRange(eit, expandedArgs.end()), ";");
this->Makefile->AddDefinition("ARGV", argvDef.c_str());
this->Makefile->MarkVariableAsUsed("ARGV");
this->Makefile->AddDefinition("ARGN", argnDef.c_str());

View File

@ -247,7 +247,7 @@ bool cmListCommand::HandleAppendCommand(std::vector<std::string> const& args)
{
listString += ";";
}
listString += cmJoin(cmRange(args).advance(2), ";");
listString += cmJoin(cmMakeRange(args).advance(2), ";");
this->Makefile->AddDefinition(listName, listString.c_str());
return true;
@ -361,9 +361,9 @@ bool cmListCommand
std::vector<std::string>::const_iterator remBegin = remove.begin();
std::vector<std::string>::const_iterator argsEnd =
cmRemoveMatching(varArgsExpanded, cmRange(remBegin, remEnd));
cmRemoveMatching(varArgsExpanded, cmMakeRange(remBegin, remEnd));
std::vector<std::string>::const_iterator argsBegin = varArgsExpanded.begin();
std::string value = cmJoin(cmRange(argsBegin, argsEnd), ";");
std::string value = cmJoin(cmMakeRange(argsBegin, argsEnd), ";");
this->Makefile->AddDefinition(listName, value.c_str());
return true;
}
@ -421,7 +421,7 @@ bool cmListCommand
cmRemoveDuplicates(varArgsExpanded);
std::vector<std::string>::const_iterator argsBegin =
varArgsExpanded.begin();
std::string value = cmJoin(cmRange(argsBegin, argsEnd), ";");
std::string value = cmJoin(cmMakeRange(argsBegin, argsEnd), ";");
this->Makefile->AddDefinition(listName, value.c_str());
return true;
@ -509,9 +509,9 @@ bool cmListCommand::HandleRemoveAtCommand(
std::vector<size_t>::const_iterator remBegin = removed.begin();
std::vector<std::string>::const_iterator argsEnd =
cmRemoveIndices(varArgsExpanded, cmRange(remBegin, remEnd));
cmRemoveIndices(varArgsExpanded, cmMakeRange(remBegin, remEnd));
std::vector<std::string>::const_iterator argsBegin = varArgsExpanded.begin();
std::string value = cmJoin(cmRange(argsBegin, argsEnd), ";");
std::string value = cmJoin(cmMakeRange(argsBegin, argsEnd), ";");
this->Makefile->AddDefinition(listName, value.c_str());
return true;

View File

@ -2259,7 +2259,7 @@ cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(const char* p,
std::string());
std::vector<std::string>::const_iterator compStart
= components.begin() + 1;
result += cmJoin(cmRange(compStart, compEnd), slash);
result += cmJoin(cmMakeRange(compStart, compEnd), slash);
// Only the last component can be empty to avoid double slashes.
result += slash;
result += components.back();

View File

@ -107,7 +107,7 @@ bool cmMacroHelperCommand::InvokeInitialPass
std::vector<std::string>::const_iterator eit
= expandedArgs.begin() + (this->Args.size() - 1);
std::string expandedArgn = cmJoin(cmRange(eit, expandedArgs.end()), ";");
std::string expandedArgn = cmJoin(cmMakeRange(eit, expandedArgs.end()), ";");
std::string expandedArgv = cmJoin(expandedArgs, ";");
std::vector<std::string> variables;
variables.reserve(this->Args.size() - 1);

View File

@ -1427,7 +1427,7 @@ bool cmMakefile::ParseDefineFlag(std::string const& def, bool remove)
std::remove(defs.begin(), defs.end(), define);
std::vector<std::string>::const_iterator defBegin =
defs.begin();
std::string ndefs = cmJoin(cmRange(defBegin, defEnd), ";");
std::string ndefs = cmJoin(cmMakeRange(defBegin, defEnd), ";");
// Store the new list.
this->SetProperty("COMPILE_DEFINITIONS", ndefs.c_str());

View File

@ -69,7 +69,7 @@ bool cmMessageCommand
++i;
}
std::string message = cmJoin(cmRange(i, args.end()), std::string());
std::string message = cmJoin(cmMakeRange(i, args.end()), std::string());
if (type != cmake::MESSAGE)
{

View File

@ -293,7 +293,7 @@ cmOutputConverter::ConvertToRelativePath(const std::vector<std::string>& local,
{
relative += "/";
}
relative += cmJoin(cmRange(remote).advance(common), "/");
relative += cmJoin(cmMakeRange(remote).advance(common), "/");
// Finally return the path.
return relative;

View File

@ -108,7 +108,7 @@ bool cmSetCommand
}
// collect any values into a single semi-colon separated value list
value = cmJoin(cmRange(args).advance(1).retreat(ignoreLastArgs), ";");
value = cmJoin(cmMakeRange(args).advance(1).retreat(ignoreLastArgs), ";");
if (parentScope)
{

View File

@ -319,7 +319,7 @@ bool cmStringCommand::RegexMatch(std::vector<std::string> const& args)
}
// Concatenate all the last arguments together.
std::string input = cmJoin(cmRange(args).advance(4), std::string());
std::string input = cmJoin(cmMakeRange(args).advance(4), std::string());
// Scan through the input for all matches.
std::string output;
@ -365,7 +365,7 @@ bool cmStringCommand::RegexMatchAll(std::vector<std::string> const& args)
}
// Concatenate all the last arguments together.
std::string input = cmJoin(cmRange(args).advance(4), std::string());
std::string input = cmJoin(cmMakeRange(args).advance(4), std::string());
// Scan through the input for all matches.
std::string output;
@ -465,7 +465,7 @@ bool cmStringCommand::RegexReplace(std::vector<std::string> const& args)
}
// Concatenate all the last arguments together.
std::string input = cmJoin(cmRange(args).advance(5), std::string());
std::string input = cmJoin(cmMakeRange(args).advance(5), std::string());
// Scan through the input for all matches.
std::string output;
@ -665,7 +665,7 @@ bool cmStringCommand::HandleReplaceCommand(std::vector<std::string> const&
const std::string& replaceExpression = args[2];
const std::string& variableName = args[3];
std::string input = cmJoin(cmRange(args).advance(4), std::string());
std::string input = cmJoin(cmMakeRange(args).advance(4), std::string());
cmsys::SystemTools::ReplaceString(input, matchExpression.c_str(),
replaceExpression.c_str());
@ -756,7 +756,7 @@ bool cmStringCommand::HandleAppendCommand(std::vector<std::string> const& args)
{
value = oldValue;
}
value += cmJoin(cmRange(args).advance(2), std::string());
value += cmJoin(cmMakeRange(args).advance(2), std::string());
this->Makefile->AddDefinition(variable, value.c_str());
return true;
}
@ -772,7 +772,7 @@ bool cmStringCommand
}
std::string const& variableName = args[1];
std::string value = cmJoin(cmRange(args).advance(2), std::string());
std::string value = cmJoin(cmMakeRange(args).advance(2), std::string());
this->Makefile->AddDefinition(variableName, value.c_str());
return true;

View File

@ -6674,7 +6674,7 @@ void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info,
}
std::sort(props.begin(), props.end());
std::string propsString = cmJoin(cmRange(props).retreat(1), ", ");
std::string propsString = cmJoin(cmMakeRange(props).retreat(1), ", ");
propsString += " and the " + props.back();
std::ostringstream e;

View File

@ -335,14 +335,14 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
// Echo string
else if (args[1] == "echo" )
{
std::cout << cmJoin(cmRange(args).advance(2), " ") << std::endl;
std::cout << cmJoin(cmMakeRange(args).advance(2), " ") << std::endl;
return 0;
}
// Echo string no new line
else if (args[1] == "echo_append" )
{
std::cout << cmJoin(cmRange(args).advance(2), " ");
std::cout << cmJoin(cmMakeRange(args).advance(2), " ");
return 0;
}
@ -511,7 +511,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
// Clock command
else if (args[1] == "time" && args.size() > 2)
{
std::string command = cmJoin(cmRange(args).advance(2), " ");
std::string command = cmJoin(cmMakeRange(args).advance(2), " ");
clock_t clock_start, clock_finish;
time_t time_start, time_finish;
@ -572,7 +572,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
return 1;
}
std::string command = cmWrap('"', cmRange(args).advance(3), '"', " ");
std::string command =
cmWrap('"', cmMakeRange(args).advance(3), '"', " ");
int retval = 0;
int timeout = 0;
if ( cmSystemTools::RunSingleCommand(command.c_str(), 0, 0, &retval,