diff options
author | Ken Martin <ken.martin@kitware.com> | 2007-10-22 16:49:09 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2007-10-22 16:49:09 (GMT) |
commit | 6cdf03250568c2150094cddfb6542945903b41a1 (patch) | |
tree | d2180686ef12105d6855203eded0505775b507ab /Source/cmDocumentationFormatterUsage.cxx | |
parent | cfb84d8562646662cfee9622f657e8eacdd49f8c (diff) | |
download | CMake-6cdf03250568c2150094cddfb6542945903b41a1.zip CMake-6cdf03250568c2150094cddfb6542945903b41a1.tar.gz CMake-6cdf03250568c2150094cddfb6542945903b41a1.tar.bz2 |
ENH: change to make the documentation class more generic, about halfway there, also provides secitons for Variables now
Diffstat (limited to 'Source/cmDocumentationFormatterUsage.cxx')
-rw-r--r-- | Source/cmDocumentationFormatterUsage.cxx | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/Source/cmDocumentationFormatterUsage.cxx b/Source/cmDocumentationFormatterUsage.cxx index d5f315a..91929da 100644 --- a/Source/cmDocumentationFormatterUsage.cxx +++ b/Source/cmDocumentationFormatterUsage.cxx @@ -16,46 +16,51 @@ =========================================================================*/ #include "cmDocumentationFormatterUsage.h" +#include "cmDocumentationSection.h" cmDocumentationFormatterUsage::cmDocumentationFormatterUsage() :cmDocumentationFormatterText() { } -void cmDocumentationFormatterUsage::PrintSection(std::ostream& os, - const cmDocumentationEntry* section, - const char* name) +void cmDocumentationFormatterUsage +::PrintSection(std::ostream& os, + const cmDocumentationSection §ion, + const char* name) { if(name) { os << name << "\n"; } - if(!section) { return; } - for(const cmDocumentationEntry* op = section; op->brief; ++op) + + const std::vector<cmDocumentationEntry> &entries = + section.GetEntries(); + for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin(); + op != entries.end(); ++op) { - if(op->name) + if(op->Name.size()) { - os << " " << op->name; + os << " " << op->Name; this->TextIndent = " "; int align = static_cast<int>(strlen(this->TextIndent))-4; - for(int i = static_cast<int>(strlen(op->name)); i < align; ++i) + for(int i = static_cast<int>(op->Name.size()); i < align; ++i) { os << " "; } - if ( strlen(op->name) > strlen(this->TextIndent)-4 ) + if (op->Name.size() > strlen(this->TextIndent)-4 ) { os << "\n"; os.write(this->TextIndent, strlen(this->TextIndent)-2); } os << "= "; - this->PrintColumn(os, op->brief); + this->PrintColumn(os, op->Brief.c_str()); os << "\n"; } else { os << "\n"; this->TextIndent = ""; - this->PrintFormatted(os, op->brief); + this->PrintFormatted(os, op->Brief.c_str()); } } os << "\n"; |