Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Kitware
GitHub Repository: Kitware/CMake
Path: blob/master/Source/CPack/IFW/cmCPackIFWCommon.h
5020 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 <map>
8
#include <string>
9
10
#include "cmValue.h"
11
12
class cmCPackIFWGenerator;
13
class cmXMLWriter;
14
15
/** \class cmCPackIFWCommon
16
* \brief A base class for CPack IFW generator implementation subclasses
17
*/
18
class cmCPackIFWCommon
19
{
20
public:
21
// Constructor
22
23
/**
24
* Construct Part
25
*/
26
cmCPackIFWCommon();
27
28
public:
29
// Internal implementation
30
31
cmValue GetOption(std::string const& op) const;
32
bool IsOn(std::string const& op) const;
33
bool IsSetToOff(std::string const& op) const;
34
bool IsSetToEmpty(std::string const& op) const;
35
36
/**
37
* Compare \a version with QtIFW framework version
38
*/
39
bool IsVersionLess(char const* version) const;
40
41
/**
42
* Compare \a version with QtIFW framework version
43
*/
44
bool IsVersionGreater(char const* version) const;
45
46
/**
47
* Compare \a version with QtIFW framework version
48
*/
49
bool IsVersionEqual(char const* version) const;
50
51
/** Expand the list argument containing the map of the key-value pairs.
52
* If the number of elements is odd, then the first value is used as the
53
* default value with an empty key.
54
* Any values with the same keys will be permanently overwritten.
55
*/
56
static void ExpandListArgument(std::string const& arg,
57
std::map<std::string, std::string>& argsOut);
58
59
/** Expand the list argument containing the multimap of the key-value pairs.
60
* If the number of elements is odd, then the first value is used as the
61
* default value with an empty key.
62
*/
63
static void ExpandListArgument(
64
std::string const& arg, std::multimap<std::string, std::string>& argsOut);
65
66
cmCPackIFWGenerator* Generator;
67
68
protected:
69
void WriteGeneratedByToStrim(cmXMLWriter& xout) const;
70
};
71
72
#define cmCPackIFWLogger(logType, msg) \
73
do { \
74
std::ostringstream cmCPackLog_msg; \
75
cmCPackLog_msg << msg; \
76
if (Generator) { \
77
Generator->Logger->Log(cmCPackLog::LOG_##logType, __FILE__, __LINE__, \
78
cmCPackLog_msg.str().c_str()); \
79
} \
80
} while (false)
81
82