propagate side as enum instead of Qstring

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97
2025-03-25 00:09:15 +02:00
parent 178965676e
commit be963764ea
18 changed files with 89 additions and 131 deletions

View File

@@ -19,27 +19,16 @@
#pragma once
#include <memory>
#include "modplatform/packwiz/Packwiz.h"
// launcher/minecraft/mod/Mod.h
class Mod;
namespace Metadata {
using ModStruct = Packwiz::V1::Mod;
using ModSide = Packwiz::V1::Side;
inline auto create(const QDir& index_dir, ModPlatform::IndexedPack& mod_pack, ModPlatform::IndexedVersion& mod_version) -> ModStruct
inline ModStruct create(const QDir& index_dir, ModPlatform::IndexedPack& mod_pack, ModPlatform::IndexedVersion& mod_version)
{
return Packwiz::V1::createModFormat(index_dir, mod_pack, mod_version);
}
inline auto create(const QDir& index_dir, Mod& internal_mod, QString mod_slug) -> ModStruct
{
return Packwiz::V1::createModFormat(index_dir, internal_mod, std::move(mod_slug));
}
inline void update(const QDir& index_dir, ModStruct& mod)
{
Packwiz::V1::updateModIndex(index_dir, mod);
@@ -50,24 +39,14 @@ inline void remove(const QDir& index_dir, QString mod_slug)
Packwiz::V1::deleteModIndex(index_dir, mod_slug);
}
inline void remove(const QDir& index_dir, QVariant& mod_id)
{
Packwiz::V1::deleteModIndex(index_dir, mod_id);
}
inline auto get(const QDir& index_dir, QString mod_slug) -> ModStruct
inline ModStruct get(const QDir& index_dir, QString mod_slug)
{
return Packwiz::V1::getIndexForMod(index_dir, std::move(mod_slug));
}
inline auto get(const QDir& index_dir, QVariant& mod_id) -> ModStruct
inline ModStruct get(const QDir& index_dir, QVariant& mod_id)
{
return Packwiz::V1::getIndexForMod(index_dir, mod_id);
}
inline auto modSideToString(ModSide side) -> QString
{
return Packwiz::V1::sideToString(side);
}
}; // namespace Metadata