LeviLamina
Loading...
Searching...
No Matches
Manifest.h
1#pragma once
2
3#include <optional>
4#include <string>
5
6#include "ll/api/base/Containers.h"
7#include "ll/api/data/Version.h"
8#include "ll/api/utils/HashUtils.h"
9
10namespace ll::mod {
11struct Dependency {
12 std::string name;
13 std::optional<data::Version> version;
14
15 [[nodiscard]] constexpr bool operator==(Dependency const& other) const {
16 return name == other.name && version == other.version;
17 }
18};
19} // namespace ll::mod
20namespace std {
21template <>
22struct hash<ll::mod::Dependency> {
23 size_t operator()(ll::mod::Dependency const& d) const noexcept {
24 return ll::hash_utils::HashCombiner{}.add(d.name).add(d.version);
25 }
26};
27} // namespace std
28namespace ll::mod {
29struct Manifest {
30 std::string entry;
31 std::string name;
32 std::string type;
33 std::optional<bool> passive{};
34 std::optional<data::Version> version{};
35 std::optional<std::string> author{};
36 std::optional<std::string> description{};
37 std::optional<SmallStringMap<std::string>> extraInfo{};
38 std::optional<SmallDenseSet<Dependency>> dependencies{};
39 std::optional<SmallDenseSet<Dependency>> optionalDependencies{};
40 std::optional<SmallDenseSet<Dependency>> conflicts{};
41 std::optional<SmallDenseSet<Dependency>> loadBefore{};
42};
43} // namespace ll::mod
STL namespace.
Definition Manifest.h:11
Definition Manifest.h:29