39 static constexpr std::string_view
rename_key(std::string_view key) {
return key ==
"schema" ?
"$schema" : key; }
88 "{} names it '{}', and a plugin lives in the directory it is named after.",
99 std::format(
"{}: logLevel '{}' is not info, warn or error",
ManifestName,
document->logLevel))});
106 .Description =
document->description,
111 .Dependencies =
document->dependencies,
112 .OptionalDependencies =
document->optionalDependencies});
141 return std::unexpected(
Error::Invalid(
"its descriptor leaves out one of BuildStamp, Load, Unload and Status"));
Enumerator names without a hand-written switch.
static Result< T > ReadFile(std::string_view path)
Parse path (resolved via ResolvePath) into T.
InstalledScan Discover(const std::filesystem::path &plugins)
void Error(std::format_string< Args... > fmt, Args &&... args)
static std::string ReadFile(const std::filesystem::path &path)
Status ValidateDescriptor(const PluginDescriptor *descriptor, std::string_view hostVersion)
std::expected< void, Error > Status
constexpr const char * PluginEntryName
std::expected< T, Error > Result
static constexpr std::string_view ManifestName
static Error Invalid(std::string detail)
std::optional< std::string > schema
std::optional< glz::raw_json > database
std::vector< std::string > dependencies
std::vector< std::string > optionalDependencies