CMake Nightly Date Stamp
[kiteware-cmake.git] / Source / cmDocumentationFormatter.h
blob77606cfbda1ddf7cae8736b5e04e295f89e9c3b0
1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
3 #pragma once
5 #include "cmConfigure.h" // IWYU pragma: keep
7 #include <cstddef>
8 #include <iosfwd>
9 #include <string>
11 class cmDocumentationSection;
13 /** Print documentation in a simple text format. */
14 class cmDocumentationFormatter
16 public:
17 std::string Format(std::string text) const;
18 void PrintSection(std::ostream& os, cmDocumentationSection const& section);
19 void PrintFormatted(std::ostream& os, std::string const& text) const
21 os << this->Format(text);
23 void SetIndent(std::size_t indent) { this->TextIndent = indent; }
25 static constexpr std::size_t TEXT_WIDTH = 77u;
27 private:
28 void PrintPreformatted(std::ostream& os, std::string const&) const;
29 void PrintParagraph(std::ostream& os, std::string const&) const;
30 void PrintColumn(std::ostream& os, std::string const&) const;
32 std::size_t TextIndent = 0u;