2007-09-19 17:05:28 +04:00
|
|
|
/*=========================================================================
|
|
|
|
|
|
|
|
Program: CMake - Cross-Platform Makefile Generator
|
|
|
|
Module: $RCSfile$
|
|
|
|
Language: C++
|
|
|
|
Date: $Date$
|
|
|
|
Version: $Revision$
|
|
|
|
|
|
|
|
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
|
|
|
|
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
|
|
|
|
|
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
PURPOSE. See the above copyright notices for more information.
|
|
|
|
|
|
|
|
=========================================================================*/
|
|
|
|
|
|
|
|
#include "cmDocumentationFormatterUsage.h"
|
|
|
|
|
|
|
|
cmDocumentationFormatterUsage::cmDocumentationFormatterUsage()
|
|
|
|
:cmDocumentationFormatterText()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void cmDocumentationFormatterUsage::PrintSection(std::ostream& os,
|
|
|
|
const cmDocumentationEntry* section,
|
|
|
|
const char* name)
|
|
|
|
{
|
|
|
|
if(name)
|
|
|
|
{
|
|
|
|
os << name << "\n";
|
|
|
|
}
|
|
|
|
if(!section) { return; }
|
2007-10-09 22:35:25 +04:00
|
|
|
for(const cmDocumentationEntry* op = section; op->brief; ++op)
|
2007-09-19 17:05:28 +04:00
|
|
|
{
|
2007-10-09 22:35:25 +04:00
|
|
|
if(op->name)
|
2007-09-19 17:05:28 +04:00
|
|
|
{
|
|
|
|
os << " " << op->name;
|
|
|
|
this->TextIndent = " ";
|
|
|
|
int align = static_cast<int>(strlen(this->TextIndent))-4;
|
2007-10-09 22:35:25 +04:00
|
|
|
for(int i = static_cast<int>(strlen(op->name)); i < align; ++i)
|
2007-09-19 17:05:28 +04:00
|
|
|
{
|
|
|
|
os << " ";
|
|
|
|
}
|
2007-10-09 22:35:25 +04:00
|
|
|
if ( strlen(op->name) > strlen(this->TextIndent)-4 )
|
2007-09-19 17:05:28 +04:00
|
|
|
{
|
|
|
|
os << "\n";
|
|
|
|
os.write(this->TextIndent, strlen(this->TextIndent)-2);
|
|
|
|
}
|
|
|
|
os << "= ";
|
2007-10-09 22:35:25 +04:00
|
|
|
this->PrintColumn(os, op->brief);
|
2007-09-19 17:05:28 +04:00
|
|
|
os << "\n";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
os << "\n";
|
|
|
|
this->TextIndent = "";
|
2007-10-09 22:35:25 +04:00
|
|
|
this->PrintFormatted(os, op->brief);
|
2007-09-19 17:05:28 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
os << "\n";
|
|
|
|
}
|
|
|
|
|