cmake/Source/cmDocumentationFormatter.h

67 lines
1.7 KiB
C
Raw Normal View History

2016-10-30 18:24:19 +01:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#ifndef _cmDocumentationFormatter_h
#define _cmDocumentationFormatter_h
2017-07-20 19:35:53 +02:00
#include "cmConfigure.h" // IWYU pragma: keep
2016-10-30 18:24:19 +01:00
#include <iosfwd>
/** This is just a helper class to make it build with MSVC 6.0.
Actually the enums and internal classes could directly go into
2012-02-18 12:40:36 +02:00
cmDocumentation, but then MSVC6 complains in RequestedHelpItem that
cmDocumentation is an undefined type and so it doesn't know the enums.
Moving the enums to a class which is then already completely parsed helps
against this. */
class cmDocumentationEnums
{
public:
/** Types of help provided. */
2012-02-18 12:40:36 +02:00
enum Type
2014-08-03 19:52:23 +02:00
{
2016-07-09 11:21:54 +02:00
None,
Version,
Usage,
Help,
Full,
ListManuals,
ListCommands,
ListModules,
ListProperties,
ListVariables,
ListPolicies,
ListGenerators,
OneManual,
OneCommand,
OneModule,
OneProperty,
OneVariable,
OnePolicy,
2014-08-03 19:52:23 +02:00
OldCustomModules
};
};
class cmDocumentationSection;
2014-08-03 19:52:23 +02:00
/** Print documentation in a simple text format. */
class cmDocumentationFormatter
{
public:
cmDocumentationFormatter();
virtual ~cmDocumentationFormatter();
void PrintFormatted(std::ostream& os, const char* text);
virtual void PrintSection(std::ostream& os,
2014-08-03 19:52:23 +02:00
cmDocumentationSection const& section);
virtual void PrintPreformatted(std::ostream& os, const char* text);
virtual void PrintParagraph(std::ostream& os, const char* text);
void PrintColumn(std::ostream& os, const char* text);
void SetIndent(const char* indent);
2016-07-09 11:21:54 +02:00
2014-08-03 19:52:23 +02:00
private:
int TextWidth;
const char* TextIndent;
};
#endif