summaryrefslogtreecommitdiff
path: root/src/discipline/Sport.h
diff options
context:
space:
mode:
authorSteru <jerrydream111@gmail.com>2024-08-02 16:07:15 +0200
committerSteru <jerrydream111@gmail.com>2024-08-02 16:07:15 +0200
commita767d83d81755710fc760a6d3dc040b4a379c16a (patch)
tree131b23f31e7b25f7106b2a51da99090985038891 /src/discipline/Sport.h
parentab7280aa471346374520eca3ca8c50742e70510f (diff)
Extracted API call in seperate class. Started class to handle data and filter (Sport).
Diffstat (limited to 'src/discipline/Sport.h')
-rw-r--r--src/discipline/Sport.h41
1 files changed, 41 insertions, 0 deletions
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 <set>
+
+#include <QJsonObject>
+#include <QJsonDocument>
+#include <QString>
+
+using namespace std;
+
+
+class Sport {
+
+public:
+
+ Sport(QJsonObject discipline) {
+ this->discipline = discipline;
+ }
+
+ set<QString> 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