cmDocumentationFormatter.h 2.1 KB

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