openMSX
utils
Date.hh
Go to the documentation of this file.
1
#ifndef DATE_HH
2
#define DATE_HH
3
4
#include <limits>
5
#include <string>
6
#include <ctime>
7
8
namespace
openmsx::Date
{
9
10
constexpr time_t
INVALID_TIME_T
=
std::numeric_limits<time_t>::min
();
11
12
// Convert INVALID_TIME_T to a different (close) value.
13
constexpr time_t
adjustTimeT
(time_t time) {
14
return
(time ==
Date::INVALID_TIME_T
) ? (
Date::INVALID_TIME_T
+ 1)
15
: time;
16
}
17
18
// 'p' must point to a buffer that is at least 24 characters long
19
[[nodiscard]] time_t
fromString
(
const
char
* p);
20
21
[[nodiscard]] std::string
toString
(time_t time);
22
23
}
// namespace openmsx::Date
24
25
#endif
gl::min
constexpr vecN< N, T > min(const vecN< N, T > &x, const vecN< N, T > &y)
Definition:
gl_vec.hh:258
openmsx::Date
Definition:
Date.cc:6
openmsx::Date::adjustTimeT
constexpr time_t adjustTimeT(time_t time)
Definition:
Date.hh:13
openmsx::Date::toString
std::string toString(time_t time)
Definition:
Date.cc:151
openmsx::Date::INVALID_TIME_T
constexpr time_t INVALID_TIME_T
Definition:
Date.hh:10
openmsx::Date::fromString
time_t fromString(const char *p)
Definition:
Date.cc:30
Generated on Sat Jun 25 2022 11:13:23 for openMSX by
1.9.1