From a767d83d81755710fc760a6d3dc040b4a379c16a Mon Sep 17 00:00:00 2001 From: Steru Date: Fri, 2 Aug 2024 16:07:15 +0200 Subject: Extracted API call in seperate class. Started class to handle data and filter (Sport). --- src/discipline/Sport.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/discipline/Sport.h (limited to 'src/discipline/Sport.h') diff --git a/src/discipline/Sport.h b/src/discipline/Sport.h new file mode 100644 index 0000000..9c993fb --- /dev/null +++ b/src/discipline/Sport.h @@ -0,0 +1,41 @@ + +#ifndef ITAT_CHALLANGE_OLYMPICS_SPORT_H +#define ITAT_CHALLANGE_OLYMPICS_SPORT_H + + +#include + +#include +#include +#include + +using namespace std; + + +class Sport { + +public: + + Sport(QJsonObject discipline) { + this->discipline = discipline; + } + + set getCategories(); + QJsonArray getCompetitorsByCategory(QString category); + + // chainable + QJsonObject filterByName(QJsonObject discipline, QString name); + QJsonObject filterByCountry(QJsonObject discipline, QString name); + + void setDiscipline(QJsonObject discipline) { + this->discipline = discipline; + } + +private: + + QJsonObject discipline; + +}; + + +#endif //ITAT_CHALLANGE_OLYMPICS_SPORT_H -- cgit v1.2.3