cmWIXRichTextFormatWriter.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2012 Kitware, Inc.
  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 cmWIXRichTextFormatWriter_h
  11. #define cmWIXRichTextFormatWriter_h
  12. #include <fstream>
  13. /** \class cmWIXRichtTextFormatWriter
  14. * \brief Helper class to generate Rich Text Format (RTF) documents
  15. * from plain text (e.g. for license and welcome text)
  16. */
  17. class cmWIXRichTextFormatWriter
  18. {
  19. public:
  20. cmWIXRichTextFormatWriter(const std::string& filename);
  21. ~cmWIXRichTextFormatWriter();
  22. void AddText(const std::string& text);
  23. private:
  24. void WriteHeader();
  25. void WriteFontTable();
  26. void WriteGenerator();
  27. void WriteDocumentPrefix();
  28. void ControlWord(const std::string& keyword);
  29. void NewControlWord(const std::string& keyword);
  30. void StartGroup();
  31. void EndGroup();
  32. std::ofstream file;
  33. };
  34. #endif