1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
|
#pragma once
#include "StatusParagraphs.h"
#include "VcpkgCmdArguments.h"
#include "VcpkgPaths.h"
#include "VersionT.h"
#include "vcpkg_Build.h"
#include "vcpkg_Dependencies.h"
#include <array>
namespace vcpkg::Commands
{
using CommandTypeA = void (*)(const VcpkgCmdArguments& args,
const VcpkgPaths& paths,
const Triplet& default_triplet);
using CommandTypeB = void (*)(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
using CommandTypeC = void (*)(const VcpkgCmdArguments& args);
namespace BuildCommand
{
void perform_and_exit(const FullPackageSpec& full_spec,
const fs::path& port_dir,
const std::unordered_set<std::string>& options,
const VcpkgPaths& paths);
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet);
}
namespace BuildExternal
{
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet);
}
namespace Install
{
enum class KeepGoing
{
NO = 0,
YES
};
inline KeepGoing to_keep_going(const bool value) { return value ? KeepGoing::YES : KeepGoing::NO; }
enum class PrintSummary
{
NO = 0,
YES
};
inline PrintSummary to_print_summary(const bool value) { return value ? PrintSummary::YES : PrintSummary::NO; }
struct InstallDir
{
static InstallDir from_destination_root(const fs::path& destination_root,
const std::string& destination_subdirectory,
const fs::path& listfile);
private:
fs::path m_destination;
std::string m_destination_subdirectory;
fs::path m_listfile;
public:
const fs::path& destination() const;
const std::string& destination_subdirectory() const;
const fs::path& listfile() const;
};
Build::BuildResult perform_install_plan_action(const VcpkgPaths& paths,
const Dependencies::InstallPlanAction& action,
const Build::BuildPackageOptions& install_plan_options,
StatusParagraphs& status_db);
enum class InstallResult
{
FILE_CONFLICTS,
SUCCESS,
};
void install_files_and_write_listfile(Files::Filesystem& fs,
const fs::path& source_dir,
const InstallDir& dirs);
InstallResult install_package(const VcpkgPaths& paths,
const BinaryControlFile& binary_paragraph,
StatusParagraphs* status_db);
void perform_and_exit(const std::vector<Dependencies::AnyAction>& action_plan,
const Build::BuildPackageOptions& install_plan_options,
const KeepGoing keep_going,
const PrintSummary print_summary,
const VcpkgPaths& paths,
StatusParagraphs& status_db);
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet);
}
namespace Export
{
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet);
}
namespace CI
{
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet);
}
namespace Remove
{
enum class Purge
{
NO = 0,
YES
};
inline Purge to_purge(const bool value) { return value ? Purge::YES : Purge::NO; }
void perform_remove_plan_action(const VcpkgPaths& paths,
const Dependencies::RemovePlanAction& action,
const Purge purge,
StatusParagraphs& status_db);
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet);
void remove_package(const VcpkgPaths& paths, const PackageSpec& spec, StatusParagraphs* status_db);
}
namespace Update
{
struct OutdatedPackage
{
static bool compare_by_name(const OutdatedPackage& left, const OutdatedPackage& right);
PackageSpec spec;
VersionDiff version_diff;
};
std::vector<OutdatedPackage> find_outdated_packages(const VcpkgPaths& paths, const StatusParagraphs& status_db);
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
}
namespace Env
{
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet);
}
namespace Create
{
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
}
namespace Edit
{
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
}
namespace DependInfo
{
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
}
namespace Search
{
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
}
namespace List
{
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
}
namespace Owns
{
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
}
namespace Cache
{
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
}
namespace Import
{
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
}
namespace Integrate
{
extern const char* const INTEGRATE_COMMAND_HELPSTRING;
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
}
namespace PortsDiff
{
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
}
namespace Help
{
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
void help_topic_valid_triplet(const VcpkgPaths& paths);
void print_usage();
void print_example(const std::string& command_and_arguments);
std::string create_example_string(const std::string& command_and_arguments);
}
namespace Version
{
const std::string& version();
void warn_if_vcpkg_version_mismatch(const VcpkgPaths& paths);
void perform_and_exit(const VcpkgCmdArguments& args);
}
namespace Contact
{
const std::string& email();
void perform_and_exit(const VcpkgCmdArguments& args);
}
namespace Hash
{
void perform_and_exit(const VcpkgCmdArguments& args);
}
template<class T>
struct PackageNameAndFunction
{
std::string name;
T function;
};
const std::vector<PackageNameAndFunction<CommandTypeA>>& get_available_commands_type_a();
const std::vector<PackageNameAndFunction<CommandTypeB>>& get_available_commands_type_b();
const std::vector<PackageNameAndFunction<CommandTypeC>>& get_available_commands_type_c();
template<typename T>
T find(const std::string& command_name, const std::vector<PackageNameAndFunction<T>> available_commands)
{
for (const PackageNameAndFunction<T>& cmd : available_commands)
{
if (cmd.name == command_name)
{
return cmd.function;
}
}
// not found
return nullptr;
}
}
|