cmWIXRichTextFormatWriter.h 1015 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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
  4. #include "cmConfigure.h" // IWYU pragma: keep
  5. #include <string>
  6. #include "cmsys/FStream.hxx"
  7. /** \class cmWIXRichtTextFormatWriter
  8. * \brief Helper class to generate Rich Text Format (RTF) documents
  9. * from plain text (e.g. for license and welcome text)
  10. */
  11. class cmWIXRichTextFormatWriter
  12. {
  13. public:
  14. cmWIXRichTextFormatWriter(std::string const& filename);
  15. ~cmWIXRichTextFormatWriter();
  16. void AddText(std::string const& text);
  17. private:
  18. void WriteHeader();
  19. void WriteFontTable();
  20. void WriteColorTable();
  21. void WriteGenerator();
  22. void WriteDocumentPrefix();
  23. void ControlWord(std::string const& keyword);
  24. void NewControlWord(std::string const& keyword);
  25. void StartGroup();
  26. void EndGroup();
  27. void EmitUnicodeCodepoint(int c);
  28. void EmitUnicodeSurrogate(int c);
  29. void EmitInvalidCodepoint(int c);
  30. cmsys::ofstream File;
  31. };