Mercurial > minori
comparison include/core/date.h @ 317:b1f4d1867ab1
services: VERY initial Kitsu support
it only supports user authentication for now, but it's definitely
a start.
| author | Paper <paper@paper.us.eu.org> |
|---|---|
| date | Wed, 12 Jun 2024 04:07:10 -0400 |
| parents | 3ec7804abf17 |
| children | d928ec7b6a0d |
comparison
equal
deleted
inserted
replaced
| 316:180714442770 | 317:b1f4d1867ab1 |
|---|---|
| 2 #define MINORI_CORE_DATE_H_ | 2 #define MINORI_CORE_DATE_H_ |
| 3 | 3 |
| 4 #include "json/json_fwd.hpp" | 4 #include "json/json_fwd.hpp" |
| 5 | 5 |
| 6 #include <optional> | 6 #include <optional> |
| 7 #include <string> | |
| 7 | 8 |
| 8 class QDate; | 9 class QDate; |
| 10 | |
| 11 /* TODO: refactor constructors, as they aren't meant | |
| 12 * to be used in this way and may cause problems down | |
| 13 * the line */ | |
| 9 | 14 |
| 10 class Date { | 15 class Date { |
| 11 public: | 16 public: |
| 12 using Year = unsigned int; | 17 using Year = unsigned int; |
| 13 using Day = unsigned char; | 18 using Day = unsigned char; |
| 27 }; | 32 }; |
| 28 | 33 |
| 29 Date(); | 34 Date(); |
| 30 Date(Year y); | 35 Date(Year y); |
| 31 Date(Year y, Month m, Day d); | 36 Date(Year y, Month m, Day d); |
| 37 Date(const std::string& str); | |
| 32 Date(const QDate& date); | 38 Date(const QDate& date); |
| 33 Date(const nlohmann::json& json); | 39 Date(const nlohmann::json& json); |
| 34 bool IsValid() const; | 40 bool IsValid() const; |
| 35 void SetYear(Year y); | 41 void SetYear(Year y); |
| 36 void SetMonth(Month m); | 42 void SetMonth(Month m); |
