cmDocumentationFormatter.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef _cmDocumentationFormatter_h
  4. #define _cmDocumentationFormatter_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include <iosfwd>
  7. /** This is just a helper class to make it build with MSVC 6.0.
  8. Actually the enums and internal classes could directly go into
  9. cmDocumentation, but then MSVC6 complains in RequestedHelpItem that
  10. cmDocumentation is an undefined type and so it doesn't know the enums.
  11. Moving the enums to a class which is then already completely parsed helps
  12. against this. */
  13. class cmDocumentationEnums
  14. {
  15. public:
  16. /** Types of help provided. */
  17. enum Type
  18. {
  19. None,
  20. Version,
  21. Usage,
  22. Help,
  23. Full,
  24. ListManuals,
  25. ListCommands,
  26. ListModules,
  27. ListProperties,
  28. ListVariables,
  29. ListPolicies,
  30. ListGenerators,
  31. OneManual,
  32. OneCommand,
  33. OneModule,
  34. OneProperty,
  35. OneVariable,
  36. OnePolicy,
  37. OldCustomModules
  38. };
  39. };
  40. class cmDocumentationSection;
  41. /** Print documentation in a simple text format. */
  42. class cmDocumentationFormatter
  43. {
  44. public:
  45. cmDocumentationFormatter();
  46. virtual ~cmDocumentationFormatter();
  47. void PrintFormatted(std::ostream& os, const char* text);
  48. virtual void PrintSection(std::ostream& os,
  49. cmDocumentationSection const& section);
  50. virtual void PrintPreformatted(std::ostream& os, const char* text);
  51. virtual void PrintParagraph(std::ostream& os, const char* text);
  52. void PrintColumn(std::ostream& os, const char* text);
  53. void SetIndent(const char* indent);
  54. private:
  55. int TextWidth;
  56. const char* TextIndent;
  57. };
  58. #endif