cmWIXRichTextFormatWriter.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 <cmsys/FStream.hxx>
  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(std::string const& filename);
  21. ~cmWIXRichTextFormatWriter();
  22. void AddText(std::string const& text);
  23. private:
  24. void WriteHeader();
  25. void WriteFontTable();
  26. void WriteColorTable();
  27. void WriteGenerator();
  28. void WriteDocumentPrefix();
  29. void ControlWord(std::string const& keyword);
  30. void NewControlWord(std::string const& keyword);
  31. void StartGroup();
  32. void EndGroup();
  33. void EmitUnicodeCodepoint(int c);
  34. void EmitUnicodeSurrogate(int c);
  35. void EmitInvalidCodepoint(int c);
  36. cmsys::ofstream File;
  37. };
  38. #endif