STYLE: Nightly Date Stamp
[cmake.git] / Source / cmDocumentationFormatter.h
blobac90dfea7cc36c3f53f0cfd2f4b61249b41d3d3f
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmDocumentationFormatter.h,v $
5 Language: C++
6 Date: $Date: 2008-05-05 16:02:36 $
7 Version: $Revision: 1.9 $
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 =========================================================================*/
17 #ifndef _cmDocumentationFormatter_h
18 #define _cmDocumentationFormatter_h
20 #include "cmStandardIncludes.h"
22 /** This is just a helper class to make it build with MSVC 6.0.
23 Actually the enums and internal classes could directly go into
24 cmDocumentation, but then MSVC6 complains in RequestedHelpItem that
25 cmDocumentation is an undefined type and so it doesn't know the enums.
26 Moving the enums to a class which is then already completely parsed helps
27 against this. */
28 class cmDocumentationEnums
30 public:
31 /** Types of help provided. */
32 enum Type
33 { None, Usage, Single, SingleModule, SingleProperty, SingleVariable,
34 List, ModuleList, PropertyList, VariableList,
35 Full, Properties, Variables, Modules, CustomModules, Commands,
36 CompatCommands, Copyright, Version, Policies, SinglePolicy };
38 /** Forms of documentation output. */
39 enum Form { TextForm, HTMLForm, ManForm, UsageForm, DocbookForm };
42 class cmDocumentationSection;
44 /** Base class for printing the documentation in the various supported
45 formats. */
46 class cmDocumentationFormatter
48 public:
49 cmDocumentationFormatter();
50 virtual ~cmDocumentationFormatter();
51 void PrintFormatted(std::ostream& os, const char* text);
53 virtual cmDocumentationEnums::Form GetForm() const = 0;
55 virtual void PrintHeader(const char* /*name*/, std::ostream& /*os*/) {}
56 virtual void PrintFooter(std::ostream& /*os*/) {}
57 virtual void PrintSection(std::ostream& os,
58 const cmDocumentationSection& section,
59 const char* name) = 0;
60 virtual void PrintPreformatted(std::ostream& os, const char* text) = 0;
61 virtual void PrintParagraph(std::ostream& os, const char* text) = 0;
62 virtual void PrintIndex(std::ostream& ,
63 std::vector<const cmDocumentationSection *>&)
66 /** Compute a prefix for links into a section (#<prefix>_SOMETHING). */
67 std::string ComputeSectionLinkPrefix(std::string const& name);
70 #endif