Botan
3.7.1
Crypto and TLS for C&
Toggle main menu visibility
Main Page
Related Pages
Topics
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Variables
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
Enumerations
a
c
d
e
f
g
h
k
l
m
n
o
p
r
s
t
u
v
w
Enumerator
c
d
f
i
m
n
r
s
t
Concepts
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
f
h
i
m
n
o
p
r
s
t
u
v
w
Enumerations
b
c
d
e
k
m
n
o
p
s
t
x
Enumerator
_
a
b
c
d
e
f
h
k
l
m
n
p
q
r
s
t
u
w
x
Related Symbols
b
c
d
e
f
k
o
p
s
t
x
Files
File List
File Members
All
_
a
b
c
d
e
f
i
k
m
n
o
p
q
s
t
u
w
x
y
z
Functions
b
c
Variables
Typedefs
b
c
e
p
t
Enumerations
Enumerator
b
c
d
e
k
n
Macros
_
a
b
c
f
m
n
q
s
t
w
src
lib
utils
calendar.h
Go to the documentation of this file.
1
/*
2
* Calendar Functions
3
* (C) 1999-2009,2015 Jack Lloyd
4
* (C) 2015 Simon Warta (Kullo GmbH)
5
*
6
* Botan is released under the Simplified BSD License (see license.txt)
7
*/
8
9
#ifndef BOTAN_CALENDAR_H_
10
#define BOTAN_CALENDAR_H_
11
12
#include <botan/types.h>
13
#include <chrono>
14
#include <string>
15
16
namespace
Botan
{
17
18
/**
19
* Struct representing a particular date and time
20
*/
21
class
BOTAN_TEST_API
calendar_point
{
22
public
:
23
/** The year */
24
uint32_t
year
()
const
{
return
m_year; }
25
26
/** The month, 1 through 12 for Jan to Dec */
27
uint32_t
month
()
const
{
return
m_month; }
28
29
/** The day of the month, 1 through 31 (or 28 or 30 based on month */
30
uint32_t
day
()
const
{
return
m_day; }
31
32
/** Hour in 24-hour form, 0 to 23 */
33
uint32_t
hour
()
const
{
return
m_hour; }
34
35
/** Minutes in the hour, 0 to 60 */
36
uint32_t
minutes
()
const
{
return
m_minutes; }
37
38
/** Seconds in the minute, 0 to 60, but might be slightly
39
larger to deal with leap seconds on some systems
40
*/
41
uint32_t
seconds
()
const
{
return
m_seconds; }
42
43
/**
44
* Initialize a calendar_point
45
* @param y the year
46
* @param mon the month
47
* @param d the day
48
* @param h the hour
49
* @param min the minute
50
* @param sec the second
51
*/
52
calendar_point
(uint32_t y, uint32_t mon, uint32_t d, uint32_t h, uint32_t min, uint32_t sec) :
53
m_year(y), m_month(mon), m_day(d), m_hour(h), m_minutes(min), m_seconds(sec) {}
52
calendar_point
(uint32_t y, uint32_t mon, uint32_t d, uint32_t h, uint32_t min, uint32_t sec) : {
…
}
54
55
/**
56
* Convert a time_point to a calendar_point
57
* @param time_point a time point from the system clock
58
*/
59
calendar_point
(
const
std::chrono::system_clock::time_point& time_point);
60
61
/**
62
* Return seconds since epoch
63
*/
64
uint64_t seconds_since_epoch()
const
;
65
66
/**
67
* Returns an STL timepoint object
68
*
69
* Note this throws an exception if the time is not representable
70
* in the system time_t
71
*/
72
std::chrono::system_clock::time_point to_std_timepoint()
const
;
73
74
/**
75
* Returns a human readable string of the struct's components.
76
* Formatting might change over time. Currently it is RFC339 'iso-date-time'.
77
*/
78
std::string to_string()
const
;
79
80
private
:
81
uint32_t m_year;
82
uint32_t m_month;
83
uint32_t m_day;
84
uint32_t m_hour;
85
uint32_t m_minutes;
86
uint32_t m_seconds;
87
};
21
class
BOTAN_TEST_API
calendar_point
{
…
};
88
89
}
// namespace Botan
90
91
#endif
BOTAN_TEST_API
#define BOTAN_TEST_API
Definition
api.h:39
Botan::calendar_point
Definition
calendar.h:21
Botan::calendar_point::hour
uint32_t hour() const
Definition
calendar.h:33
Botan::calendar_point::seconds
uint32_t seconds() const
Definition
calendar.h:41
Botan::calendar_point::day
uint32_t day() const
Definition
calendar.h:30
Botan::calendar_point::calendar_point
calendar_point(uint32_t y, uint32_t mon, uint32_t d, uint32_t h, uint32_t min, uint32_t sec)
Definition
calendar.h:52
Botan::calendar_point::minutes
uint32_t minutes() const
Definition
calendar.h:36
Botan::calendar_point::month
uint32_t month() const
Definition
calendar.h:27
Botan::calendar_point::year
uint32_t year() const
Definition
calendar.h:24
Botan
Definition
alg_id.cpp:13
Generated by
1.12.0