cmake/Source/cmDocumentationFormatter.h

28 lines
865 B
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. */
2021-09-14 00:13:48 +02:00
#pragma once
2017-07-20 19:35:53 +02:00
#include "cmConfigure.h" // IWYU pragma: keep
2016-10-30 18:24:19 +01:00
#include <iosfwd>
2023-05-23 16:38:00 +02:00
#include <string>
class cmDocumentationSection;
2014-08-03 19:52:23 +02:00
/** Print documentation in a simple text format. */
class cmDocumentationFormatter
{
public:
2023-05-23 16:38:00 +02:00
void SetIndent(std::size_t indent) { this->TextIndent = indent; }
void PrintFormatted(std::ostream& os, std::string const& text) const;
void PrintSection(std::ostream& os, cmDocumentationSection const& section);
2016-07-09 11:21:54 +02:00
2014-08-03 19:52:23 +02:00
private:
2023-05-23 16:38:00 +02:00
void PrintPreformatted(std::ostream& os, std::string const&) const;
void PrintParagraph(std::ostream& os, std::string const&) const;
void PrintColumn(std::ostream& os, std::string const&) const;
std::size_t TextWidth = 77u;
std::size_t TextIndent = 0u;
};