ERR: Use of stream format flags is hard to make portable. Manually implementing justification.

This commit is contained in:
Brad King 2003-02-16 11:57:20 -05:00
parent caa074e8b5
commit 7d1ee1d4c8

View File

@ -229,15 +229,16 @@ void cmDocumentation::PrintUsageSection(std::ostream& os,
const cmDocumentationEntry* section) const cmDocumentationEntry* section)
{ {
if(!section) { return; } if(!section) { return; }
long flags = static_cast<long>(os.flags());
os.setf(flags | std::ios::left);
for(const cmDocumentationEntry* op = section; op->brief; ++op) for(const cmDocumentationEntry* op = section; op->brief; ++op)
{ {
if(op->name) if(op->name)
{ {
os << " "; os << " " << op->name;
os.width(25); for(int i = static_cast<int>(strlen(op->name)); i < 25; ++i)
os << op->name << "= " << op->brief << "\n"; {
os << " ";
}
os << "= " << op->brief << "\n";
} }
else else
{ {
@ -246,7 +247,6 @@ void cmDocumentation::PrintUsageSection(std::ostream& os,
os << "\n"; os << "\n";
} }
} }
os.setf(flags);
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------