ba677a8cb7
This makes it easier to create resource apis that aren't network-based. Signed-off-by: flow <flowlnlnln@gmail.com>
19 lines
790 B
C++
19 lines
790 B
C++
#pragma once
|
|
|
|
#include "modplatform/ResourceAPI.h"
|
|
|
|
class NetworkResourceAPI : public ResourceAPI {
|
|
public:
|
|
Task::Ptr searchProjects(SearchArgs&&, SearchCallbacks&&) const override;
|
|
|
|
Task::Ptr getProject(QString addonId, QByteArray* response) const override;
|
|
|
|
Task::Ptr getProjectInfo(ProjectInfoArgs&&, ProjectInfoCallbacks&&) const override;
|
|
Task::Ptr getProjectVersions(VersionSearchArgs&&, VersionSearchCallbacks&&) const override;
|
|
|
|
protected:
|
|
[[nodiscard]] virtual auto getSearchURL(SearchArgs const& args) const -> std::optional<QString> = 0;
|
|
[[nodiscard]] virtual auto getInfoURL(QString const& id) const -> std::optional<QString> = 0;
|
|
[[nodiscard]] virtual auto getVersionsURL(VersionSearchArgs const& args) const -> std::optional<QString> = 0;
|
|
};
|