annotate include/core/date.h @ 312:11adae933b40

locale: remove old unfinished and probably bad spanish translation
author Paper <paper@paper.us.eu.org>
date Tue, 11 Jun 2024 13:19:32 -0400
parents 3ec7804abf17
children b1f4d1867ab1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
261
3ec7804abf17 include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
1 #ifndef MINORI_CORE_DATE_H_
3ec7804abf17 include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
2 #define MINORI_CORE_DATE_H_
85
c69230dc2b5d *: cleanup includes
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
3
187
9613d72b097e *: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents: 174
diff changeset
4 #include "json/json_fwd.hpp"
9613d72b097e *: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents: 174
diff changeset
5
196
f0ff06a45c42 date: use std::optional for values
Paper <mrpapersonic@gmail.com>
parents: 187
diff changeset
6 #include <optional>
f0ff06a45c42 date: use std::optional for values
Paper <mrpapersonic@gmail.com>
parents: 187
diff changeset
7
187
9613d72b097e *: multiple performance improvements
Paper <mrpapersonic@gmail.com>
parents: 174
diff changeset
8 class QDate;
85
c69230dc2b5d *: cleanup includes
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
9
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
10 class Date {
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
11 public:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
12 using Year = unsigned int;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
13 using Day = unsigned char;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
14 enum class Month {
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
15 Jan = 0,
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
16 Feb,
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
17 Mar,
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
18 Apr,
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
19 May,
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
20 Jun,
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
21 Jul,
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
22 Aug,
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
23 Sep,
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
24 Oct,
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
25 Nov,
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
26 Dec
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
27 };
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
28
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
29 Date();
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
30 Date(Year y);
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
31 Date(Year y, Month m, Day d);
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
32 Date(const QDate& date);
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
33 Date(const nlohmann::json& json);
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
34 bool IsValid() const;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
35 void SetYear(Year y);
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
36 void SetMonth(Month m);
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
37 void SetDay(Day d);
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
38 void VoidYear();
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
39 void VoidMonth();
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
40 void VoidDay();
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
41 std::optional<Year> GetYear() const;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
42 std::optional<Month> GetMonth() const;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
43 std::optional<Day> GetDay() const;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
44 QDate GetAsQDate() const;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
45 nlohmann::json GetAsAniListJson() const;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
46
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
47 private:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
48 std::optional<Year> year;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
49 std::optional<Month> month;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 197
diff changeset
50 std::optional<Day> day;
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
51 };
85
c69230dc2b5d *: cleanup includes
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
52
261
3ec7804abf17 include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
53 #endif // MINORI_CORE_DATE_H_