Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Kitware
GitHub Repository: Kitware/CMake
Path: blob/master/Source/CPack/IFW/cmCPackIFWRepository.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 <string>
8
#include <vector>
9
10
#include "cmCPackIFWCommon.h"
11
12
class cmXMLWriter;
13
14
/** \class cmCPackIFWRepository
15
* \brief A remote repository to be created CPack IFW generator
16
*/
17
class cmCPackIFWRepository : public cmCPackIFWCommon
18
{
19
public:
20
// Types
21
22
enum Action
23
{
24
None,
25
Add,
26
Remove,
27
Replace
28
};
29
30
using RepositoriesVector = std::vector<cmCPackIFWRepository*>;
31
32
public:
33
// Constructor
34
35
/**
36
* Construct repository
37
*/
38
cmCPackIFWRepository();
39
40
public:
41
// Configuration
42
43
/// Internal repository name
44
std::string Name;
45
46
/// Optional update action
47
Action Update;
48
49
/// Is points to a list of available components
50
std::string Url;
51
52
/// Is points to a list that will replaced
53
std::string OldUrl;
54
55
/// Is points to a list that will replace to
56
std::string NewUrl;
57
58
/// With "0" disabling this repository
59
std::string Enabled;
60
61
/// Is used as user on a protected repository
62
std::string Username;
63
64
/// Is password to use on a protected repository
65
std::string Password;
66
67
/// Is optional string to display instead of the URL
68
std::string DisplayName;
69
70
public:
71
// Internal implementation
72
73
bool IsValid() const;
74
75
bool ConfigureFromOptions();
76
77
bool PatchUpdatesXml();
78
79
void WriteRepositoryConfig(cmXMLWriter& xout) const;
80
void WriteRepositoryUpdate(cmXMLWriter& xout) const;
81
void WriteRepositoryUpdates(cmXMLWriter& xout);
82
83
RepositoriesVector RepositoryUpdate;
84
std::string Directory;
85
};
86
87