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
|
#pragma once
#include "vcpkg_cmd_arguments.h"
#include "vcpkg_paths.h"
namespace vcpkg::Commands
{
using command_type_a = void(*)(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet);
using command_type_b = void(*)(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths);
using command_type_c = void(*)(const vcpkg_cmd_arguments& args);
namespace Build
{
void build_package(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir);
void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet);
}
namespace BuildExternal
{
void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet);
}
namespace Install
{
void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet);
}
namespace Remove
{
void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet);
}
namespace Update
{
void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths);
}
namespace Create
{
void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths);
}
namespace Edit
{
void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths);
}
namespace Search
{
void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths);
}
namespace List
{
void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths);
}
namespace Import
{
void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths);
}
namespace Owns
{
void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths);
}
namespace Cache
{
void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths);
}
namespace Integrate
{
extern const char*const INTEGRATE_COMMAND_HELPSTRING;
void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths);
}
namespace PortsDiff
{
void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths);
}
namespace Help
{
void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths);
void help_topic_valid_triplet(const vcpkg_paths& 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
{
void perform_and_exit(const vcpkg_cmd_arguments& args);
}
namespace Contact
{
void perform_and_exit(const vcpkg_cmd_arguments& args);
}
namespace Hash
{
void perform_and_exit(const vcpkg_cmd_arguments& args);
}
template <class T>
struct package_name_and_function
{
std::string name;
T function;
};
const std::vector<package_name_and_function<command_type_a>>& get_available_commands_type_a();
const std::vector<package_name_and_function<command_type_b>>& get_available_commands_type_b();
const std::vector<package_name_and_function<command_type_c>>& get_available_commands_type_c();
template <typename T>
T find(const std::string& command_name, const std::vector<package_name_and_function<T>> available_commands)
{
for (const package_name_and_function<T>& cmd : available_commands)
{
if (cmd.name == command_name)
{
return cmd.function;
}
}
// not found
return nullptr;
}
}
|