summaryrefslogtreecommitdiffstats
path: root/Source/cmDocumentationFormatterText.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2007-10-22 16:49:09 (GMT)
committerKen Martin <ken.martin@kitware.com>2007-10-22 16:49:09 (GMT)
commit6cdf03250568c2150094cddfb6542945903b41a1 (patch)
treed2180686ef12105d6855203eded0505775b507ab /Source/cmDocumentationFormatterText.cxx
parentcfb84d8562646662cfee9622f657e8eacdd49f8c (diff)
downloadCMake-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/cmDocumentationFormatterText.cxx')
-rw-r--r--Source/cmDocumentationFormatterText.cxx30
1 files changed, 16 insertions, 14 deletions
diff --git a/Source/cmDocumentationFormatterText.cxx b/Source/cmDocumentationFormatterText.cxx
index 4ab2695..ca22166 100644
--- a/Source/cmDocumentationFormatterText.cxx
+++ b/Source/cmDocumentationFormatterText.cxx
@@ -16,6 +16,7 @@
=========================================================================*/
#include "cmDocumentationFormatterText.h"
+#include "cmDocumentationSection.h"
cmDocumentationFormatterText::cmDocumentationFormatterText()
:cmDocumentationFormatter()
@@ -24,9 +25,10 @@ cmDocumentationFormatterText::cmDocumentationFormatterText()
{
}
-void cmDocumentationFormatterText::PrintSection(std::ostream& os,
- const cmDocumentationEntry* section,
- const char* name)
+void cmDocumentationFormatterText
+::PrintSection(std::ostream& os,
+ const cmDocumentationSection &section,
+ const char* name)
{
if(name)
{
@@ -35,27 +37,27 @@ void cmDocumentationFormatterText::PrintSection(std::ostream& os,
"---------------------------------------\n";
os << name << "\n\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())
{
- if(op->name[0])
- {
- os << " " << op->name << "\n";
- }
+ os << " " << op->Name << "\n";
this->TextIndent = " ";
- this->PrintFormatted(os, op->brief);
- if(op->full)
+ this->PrintFormatted(os, op->Brief.c_str());
+ if(op->Full.size())
{
os << "\n";
- this->PrintFormatted(os, op->full);
+ this->PrintFormatted(os, op->Full.c_str());
}
}
else
{
this->TextIndent = "";
- this->PrintFormatted(os, op->brief);
+ this->PrintFormatted(os, op->Brief.c_str());
}
os << "\n";
}