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 size_t hash = std::hash<std::string>{}(d.name);
25 ll::hash_utils::hashCombine(std::hash<std::optional<ll::data::Version>>{}(d.version), hash);
26 return hash;
27 }
28};
29} // namespace std
30namespace ll::mod {
31struct Manifest {
32 std::string entry;
33 std::string name;
34 std::string type;
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:11
Definition Manifest.h:31