Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Kitware
GitHub Repository: Kitware/CMake
Path: blob/master/Source/CPack/WiX/cmWIXRichTextFormatWriter.h
5018 views
1
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
file LICENSE.rst or https://cmake.org/licensing for details. */
3
#pragma once
4
5
#include "cmConfigure.h" // IWYU pragma: keep
6
7
#include <string>
8
9
#include "cmsys/FStream.hxx"
10
11
/** \class cmWIXRichtTextFormatWriter
12
* \brief Helper class to generate Rich Text Format (RTF) documents
13
* from plain text (e.g. for license and welcome text)
14
*/
15
class cmWIXRichTextFormatWriter
16
{
17
public:
18
cmWIXRichTextFormatWriter(std::string const& filename);
19
~cmWIXRichTextFormatWriter();
20
21
void AddText(std::string const& text);
22
23
private:
24
void WriteHeader();
25
void WriteFontTable();
26
void WriteColorTable();
27
void WriteGenerator();
28
29
void WriteDocumentPrefix();
30
31
void ControlWord(std::string const& keyword);
32
void NewControlWord(std::string const& keyword);
33
34
void StartGroup();
35
void EndGroup();
36
37
void EmitUnicodeCodepoint(int c);
38
void EmitUnicodeSurrogate(int c);
39
40
void EmitInvalidCodepoint(int c);
41
42
cmsys::ofstream File;
43
};
44
45