Convert some raw loops to cmWrap.

This commit is contained in:
Stephen Kelly 2015-02-18 22:14:26 +01:00
parent 37b88d348a
commit 416df93aa9
5 changed files with 9 additions and 32 deletions

View File

@ -705,10 +705,7 @@ void cmComputeLinkDepends::DisplayConstraintGraph()
{ {
EdgeList const& nl = this->EntryConstraintGraph[i]; EdgeList const& nl = this->EntryConstraintGraph[i];
e << "item " << i << " is [" << this->EntryList[i].Item << "]\n"; e << "item " << i << " is [" << this->EntryList[i].Item << "]\n";
for(EdgeList::const_iterator j = nl.begin(); j != nl.end(); ++j) e << cmWrap(" item ", nl, " must follow it", "\n") << "\n";
{
e << " item " << *j << " must follow it\n";
}
} }
fprintf(stderr, "%s\n", e.str().c_str()); fprintf(stderr, "%s\n", e.str().c_str());
} }

View File

@ -683,11 +683,9 @@ void cmCoreTryCompile::FindOutputFile(const std::string& targetName)
std::ostringstream emsg; std::ostringstream emsg;
emsg << "Unable to find the executable at any of:\n"; emsg << "Unable to find the executable at any of:\n";
for (unsigned int i = 0; i < searchDirs.size(); ++i) emsg << cmWrap(" " + this->BinaryDirectory,
{ searchDirs,
emsg << " " << this->BinaryDirectory << searchDirs[i] tmpOutputFile, "\n") << "\n";
<< tmpOutputFile << "\n";
}
this->FindErrorMessage = emsg.str(); this->FindErrorMessage = emsg.str();
return; return;
} }

View File

@ -355,11 +355,7 @@ void cmFindBase::PrintFindStuff()
std::cerr << "SearchPathSuffixes "; std::cerr << "SearchPathSuffixes ";
std::cerr << cmJoin(this->SearchPathSuffixes, "\n") << "\n"; std::cerr << cmJoin(this->SearchPathSuffixes, "\n") << "\n";
std::cerr << "SearchPaths\n"; std::cerr << "SearchPaths\n";
for(std::vector<std::string>::const_iterator i = this->SearchPaths.begin(); std::cerr << cmWrap("[", this->SearchPaths, "]", "\n") << "\n";
i != this->SearchPaths.end(); ++i)
{
std::cerr << "[" << *i << "]\n";
}
} }
bool cmFindBase::CheckForVariableInCache() bool cmFindBase::CheckForVariableInCache()

View File

@ -329,10 +329,7 @@ bool cmFindPackageCommand
{ {
std::ostringstream e; std::ostringstream e;
e << "called with components that are both required and optional:\n"; e << "called with components that are both required and optional:\n";
for(unsigned int i=0; i<doubledComponents.size(); ++i) e << cmWrap(" ", doubledComponents, "", "\n") << "\n";
{
e << " " << doubledComponents[i] << "\n";
}
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
} }
@ -808,13 +805,8 @@ bool cmFindPackageCommand::HandlePackageMode()
{ {
e << "Could not find a package configuration file provided by \"" e << "Could not find a package configuration file provided by \""
<< this->Name << "\"" << requestedVersionString << this->Name << "\"" << requestedVersionString
<< " with any of the following names:\n"; << " with any of the following names:\n"
for(std::vector<std::string>::const_iterator ci = << cmWrap(" ", this->Configs, "", "\n") << "\n";
this->Configs.begin();
ci != this->Configs.end(); ++ci)
{
e << " " << *ci << "\n";
}
} }
e << "Add the installation prefix of \"" << this->Name << "\" to " e << "Add the installation prefix of \"" << this->Name << "\" to "

View File

@ -213,13 +213,7 @@ cmMakefile::~cmMakefile()
void cmMakefile::PrintStringVector(const char* s, void cmMakefile::PrintStringVector(const char* s,
const std::vector<std::string>& v) const const std::vector<std::string>& v) const
{ {
std::cout << s << ": ( \n"; std::cout << s << ": ( \n" << cmWrap('"', v, '"', " ") << ")\n";
for(std::vector<std::string>::const_iterator i = v.begin();
i != v.end(); ++i)
{
std::cout << *i << " ";
}
std::cout << " )\n";
} }
void cmMakefile void cmMakefile