forked from MrBesen/lolautoaccept
39 lines
738 B
C++
39 lines
738 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
#include <curl/curl.h>
|
|
#include <QJsonDocument>
|
|
|
|
class DataDragon {
|
|
public:
|
|
DataDragon();
|
|
DataDragon(const DataDragon&) = delete;
|
|
DataDragon& operator=(const DataDragon&) = delete;
|
|
|
|
struct ChampData {
|
|
public:
|
|
ChampData(const QJsonObject& source);
|
|
|
|
std::string name;
|
|
std::string id;
|
|
int key;
|
|
std::string partype;
|
|
std::string title;
|
|
};
|
|
|
|
const std::string& getVersion();
|
|
const std::vector<ChampData>& getChamps();
|
|
|
|
protected:
|
|
QJsonDocument request(const std::string& url);
|
|
|
|
std::string version;
|
|
std::vector<ChampData> champs;
|
|
|
|
private:
|
|
CURL* curl = nullptr; // the curl (does curling)
|
|
};
|
|
|
|
|
|
std::ostream& operator<<(std::ostream& str, const DataDragon::ChampData& cd); |