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/data/VersionRequirement.h"
9#include "ll/api/utils/HashUtils.h"
10
11namespace ll::mod {
12struct Dependency {
13 std::string name;
14 std::optional<data::VersionRequirement> version;
15
16 [[nodiscard]] constexpr bool operator==(Dependency const& other) const {
17 return name == other.name && version == other.version;
18 }
19};
20} // namespace ll::mod
21namespace std {
22template <>
23struct hash<ll::mod::Dependency> {
24 size_t operator()(ll::mod::Dependency const& d) const noexcept {
25 return ll::hash_utils::HashCombiner{}.add(d.name).add(d.version);
26 }
27};
28} // namespace std
29namespace ll::mod {
30struct Manifest {
31 std::string entry;
32 std::string name;
33 std::string type;
34 std::optional<std::string> platform{};
35 std::optional<bool> passive{};
36 std::optional<data::Version> version{};
37 std::optional<std::string> author{};
38 std::optional<std::string> description{};
39 std::optional<SmallStringMap<std::string>> extraInfo{};
40 std::optional<SmallDenseSet<Dependency>> dependencies{};
41 std::optional<SmallDenseSet<Dependency>> optionalDependencies{};
42 std::optional<SmallDenseSet<Dependency>> conflicts{};
43 std::optional<SmallDenseSet<Dependency>> loadBefore{};
44};
45} // namespace ll::mod
STL namespace.
Definition Manifest.h:12
Definition Manifest.h:30