mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-08-30 18:30:51 +00:00
f4a8f9421a
Signed-off-by: lizzie <lizzie@eden-emu.dev> - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- basically bunch of linking errors due to gcc not liking to compile HFA/whatever typedef stuffs this is on non-x86_64 arch, ppc64 compiler where this occurs ``` gcc (Debian 14.2.0-19) 14.2.0 Copyright (C) 2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ``` Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4260 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: Maufeat <sahyno1996@gmail.com>
57 lines
1.6 KiB
C++
57 lines
1.6 KiB
C++
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <optional>
|
|
#include <string>
|
|
#include <vector>
|
|
#include <nlohmann/json.hpp>
|
|
#include "common/common_types.h"
|
|
|
|
namespace Common::Net {
|
|
|
|
struct Asset {
|
|
std::string name;
|
|
std::string url;
|
|
std::string path;
|
|
std::string filename;
|
|
};
|
|
|
|
struct Release {
|
|
std::string title;
|
|
std::string body;
|
|
std::string tag;
|
|
std::string base_download_url;
|
|
std::string html_url;
|
|
std::string host;
|
|
|
|
std::vector<std::string> assets;
|
|
|
|
u64 id;
|
|
u64 published;
|
|
bool prerelease;
|
|
|
|
// Get the relevant list of assets for the current platform.
|
|
std::vector<Asset> GetPlatformAssets() const;
|
|
|
|
static std::optional<Release> FromJson(const nlohmann::json& json, const std::string &host, const std::string& repo);
|
|
static std::optional<Release> FromJson(const std::string_view& json, const std::string &host, const std::string& repo);
|
|
static std::vector<Release> ListFromJson(const nlohmann::json &json, const std::string &host, const std::string &repo);
|
|
static std::vector<Release> ListFromJson(const std::string_view &json, const std::string &host, const std::string &repo);
|
|
};
|
|
|
|
// Make a request via httplib, and return the response body if applicable.
|
|
std::optional<std::string> MakeRequest(const std::string &url, const std::string &path);
|
|
|
|
// Get all of the latest stable releases.
|
|
std::vector<Release> GetReleases();
|
|
|
|
// Get all of the latest stable releases as text.
|
|
std::optional<std::string> GetReleasesBody();
|
|
|
|
// Get the latest release of the current channel.
|
|
std::optional<Release> GetLatestRelease();
|
|
|
|
}
|