Mercurial > minori
annotate include/core/time.h @ 337:a7d4e5107531
dep/animone: REFACTOR ALL THE THINGS
1: animone now has its own syntax divergent from anisthesia,
making different platforms actually have their own sections
2: process names in animone are now called `comm' (this will
probably break things). this is what its called in bsd/linux
so I'm just going to use it everywhere
3: the X11 code now checks for the existence of a UTF-8 window title
and passes it if available
4: ANYTHING THATS NOT LINUX IS 100% UNTESTED AND CAN AND WILL BREAK!
I still actually need to test the bsd code. to be honest I'm probably
going to move all of the bsds into separate files because they're
all essentially different operating systems at this point
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Wed, 19 Jun 2024 12:51:15 -0400 |
parents | d928ec7b6a0d |
children |
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_TIME_H_ |
3ec7804abf17
include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents:
258
diff
changeset
|
2 #define MINORI_CORE_TIME_H_ |
85 | 3 |
9 | 4 #include <cstdint> |
5 #include <string> | |
6 namespace Time { | |
7 | |
305
91ac90a34003
core/time: remove Duration class, use regular functions instead
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
8 /* this is in SECONDS */ |
308 | 9 using Timestamp = int64_t; |
9 | 10 |
305
91ac90a34003
core/time: remove Duration class, use regular functions instead
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
11 enum class Units { |
91ac90a34003
core/time: remove Duration class, use regular functions instead
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
12 Seconds, |
91ac90a34003
core/time: remove Duration class, use regular functions instead
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
13 Minutes |
9 | 14 }; |
15 | |
305
91ac90a34003
core/time: remove Duration class, use regular functions instead
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
16 std::string GetSecondsAsRelativeString(Timestamp length); |
91ac90a34003
core/time: remove Duration class, use regular functions instead
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
17 std::string GetSecondsAsAbsoluteString(Units unit_cutoff, Timestamp amount, double unit_in_seconds = 1.0); |
91ac90a34003
core/time: remove Duration class, use regular functions instead
Paper <paper@paper.us.eu.org>
parents:
261
diff
changeset
|
18 |
308 | 19 /* in UTC */ |
20 Timestamp GetSystemTime(); | |
9 | 21 |
319
d928ec7b6a0d
services/kitsu: implement GetAnimeList()
Paper <paper@paper.us.eu.org>
parents:
308
diff
changeset
|
22 Timestamp ParseISO8601Time(const std::string& str); |
d928ec7b6a0d
services/kitsu: implement GetAnimeList()
Paper <paper@paper.us.eu.org>
parents:
308
diff
changeset
|
23 |
85 | 24 }; // namespace Time |
25 | |
261
3ec7804abf17
include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents:
258
diff
changeset
|
26 #endif // MINORI_CORE_TIME_H_ |