VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
PluginDependencies.hpp
Go to the documentation of this file.
1#pragma once
2
4
6#include <span>
7#include <string>
8#include <string_view>
9#include <vector>
10
11namespace VoltMod
12{
13
14/** Which plugins the host loads and which it turns away, with the reason. Both alphabetical. */
16{
17 std::vector<std::string> ToLoad;
18 std::vector<RefusedPlugin> Refused;
19};
20
21/** Pure: no files, logs or SDK. */
22namespace PluginDependencies
23{
24
25/**
26 * @brief Decide which of @p installed the host loads.
27 *
28 * A missing or refused required dependency refuses its dependents transitively; optional ones never
29 * refuse. Load order is alphabetical and carries no meaning: plugins reach each other through
30 * @ref VoltMod::ServiceExchange at call time.
31 */
32LoadList Resolve(std::span<const PluginManifest> installed);
33
34/** The plugins in @p loaded that require @p plugin, directly or transitively; what `volt unload`
35 * refuses for and `volt reload` takes down with it. Alphabetical. */
36std::vector<std::string> RequiredDependents(std::string_view plugin, std::span<const PluginManifest> loaded);
37
38} // namespace PluginDependencies
39} // namespace VoltMod
LoadList Resolve(std::span< const PluginManifest > installed)
Decide which of installed the host loads.
std::vector< std::string > RequiredDependents(std::string_view plugin, std::span< const PluginManifest > loaded)
static std::string ReadFile(const std::filesystem::path &path)
Definition Loader.cpp:56
std::vector< std::string > ToLoad
std::vector< RefusedPlugin > Refused