1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmDocumentationFormatterUsage.cxx,v $
6 Date: $Date: 2007-10-22 16:48:39 $
7 Version: $Revision: 1.4 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
18 #include "cmDocumentationFormatterUsage.h"
19 #include "cmDocumentationSection.h"
21 cmDocumentationFormatterUsage::cmDocumentationFormatterUsage()
22 :cmDocumentationFormatterText()
26 void cmDocumentationFormatterUsage
27 ::PrintSection(std::ostream
& os
,
28 const cmDocumentationSection
§ion
,
36 const std::vector
<cmDocumentationEntry
> &entries
=
38 for(std::vector
<cmDocumentationEntry
>::const_iterator op
= entries
.begin();
39 op
!= entries
.end(); ++op
)
43 os
<< " " << op
->Name
;
44 this->TextIndent
= " ";
45 int align
= static_cast<int>(strlen(this->TextIndent
))-4;
46 for(int i
= static_cast<int>(op
->Name
.size()); i
< align
; ++i
)
50 if (op
->Name
.size() > strlen(this->TextIndent
)-4 )
53 os
.write(this->TextIndent
, strlen(this->TextIndent
)-2);
56 this->PrintColumn(os
, op
->Brief
.c_str());
62 this->TextIndent
= "";
63 this->PrintFormatted(os
, op
->Brief
.c_str());