Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
DateTime.h
Go to the documentation of this file.
1//
2// DateTime.h
3//
4// Library: Foundation
5// Package: DateTime
6// Module: DateTime
7//
8// Definition of the DateTime class.
9//
10// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
11// and Contributors.
12//
13// SPDX-License-Identifier: BSL-1.0
14//
15
16
17#ifndef Foundation_DateTime_INCLUDED
18#define Foundation_DateTime_INCLUDED
19
20
21#include "Poco/Foundation.h"
22#include "Poco/Timestamp.h"
23#include "Poco/Timespan.h"
24
25
26struct tm;
27
28
29namespace Poco {
30
31
33 /// This class represents an instant in time, expressed
34 /// in years, months, days, hours, minutes, seconds
35 /// and milliseconds based on the Gregorian calendar.
36 /// The class is mainly useful for conversions between
37 /// UTC, Julian day and Gregorian calendar dates.
38 ///
39 /// The date and time stored in a DateTime is always in UTC
40 /// (Coordinated Universal Time) and thus independent of the
41 /// timezone in effect on the system.
42 ///
43 /// Conversion calculations are based on algorithms
44 /// collected and described by Peter Baum at
45 /// http://vsg.cape.com/~pbaum/date/date0.htm
46 ///
47 /// Internally, this class stores a date/time in two
48 /// forms (UTC and broken down) for performance reasons. Only use
49 /// this class for conversions between date/time representations.
50 /// Use the Timestamp class for everything else.
51 ///
52 /// Notes:
53 /// * Zero is a valid year (in accordance with ISO 8601 and astronomical year numbering)
54 /// * Year zero (0) is a leap year
55 /// * Negative years (years preceding 1 BC) are not supported
56 ///
57 /// For more information, please see:
58 /// * http://en.wikipedia.org/wiki/Gregorian_Calendar
59 /// * http://en.wikipedia.org/wiki/Julian_day
60 /// * http://en.wikipedia.org/wiki/UTC
61 /// * http://en.wikipedia.org/wiki/ISO_8601
62{
63public:
64 enum Months
65 /// Symbolic names for month numbers (1 to 12).
66 {
79 };
80
82 /// Symbolic names for week day numbers (0 to 6).
83 {
84 SUNDAY = 0,
91 };
92
94 /// Creates a DateTime for the current date and time.
95
96 DateTime(const tm& tmStruct);
97 /// Creates a DateTime from tm struct.
98
99 DateTime(const Timestamp& timestamp);
100 /// Creates a DateTime for the date and time given in
101 /// a Timestamp.
102
103 DateTime(int year, int month, int day, int hour = 0, int minute = 0, int second = 0, int millisecond = 0, int microsecond = 0);
104 /// Creates a DateTime for the given Gregorian date and time.
105 /// * year is from 0 to 9999.
106 /// * month is from 1 to 12.
107 /// * day is from 1 to 31.
108 /// * hour is from 0 to 23.
109 /// * minute is from 0 to 59.
110 /// * second is from 0 to 60.
111 /// * millisecond is from 0 to 999.
112 /// * microsecond is from 0 to 999.
113 ///
114 /// Throws an InvalidArgumentException if an argument date is out of range.
115
116 DateTime(double julianDay);
117 /// Creates a DateTime for the given Julian day.
118
119 DateTime(Timestamp::UtcTimeVal utcTime, Timestamp::TimeDiff diff);
120 /// Creates a DateTime from an UtcTimeVal and a TimeDiff.
121 ///
122 /// Mainly used internally by DateTime and friends.
123
124 DateTime(const DateTime& dateTime);
125 /// Copy constructor. Creates the DateTime from another one.
126
128 /// Destroys the DateTime.
129
130 DateTime& operator = (const DateTime& dateTime);
131 /// Assigns another DateTime.
132
133 DateTime& operator = (const Timestamp& timestamp);
134 /// Assigns a Timestamp.
135
136 DateTime& operator = (double julianDay);
137 /// Assigns a Julian day.
138
139 DateTime& assign(int year, int month, int day, int hour = 0, int minute = 0, int second = 0, int millisecond = 0, int microseconds = 0);
140 /// Assigns a Gregorian date and time.
141 /// * year is from 0 to 9999.
142 /// * month is from 1 to 12.
143 /// * day is from 1 to 31.
144 /// * hour is from 0 to 23.
145 /// * minute is from 0 to 59.
146 /// * second is from 0 to 60.
147 /// * millisecond is from 0 to 999.
148 /// * microsecond is from 0 to 999.
149 ///
150 /// Throws an InvalidArgumentException if an argument date is out of range.
151
152 void swap(DateTime& dateTime);
153 /// Swaps the DateTime with another one.
154
155 int year() const;
156 /// Returns the year.
157
158 int month() const;
159 /// Returns the month (1 to 12).
160
161 int week(int firstDayOfWeek = MONDAY) const;
162 /// Returns the week number within the year.
163 /// FirstDayOfWeek should be either SUNDAY (0) or MONDAY (1).
164 /// The returned week number will be from 0 to 53. Week number 1 is the week
165 /// containing January 4. This is in accordance to ISO 8601.
166 ///
167 /// The following example assumes that firstDayOfWeek is MONDAY. For 2005, which started
168 /// on a Saturday, week 1 will be the week starting on Monday, January 3.
169 /// January 1 and 2 will fall within week 0 (or the last week of the previous year).
170 ///
171 /// For 2007, which starts on a Monday, week 1 will be the week starting on Monday, January 1.
172 /// There will be no week 0 in 2007.
173
174 int day() const;
175 /// Returns the day within the month (1 to 31).
176
177 int dayOfWeek() const;
178 /// Returns the weekday (0 to 6, where
179 /// 0 = Sunday, 1 = Monday, ..., 6 = Saturday).
180
181 int dayOfYear() const;
182 /// Returns the number of the day in the year.
183 /// January 1 is 1, February 1 is 32, etc.
184
185 int hour() const;
186 /// Returns the hour (0 to 23).
187
188 int hourAMPM() const;
189 /// Returns the hour (0 to 12).
190
191 bool isAM() const;
192 /// Returns true if hour < 12;
193
194 bool isPM() const;
195 /// Returns true if hour >= 12.
196
197 int minute() const;
198 /// Returns the minute (0 to 59).
199
200 int second() const;
201 /// Returns the second (0 to 59).
202
203 int millisecond() const;
204 /// Returns the millisecond (0 to 999)
205
206 int microsecond() const;
207 /// Returns the microsecond (0 to 999)
208
209 double julianDay() const;
210 /// Returns the julian day for the date and time.
211
212 Timestamp timestamp() const;
213 /// Returns the date and time expressed as a Timestamp.
214
215 Timestamp::UtcTimeVal utcTime() const;
216 /// Returns the date and time expressed in UTC-based
217 /// time. UTC base time is midnight, October 15, 1582.
218 /// Resolution is 100 nanoseconds.
219
220 bool operator == (const DateTime& dateTime) const;
221 bool operator != (const DateTime& dateTime) const;
222 bool operator < (const DateTime& dateTime) const;
223 bool operator <= (const DateTime& dateTime) const;
224 bool operator > (const DateTime& dateTime) const;
225 bool operator >= (const DateTime& dateTime) const;
226
227 DateTime operator + (const Timespan& span) const;
228 DateTime operator - (const Timespan& span) const;
229 Timespan operator - (const DateTime& dateTime) const;
230 DateTime& operator += (const Timespan& span);
231 DateTime& operator -= (const Timespan& span);
232
233 tm makeTM() const;
234 /// Converts DateTime to tm struct.
235
236 void makeUTC(int tzd);
237 /// Converts a local time into UTC, by applying the given time zone differential.
238
239 void makeLocal(int tzd);
240 /// Converts a UTC time into a local time, by applying the given time zone differential.
241
242 static bool isLeapYear(int year);
243 /// Returns true if the given year is a leap year;
244 /// false otherwise.
245
246 static int daysOfMonth(int year, int month);
247 /// Returns the number of days in the given month
248 /// and year. Month is from 1 to 12.
249
250 static bool isValid(int year, int month, int day, int hour = 0, int minute = 0, int second = 0, int millisecond = 0, int microsecond = 0);
251 /// Checks if the given date and time is valid
252 /// (all arguments are within a proper range).
253 ///
254 /// Returns true if all arguments are valid, false otherwise.
255
256protected:
257 static double toJulianDay(Timestamp::UtcTimeVal utcTime);
258 /// Computes the Julian day for an UTC time.
259
260 static double toJulianDay(int year, int month, int day, int hour = 0, int minute = 0, int second = 0, int millisecond = 0, int microsecond = 0);
261 /// Computes the Julian day for a Gregorian calendar date and time.
262 /// See <http://vsg.cape.com/~pbaum/date/jdimp.htm>, section 2.3.1 for the algorithm.
263
264 static Timestamp::UtcTimeVal toUtcTime(double julianDay);
265 /// Computes the UTC time for a Julian day.
266
267 void computeGregorian(double julianDay);
268 /// Computes the Gregorian date for the given Julian day.
269 /// See <http://vsg.cape.com/~pbaum/date/injdimp.htm>, section 3.3.1 for the algorithm.
270
272 /// Extracts the daytime (hours, minutes, seconds, etc.) from the stored utcTime.
273
274private:
275 void checkLimit(short& lower, short& higher, short limit);
276 void normalize();
277 ///utility functions used to correct the overflow in computeGregorian
278
279 Timestamp::UtcTimeVal _utcTime;
280 short _year;
281 short _month;
282 short _day;
283 short _hour;
284 short _minute;
285 short _second;
288};
289
290
291//
292// inlines
293//
294
295
296inline double DateTime::toJulianDay(Timestamp::UtcTimeVal utcTime)
297{
298 double utcDays = double(utcTime)/864000000000.0;
299 return utcDays + 2299160.5; // first day of Gregorian reform (Oct 15 1582)
300}
301
302
303inline Timestamp::UtcTimeVal DateTime::toUtcTime(double julianDay)
304{
305 return Timestamp::UtcTimeVal((julianDay - 2299160.5)*864000000000.0);
306}
307
308
310{
312}
313
314
315inline Timestamp::UtcTimeVal DateTime::utcTime() const
316{
317 return _utcTime;
318}
319
320
321inline int DateTime::year() const
322{
323 return _year;
324}
325
326
327inline int DateTime::month() const
328{
329 return _month;
330}
331
332
333inline int DateTime::day() const
334{
335 return _day;
336}
337
338
339inline int DateTime::hour() const
340{
341 return _hour;
342}
343
344
345inline int DateTime::hourAMPM() const
346{
347 if (_hour < 1)
348 return 12;
349 else if (_hour > 12)
350 return _hour - 12;
351 else
352 return _hour;
353}
354
355
356inline bool DateTime::isAM() const
357{
358 return _hour < 12;
359}
360
361
362inline bool DateTime::isPM() const
363{
364 return _hour >= 12;
365}
366
367
368inline int DateTime::minute() const
369{
370 return _minute;
371}
372
373
374inline int DateTime::second() const
375{
376 return _second;
377}
378
379
380inline int DateTime::millisecond() const
381{
382 return _millisecond;
383}
384
385
386inline int DateTime::microsecond() const
387{
388 return _microsecond;
389}
390
391
392inline bool DateTime::operator == (const DateTime& dateTime) const
393{
394 return _utcTime == dateTime._utcTime;
395}
396
397
398inline bool DateTime::operator != (const DateTime& dateTime) const
399{
400 return _utcTime != dateTime._utcTime;
401}
402
403
404inline bool DateTime::operator < (const DateTime& dateTime) const
405{
406 return _utcTime < dateTime._utcTime;
407}
408
409
410inline bool DateTime::operator <= (const DateTime& dateTime) const
411{
412 return _utcTime <= dateTime._utcTime;
413}
414
415
416inline bool DateTime::operator > (const DateTime& dateTime) const
417{
418 return _utcTime > dateTime._utcTime;
419}
420
421
422inline bool DateTime::operator >= (const DateTime& dateTime) const
423{
424 return _utcTime >= dateTime._utcTime;
425}
426
427
428inline bool DateTime::isLeapYear(int year)
429{
430 return (year % 4) == 0 && ((year % 100) != 0 || (year % 400) == 0);
431}
432
433
434inline void swap(DateTime& d1, DateTime& d2)
435{
436 d1.swap(d2);
437}
438
439
440} // namespace Poco
441
442
443#endif // Foundation_DateTime_INCLUDED
#define ARK_API
Definition Base.h:9
#define poco_unexpected()
Definition Bugcheck.h:140
#define POCO_EXTERNAL_OPENSSL
Definition Config.h:189
#define POCO_NO_SOO
Definition Config.h:82
#define POCO_DECLARE_EXCEPTION(API, CLS, BASE)
Definition Exception.h:157
#define POCO_DECLARE_EXCEPTION_CODE(API, CLS, BASE, CODE)
Definition Exception.h:140
#define POCO_DO_JOIN2(X, Y)
Definition Foundation.h:134
#define POCO_DO_JOIN(X, Y)
Definition Foundation.h:133
#define Foundation_API
Definition Foundation.h:60
#define POCO_JOIN(X, Y)
Definition Foundation.h:132
#define POCO_HAVE_IPv6
Definition Net.h:64
#define Net_API
Definition Net.h:47
#define NetSSL_API
Definition NetSSL.h:48
#define POCO_OS_IRIX
Definition Platform.h:35
#define POCO_OS_TRU64
Definition Platform.h:30
#define POCO_OS_WINDOWS_NT
Definition Platform.h:43
#define POCO_OS_HPUX
Definition Platform.h:29
#define POCO_OS_CYGWIN
Definition Platform.h:39
#define POCO_OS_WINDOWS_CE
Definition Platform.h:44
#define POCO_UNUSED
Definition Platform.h:274
#define POCO_OS_VXWORKS
Definition Platform.h:38
#define POCO_OS_ANDROID
Definition Platform.h:41
#define POCO_OS_QNX
Definition Platform.h:37
#define POCO_OS_AIX
Definition Platform.h:28
#define POCO_OS_LINUX
Definition Platform.h:31
#define POCO_OS_SOLARIS
Definition Platform.h:36
#define POCO_ARCH_AMD64
Definition Platform.h:129
#define OPENSSL_VERSION_PREREQ(maj, min)
Definition Crypto.h:36
#define Crypto_API
Definition Crypto.h:82
RSAPaddingMode
The padding mode used for RSA public key encryption.
Definition Crypto.h:44
@ RSA_PADDING_PKCS1_OAEP
PKCS #1 v1.5 padding. This currently is the most widely used mode.
Definition Crypto.h:48
@ RSA_PADDING_NONE
Definition Crypto.h:52
@ RSA_PADDING_PKCS1
Definition Crypto.h:45
#define POCO_EXTERNAL_OPENSSL_SLPRO
Definition Crypto.h:24
#define poco_ntoh_32(x)
Definition SocketDefs.h:328
#define INADDR_NONE
Definition SocketDefs.h:291
#define INADDR_BROADCAST
Definition SocketDefs.h:299
#define INADDR_ANY
Definition SocketDefs.h:295
#define poco_ntoh_16(x)
Definition SocketDefs.h:326
#define INADDR_LOOPBACK
Definition SocketDefs.h:303
virtual std::unique_ptr< ArkApi::ICommands > & GetCommands()=0
std::mutex RequestMutex_
Definition Requests.cpp:47
void WriteRequest(std::function< void(bool, std::string)> callback, bool success, std::string result)
Definition Requests.cpp:73
std::string GetResponse(Poco::Net::HTTPClientSession *session, Poco::Net::HTTPResponse &response)
Definition Requests.cpp:107
Poco::Net::HTTPRequest ConstructRequest(const std::string &url, Poco::Net::HTTPClientSession *&session, const std::vector< std::string > &headers, const std::string &request_type)
Definition Requests.cpp:79
std::vector< RequestData > RequestsVec_
Definition Requests.cpp:46
Requests(Requests &&)=delete
ARK_API bool CreateGetRequest(const std::string &url, const std::function< void(bool, std::string)> &callback, std::vector< std::string > headers={})
Creates an async GET Request that runs in another thread but calls the callback from the main thread.
Definition Requests.cpp:129
ARK_API bool CreatePostRequest(const std::string &url, const std::function< void(bool, std::string)> &callback, const std::vector< std::string > &post_ids, const std::vector< std::string > &post_data, std::vector< std::string > headers={})
Creates an async POST Request that runs in another thread but calls the callback from the main thread...
Definition Requests.cpp:238
Requests & operator=(Requests &&)=delete
ARK_API bool CreateDeleteRequest(const std::string &url, const std::function< void(bool, std::string)> &callback, std::vector< std::string > headers={})
Creates an async DELETE Request that runs in another thread but calls the callback from the main thre...
Definition Requests.cpp:292
Requests & operator=(const Requests &)=delete
ARK_API bool CreatePostRequest(const std::string &url, const std::function< void(bool, std::string)> &callback, const std::string &post_data, std::vector< std::string > headers={})
Creates an async POST Request with application/x-www-form-urlencoded content type that runs in anothe...
Definition Requests.cpp:162
static ARK_API Requests & Get()
Definition Requests.cpp:67
ARK_API bool CreatePostRequest(const std::string &url, const std::function< void(bool, std::string)> &callback, const std::string &post_data, const std::string &content_type, std::vector< std::string > headers={})
Creates an async POST Request that runs in another thread but calls the callback from the main thread...
Definition Requests.cpp:200
std::unique_ptr< impl > pimpl
Definition Requests.h:84
Requests(const Requests &)=delete
virtual void AddOnTickCallback(const FString &id, const std::function< void(float)> &callback)=0
Added function will be called every frame.
virtual bool RemoveOnTickCallback(const FString &id)=0
Removes a on-tick callback.
Definition Logger.h:9
static std::shared_ptr< spdlog::logger > & GetLog()
Definition Logger.h:22
ValueType operator--()
Increments the counter and returns the previous value.
ValueType operator++()
Returns the value of the counter.
ValueType operator++(int)
Increments the counter and returns the result.
AtomicCounter(ValueType initialValue)
Creates a new AtomicCounter and initializes it to zero.
operator ValueType() const
Assigns a value to the counter.
ValueType operator--(int)
Decrements the counter and returns the result.
ValueType value() const
Converts the AtomicCounter to ValueType.
AtomicCounter & operator=(const AtomicCounter &counter)
Destroys the AtomicCounter.
AtomicCounter & operator=(ValueType value)
Assigns the value of another AtomicCounter.
AtomicCounter()
The underlying integer type.
bool operator!() const
Decrements the counter and returns the previous value.
AtomicCounter(const AtomicCounter &counter)
~AtomicCounter()
Creates the counter by copying another one.
std::atomic< int > _counter
Returns true if the counter is zero, false otherwise.
static std::string what(const char *msg, const char *file, int line, const char *text=0)
static void bugcheck(const char *msg, const char *file, int line)
static void nullPointer(const char *ptr, const char *file, int line)
static void debugger(const char *msg, const char *file, int line)
static void debugger(const char *file, int line)
static void bugcheck(const char *file, int line)
static void assertion(const char *cond, const char *file, int line, const char *text=0)
static void unexpected(const char *file, int line)
static struct CRYPTO_dynlock_value * dynlockCreate(const char *file, int line)
static void uninitialize()
Initializes the OpenSSL machinery.
static void initialize()
Automatically shut down OpenSSL on exit.
~OpenSSLInitializer()
Automatically initialize OpenSSL on startup.
static void lock(int mode, int n, const char *file, int line)
static unsigned long id()
static Poco::AtomicCounter _rc
static void enableFIPSMode(bool enabled)
static Poco::FastMutex * _mutexes
static void dynlock(int mode, struct CRYPTO_dynlock_value *lock, const char *file, int line)
static bool isFIPSEnabled()
Shuts down the OpenSSL machinery.
static void dynlockDestroy(struct CRYPTO_dynlock_value *lock, const char *file, int line)
This class represents a X509 Certificate.
void swap(X509Certificate &cert)
Move assignment.
std::string subjectName(NID nid) const
Returns the certificate subject's distinguished name.
bool equals(const X509Certificate &otherCertificate) const
const X509 * certificate() const
Poco::DateTime expiresOn() const
Returns the date and time the certificate is valid from.
X509Certificate(X509 *pCert, bool shared)
std::string issuerName(NID nid) const
Returns the certificate issuer's distinguished name.
const std::string & subjectName() const
X509Certificate(const X509Certificate &cert)
const std::string & serialNumber() const
Returns the version of the certificate.
X509Certificate & operator=(const X509Certificate &cert)
Creates the certificate by moving another one.
X509 * dup() const
Returns the underlying OpenSSL certificate.
~X509Certificate()
Exchanges the certificate with another one.
bool issuedBy(const X509Certificate &issuerCertificate) const
const std::string & issuerName() const
long version() const
Destroys the X509Certificate.
X509Certificate(X509Certificate &&cert) noexcept
Creates the certificate by copying another one.
void load(std::istream &stream)
Writes the list of certificates to the specified PEM file.
std::string signatureAlgorithm() const
void print(std::ostream &out) const
Returns the certificate signature algorithm long name.
Poco::DateTime validFrom() const
X509Certificate(std::istream &istr)
std::string commonName() const
void save(std::ostream &stream) const
OpenSSLInitializer _openSSLInitializer
X509Certificate & operator=(X509Certificate &&cert) noexcept
Assigns a certificate.
void swap(DateTime &dateTime)
bool operator<=(const DateTime &dateTime) const
Definition DateTime.h:410
short _millisecond
Definition DateTime.h:286
DateTime & operator-=(const Timespan &span)
int millisecond() const
Returns the second (0 to 59).
Definition DateTime.h:380
static bool isValid(int year, int month, int day, int hour=0, int minute=0, int second=0, int millisecond=0, int microsecond=0)
bool operator!=(const DateTime &dateTime) const
Definition DateTime.h:398
static bool isLeapYear(int year)
Converts a UTC time into a local time, by applying the given time zone differential.
Definition DateTime.h:428
void makeUTC(int tzd)
Converts DateTime to tm struct.
DateTime(double julianDay)
int microsecond() const
Returns the millisecond (0 to 999)
Definition DateTime.h:386
Timestamp::UtcTimeVal utcTime() const
Returns the date and time expressed as a Timestamp.
Definition DateTime.h:315
Months
Symbolic names for month numbers (1 to 12).
Definition DateTime.h:66
bool operator<(const DateTime &dateTime) const
Definition DateTime.h:404
void computeDaytime()
int hour() const
Definition DateTime.h:339
DateTime & operator=(double julianDay)
Assigns a Timestamp.
bool operator>(const DateTime &dateTime) const
Definition DateTime.h:416
bool operator>=(const DateTime &dateTime) const
Definition DateTime.h:422
bool isPM() const
Returns true if hour < 12;.
Definition DateTime.h:362
int day() const
Definition DateTime.h:333
short _microsecond
Definition DateTime.h:287
int dayOfYear() const
int hourAMPM() const
Returns the hour (0 to 23).
Definition DateTime.h:345
double julianDay() const
Returns the microsecond (0 to 999)
static double toJulianDay(int year, int month, int day, int hour=0, int minute=0, int second=0, int millisecond=0, int microsecond=0)
Computes the Julian day for an UTC time.
DaysOfWeek
Symbolic names for week day numbers (0 to 6).
Definition DateTime.h:83
DateTime & operator=(const DateTime &dateTime)
Destroys the DateTime.
void makeLocal(int tzd)
Converts a local time into UTC, by applying the given time zone differential.
DateTime(const Timestamp &timestamp)
Creates a DateTime from tm struct.
static double toJulianDay(Timestamp::UtcTimeVal utcTime)
Definition DateTime.h:296
Timespan operator-(const DateTime &dateTime) const
tm makeTM() const
DateTime operator-(const Timespan &span) const
DateTime & operator+=(const Timespan &span)
static Timestamp::UtcTimeVal toUtcTime(double julianDay)
Definition DateTime.h:303
Timestamp timestamp() const
Returns the julian day for the date and time.
Definition DateTime.h:309
int week(int firstDayOfWeek=MONDAY) const
Returns the month (1 to 12).
int second() const
Returns the minute (0 to 59).
Definition DateTime.h:374
~DateTime()
Copy constructor. Creates the DateTime from another one.
bool operator==(const DateTime &dateTime) const
Definition DateTime.h:392
int year() const
Swaps the DateTime with another one.
Definition DateTime.h:321
static int daysOfMonth(int year, int month)
void computeGregorian(double julianDay)
Computes the UTC time for a Julian day.
int dayOfWeek() const
Returns the day within the month (1 to 31).
DateTime & assign(int year, int month, int day, int hour=0, int minute=0, int second=0, int millisecond=0, int microseconds=0)
Assigns a Julian day.
void checkLimit(short &lower, short &higher, short limit)
Extracts the daytime (hours, minutes, seconds, etc.) from the stored utcTime.
DateTime(const DateTime &dateTime)
Timestamp::UtcTimeVal _utcTime
utility functions used to correct the overflow in computeGregorian
Definition DateTime.h:279
int month() const
Returns the year.
Definition DateTime.h:327
DateTime(int year, int month, int day, int hour=0, int minute=0, int second=0, int millisecond=0, int microsecond=0)
DateTime(const tm &tmStruct)
Creates a DateTime for the current date and time.
DateTime(Timestamp::UtcTimeVal utcTime, Timestamp::TimeDiff diff)
Creates a DateTime for the given Julian day.
DateTime & operator=(const Timestamp &timestamp)
Assigns another DateTime.
DateTime operator+(const Timespan &span) const
int minute() const
Returns true if hour >= 12.
Definition DateTime.h:368
bool isAM() const
Returns the hour (0 to 12).
Definition DateTime.h:356
virtual void updateImpl(const void *data, std::size_t length)=0
virtual const Digest & digest()=0
void update(char data)
DigestEngine & operator=(const DigestEngine &)
virtual std::size_t digestLength() const =0
Updates the digest with the given data.
DigestEngine(const DigestEngine &)
void update(const void *data, std::size_t length)
virtual void reset()=0
Returns the length of the digest in bytes.
virtual ~DigestEngine()
Exception(const Exception &exc)
virtual const char * what() const noexcept
Returns the name of the exception class.
const std::string & message() const
Definition Exception.h:116
void message(const std::string &msg)
Standard constructor.
Definition Exception.h:122
Exception(const std::string &msg, const Exception &nested, int code=0)
Creates an exception.
std::string _msg
Sets the extended message for the exception.
Definition Exception.h:101
Exception(const std::string &msg, const std::string &arg, int code=0)
Creates an exception.
const Exception * nested() const
Definition Exception.h:110
Exception * _pNested
Definition Exception.h:102
virtual Exception * clone() const
Exception & operator=(const Exception &exc)
Destroys the exception and deletes the nested exception.
Exception(int code=0)
virtual void rethrow() const
void extendedMessage(const std::string &arg)
Sets the message for the exception.
virtual const char * name() const noexcept
Assignment operator.
int code() const
Returns the message text.
Definition Exception.h:128
~Exception() noexcept
Copy constructor.
std::string displayText() const
Returns the exception code if defined.
Exception(const std::string &msg, int code=0)
virtual const char * className() const noexcept
Returns a static string describing the exception.
void unlock()
Definition Mutex.h:333
bool tryLock(long milliseconds)
Definition Mutex.h:327
~FastMutex()
creates the Mutex.
void lock()
destroys the Mutex.
Definition Mutex.h:308
bool tryLock()
Definition Mutex.h:321
FastMutex(const FastMutex &)
void lock(long milliseconds)
Definition Mutex.h:314
FastMutex & operator=(const FastMutex &)
bool tryLock(long milliseconds)
Definition Mutex.h:292
void lock(long milliseconds)
Definition Mutex.h:279
void unlock()
Definition Mutex.h:298
void lock()
destroys the Mutex.
Definition Mutex.h:273
Mutex & operator=(const Mutex &)
bool tryLock()
Definition Mutex.h:286
Mutex(const Mutex &)
~Mutex()
creates the Mutex.
bool tryLockImpl(long milliseconds)
void init(const Params &params)
void setSessionCacheSize(std::size_t size)
Returns true iff the session cache is enabled.
std::size_t getSessionCacheSize() const
Context::VerificationMode verificationMode() const
Returns true iff the context is for use by a server.
Definition Context.h:466
void requireMinimumProtocol(Protocols protocol)
void enableExtendedCertificateVerification(bool flag=true)
void setInvalidCertificateHandler(InvalidCertificateHandlerPtr pInvalidCertificageHandler)
Usage _usage
Create a SSL_CTX object according to Context configuration.
Definition Context.h:437
Usage usage() const
Returns the underlying OpenSSL SSL Context object.
Definition Context.h:449
SSL_CTX * sslContext() const
Definition Context.h:472
long getSessionTimeout() const
void usePrivateKey(const Poco::Crypto::RSAKey &key)
Add one trusted certification authority to be used by the Context.
void enableSessionCache(bool flag=true)
Returns the verification mode.
void addCertificateAuthority(const Poco::Crypto::X509Certificate &certificate)
Adds a certificate for certificate chain validation.
void usePrivateKey(const Poco::Crypto::EVPPKey &pkey)
bool extendedCertificateVerificationEnabled() const
Definition Context.h:478
bool isForServerUse() const
Definition Context.h:455
void addChainCertificate(const Poco::Crypto::X509Certificate &certificate)
bool _ocspStaplingResponseVerification
Definition Context.h:441
bool ocspStaplingResponseVerificationEnabled() const
Definition Context.h:484
bool _extendedCertificateVerification
Definition Context.h:440
VerificationMode _mode
Definition Context.h:438
@ SERVER_USE
DEPRECATED. Context is used by a client.
Definition Context.h:71
@ TLSV1_2_CLIENT_USE
DEPRECATED. Context is used by a server requiring TLSv1.1 (OpenSSL 1.0.0 or newer).
Definition Context.h:76
@ TLSV1_CLIENT_USE
DEPRECATED. Context is used by a server.
Definition Context.h:72
@ TLSV1_3_SERVER_USE
DEPRECATED. Context is used by a client requiring TLSv1.3 (OpenSSL 1.1.1 or newer).
Definition Context.h:79
@ CLIENT_USE
Context is used by a client for TLSv1 or higher. Use requireMinimumProtocol() or disableProtocols() t...
Definition Context.h:70
@ TLSV1_2_SERVER_USE
DEPRECATED. Context is used by a client requiring TLSv1.2 (OpenSSL 1.0.1 or newer).
Definition Context.h:77
@ TLSV1_SERVER_USE
DEPRECATED. Context is used by a client requiring TLSv1.
Definition Context.h:73
@ TLSV1_3_CLIENT_USE
DEPRECATED. Context is used by a server requiring TLSv1.2 (OpenSSL 1.0.1 or newer).
Definition Context.h:78
@ TLS_SERVER_USE
Context is used by a client for TLSv1 or higher. Use requireMinimumProtocol() or disableProtocols() t...
Definition Context.h:69
@ TLSV1_1_CLIENT_USE
DEPRECATED. Context is used by a server requiring TLSv1.
Definition Context.h:74
@ TLSV1_1_SERVER_USE
DEPRECATED. Context is used by a client requiring TLSv1.1 (OpenSSL 1.0.0 or newer).
Definition Context.h:75
void useCertificate(const Poco::Crypto::X509Certificate &certificate)
Destroys the Context.
void preferServerCiphers()
Context(Usage usage, const Params &params)
InvalidCertificateHandlerPtr _pInvalidCertificateHandler
Definition Context.h:442
void setSessionTimeout(long seconds)
InvalidCertificateHandlerPtr getInvalidCertificateHandler() const
Definition Context.h:490
void disableStatelessSessionResumption()
bool sessionCacheEnabled() const
void disableProtocols(int protocols)
SSL_CTX * _pSSLContext
Definition Context.h:439
virtual std::istream & receiveResponse(HTTPResponse &response)
virtual std::ostream & sendRequest(HTTPRequest &request)
Returns the connection timeout for HTTP connections.
static const std::string HTTP_1_1
void setContentLength(std::streamsize length)
Returns the HTTP version for this message.
HTTPRequest(const std::string &method, const std::string &uri, const std::string &version)
Creates a HTTP/1.0 request with the given method and URI.
static const std::string HTTP_GET
static const std::string HTTP_DELETE
static const std::string HTTP_POST
const std::string & getReason() const
Sets the HTTP reason phrase.
HTTPResponse(HTTPStatus status)
HTTPStatus getStatus() const
HTTPSClientSession(const std::string &host, Poco::UInt16 port, Context::Ptr pContext, Session::Ptr pSession)
std::string proxyRequestPrefix() const
Sends the given HTTPRequest over an existing connection.
HTTPSClientSession(Context::Ptr pContext, Session::Ptr pSession)
HTTPSClientSession(Context::Ptr pContext)
Creates a HTTPSClientSession using the given host and port.
void proxyAuthenticate(HTTPRequest &request)
Checks if we can reuse a persistent connection.
int read(char *buffer, std::streamsize length)
HTTPSClientSession(const HTTPSClientSession &)
void connect(const SocketAddress &address)
Refills the internal buffer.
HTTPSClientSession(const SecureStreamSocket &socket, Session::Ptr pSession)
X509Certificate serverCertificate()
HTTPSClientSession & operator=(const HTTPSClientSession &)
HTTPSClientSession(const std::string &host, Poco::UInt16 port=HTTPS_PORT)
HTTPSClientSession(const SecureStreamSocket &socket)
Creates an unconnected HTTPSClientSession.
HTTPSClientSession(const std::string &host, Poco::UInt16 port, Context::Ptr pContext)
InvalidCertificateHandler(bool handleErrorsOnServerSide)
virtual void onInvalidCertificate(const void *pSender, VerificationErrorArgs &errorCert)=0
Destroys the InvalidCertificateHandler.
RejectCertificateHandler(bool handleErrorsOnServerSide)
void initializeClient(PrivateKeyPassphraseHandlerPtr ptrPassphraseHandler, InvalidCertificateHandlerPtr ptrHandler, Context::Ptr ptrContext)
static SSLManager & instance()
static std::string convertCertificateError(long errCode)
static std::string getLastError()
Converts an SSL certificate handling error code into an error message.
static void clearErrorStack()
Returns the last error from the error stack.
A utility class for certificate error handling.
void unlock()
Does nothing.
Definition Mutex.h:258
void lock(long)
Does nothing.
Definition Mutex.h:241
NullMutex()
Creates the NullMutex.
Definition Mutex.h:226
bool tryLock()
Does nothing and always returns true.
Definition Mutex.h:246
void lock()
Does nothing.
Definition Mutex.h:236
~NullMutex()
Destroys the NullMutex.
Definition Mutex.h:231
bool tryLock(long)
Does nothing and always returns true.
Definition Mutex.h:252
This stream discards all characters written to it.
Definition NullStream.h:77
ScopedLock(M &mutex, long milliseconds)
Definition ScopedLock.h:41
ScopedLock(const ScopedLock &)
ScopedLock(M &mutex)
Definition ScopedLock.h:36
ScopedLock & operator=(const ScopedLock &)
ScopedLockWithUnlock & operator=(const ScopedLockWithUnlock &)
ScopedLockWithUnlock(const ScopedLockWithUnlock &)
ScopedLockWithUnlock(M &mutex, long milliseconds)
Definition ScopedLock.h:83
static std::streamsize copyStream(std::istream &istr, std::ostream &ostr, std::size_t bufferSize=8192)
A class that represents time spans up to microsecond resolution.
Definition Timespan.h:30
Timestamp & operator=(const Timestamp &other)
Destroys the timestamp.
Timestamp & operator+=(TimeDiff d)
Definition Timestamp.h:210
Timestamp & operator-=(TimeDiff d)
Definition Timestamp.h:217
Timestamp(TimeVal tv)
Creates a timestamp with the current time.
Timestamp & operator=(TimeVal tv)
bool isElapsed(TimeDiff interval) const
Definition Timestamp.h:249
static const TimeVal TIMEVAL_MIN
Difference between two TimeVal values in microseconds.
Definition Timestamp.h:61
TimeVal epochMicroseconds() const
Definition Timestamp.h:236
static Timestamp fromUtcTime(UtcTimeVal val)
Creates a timestamp from a std::time_t.
TimeDiff elapsed() const
Definition Timestamp.h:242
static TimeDiff resolution()
Definition Timestamp.h:257
bool operator<=(const Timestamp &ts) const
Definition Timestamp.h:186
Timestamp operator+(const Timespan &span) const
std::time_t epochTime() const
Definition Timestamp.h:224
~Timestamp()
Copy constructor.
Timestamp operator-(const Timespan &span) const
bool operator==(const Timestamp &ts) const
Updates the Timestamp with the current time.
Definition Timestamp.h:156
bool operator>=(const Timestamp &ts) const
Definition Timestamp.h:174
Timestamp & operator-=(const Timespan &span)
UtcTimeVal utcTime() const
Definition Timestamp.h:230
Timestamp operator+(TimeDiff d) const
Definition Timestamp.h:192
bool operator<(const Timestamp &ts) const
Definition Timestamp.h:180
static Timestamp fromEpochTime(std::time_t t)
Timestamp()
Maximum timestamp value.
bool operator!=(const Timestamp &ts) const
Definition Timestamp.h:162
static const TimeVal TIMEVAL_MAX
Minimum timestamp value.
Definition Timestamp.h:62
TimeDiff operator-(const Timestamp &ts) const
Definition Timestamp.h:204
Timestamp & operator+=(const Timespan &span)
bool operator>(const Timestamp &ts) const
Definition Timestamp.h:168
Timestamp(const Timestamp &other)
void swap(Timestamp &timestamp)
Timestamp operator-(TimeDiff d) const
Definition Timestamp.h:198
TimeVal raw() const
Definition Timestamp.h:269
void update()
Swaps the Timestamp with another one.
const std::string & getHost() const
Sets the user-info part of the URI.
Definition URI.h:385
const std::string & getScheme() const
Definition URI.h:373
URI(const std::string &uri)
Creates an empty URI.
unsigned short getPort() const
Sets the host part of the URI.
std::string getPathAndQuery() const
Returns the encoded path, query and fragment parts of the URI.
FormatError(CStringRef message)
Definition format.h:686
void error(const T &)
int ERR_load_CRYPTO_strings(void)
#define ossl_unused
Definition e_os2.h:294
#define ossl_inline
Definition e_os2.h:276
#define ossl_ssize_t
Definition e_os2.h:214
#define __owur
Definition e_os2.h:227
#define ossl_noreturn
Definition e_os2.h:287
Definition IBaseApi.h:9
std::unique_ptr< IBaseApi > game_api
Definition IBaseApi.h:25
void Crypto_API uninitializeCrypto()
void Crypto_API initializeCrypto()
std::vector< SocketBuf > SocketBufVec
Definition SocketDefs.h:365
void NetSSL_API initializeSSL()
void Net_API uninitializeNetwork()
void Net_API initializeNetwork()
void NetSSL_API uninitializeSSL()
void swap(Timestamp &s1, Timestamp &s2)
Definition Timestamp.h:263
void swap(DateTime &d1, DateTime &d2)
Definition DateTime.h:434
MutexImpl FastMutexImpl
Definition Mutex_WIN32.h:44
Null localtime_s(...)
Definition time.h:60
Null gmtime_r(...)
Definition time.h:61
Null localtime_r(...)
Definition time.h:59
Null gmtime_s(...)
Definition time.h:62
Definition format.h:408
void format_arg(BasicFormatter< char, ArgFormatter > &f, const char *&format_str, const std::tm &tm)
Definition time.h:24
Definition json.hpp:4518
int CRYPTO_secure_malloc_done(void)
int CRYPTO_THREAD_compare_id(CRYPTO_THREAD_ID a, CRYPTO_THREAD_ID b)
void OPENSSL_thread_stop(void)
void CRYPTO_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad)
int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock)
void CRYPTO_EX_new(void *parent, void *ptr, CRYPTO_EX_DATA *ad, int idx, long argl, void *argp)
Definition crypto.h:166
size_t OPENSSL_strlcpy(char *dst, const char *src, size_t siz)
int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock)
void * CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
int CRYPTO_mem_ctrl(int mode)
void * CRYPTO_clear_realloc(void *addr, size_t old_num, size_t num, const char *file, int line)
void OPENSSL_INIT_set_config_file_flags(OPENSSL_INIT_SETTINGS *settings, unsigned long flags)
int CRYPTO_set_mem_functions(void *(*m)(size_t, const char *, int), void *(*r)(void *, size_t, const char *, int), void(*f)(void *, const char *, int))
#define OPENSSL_INIT_ENGINE_PADLOCK
Definition crypto.h:370
int OPENSSL_gmtime_adj(struct tm *tm, int offset_day, long offset_sec)
#define OPENSSL_INIT_ENGINE_RDRAND
Definition crypto.h:365
void OPENSSL_cleanse(void *ptr, size_t len)
int CRYPTO_new_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad)
unsigned long OpenSSL_version_num(void)
int OPENSSL_isservice(void)
#define OPENSSL_DIR
Definition crypto.h:161
int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void(*cleanup)(void *))
void CRYPTO_free(void *ptr, const char *file, int line)
int OPENSSL_INIT_set_config_filename(OPENSSL_INIT_SETTINGS *settings, const char *config_filename)
size_t OPENSSL_strnlen(const char *str, size_t maxlen)
int CRYPTO_THREAD_write_lock(CRYPTO_RWLOCK *lock)
unsigned char * OPENSSL_hexstr2buf(const char *str, long *len)
int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings)
int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val)
void CRYPTO_get_mem_functions(void *(**m)(size_t, const char *, int), void *(**r)(void *, size_t, const char *, int), void(**f)(void *, const char *, int))
#define OPENSSL_BUILT_ON
Definition crypto.h:159
int OPENSSL_atexit(void(*handler)(void))
#define OPENSSL_CFLAGS
Definition crypto.h:158
void * CRYPTO_malloc(size_t num, const char *file, int line)
int CRYPTO_THREAD_cleanup_local(CRYPTO_THREAD_LOCAL *key)
int CRYPTO_secure_allocated(const void *ptr)
#define OPENSSL_VERSION
Definition crypto.h:157
int CRYPTO_secure_malloc_init(size_t sz, int minsize)
int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void(*init)(void))
char * CRYPTO_strdup(const char *str, const char *file, int line)
char * CRYPTO_strndup(const char *str, size_t s, const char *file, int line)
size_t CRYPTO_secure_actual_size(void *ptr)
void * CRYPTO_secure_malloc(size_t num, const char *file, int line)
#define CRYPTO_ONCE_STATIC_INIT
Definition crypto.h:428
int CRYPTO_free_ex_index(int class_index, int idx)
void CRYPTO_clear_free(void *ptr, size_t num, const char *file, int line)
void * CRYPTO_memdup(const void *str, size_t siz, const char *file, int line)
void CRYPTO_EX_free(void *parent, void *ptr, CRYPTO_EX_DATA *ad, int idx, long argl, void *argp)
Definition crypto.h:168
size_t CRYPTO_secure_used(void)
int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from, void *from_d, int idx, long argl, void *argp)
Definition crypto.h:170
void CRYPTO_RWLOCK
Definition crypto.h:67
int CRYPTO_THREAD_unlock(CRYPTO_RWLOCK *lock)
void * CRYPTO_secure_zalloc(size_t num, const char *file, int line)
int CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len)
int FIPS_mode(void)
void OPENSSL_INIT_free(OPENSSL_INIT_SETTINGS *settings)
CRYPTO_THREAD_ID CRYPTO_THREAD_get_current_id(void)
char * OPENSSL_buf2hexstr(const unsigned char *buffer, long len)
size_t OPENSSL_strlcat(char *dst, const char *src, size_t siz)
#define OPENSSL_INIT_ENGINE_CAPI
Definition crypto.h:369
int CRYPTO_dup_ex_data(int class_index, CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from)
__owur int CRYPTO_get_ex_new_index(int class_index, long argl, void *argp, CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)
void CRYPTO_THREAD_lock_free(CRYPTO_RWLOCK *lock)
void OPENSSL_cleanup(void)
void * CRYPTO_realloc(void *addr, size_t num, const char *file, int line)
OPENSSL_INIT_SETTINGS * OPENSSL_INIT_new(void)
void OPENSSL_init(void)
void * CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key)
int CRYPTO_set_mem_debug(int flag)
int OPENSSL_INIT_set_config_appname(OPENSSL_INIT_SETTINGS *settings, const char *config_appname)
#define OPENSSL_PLATFORM
Definition crypto.h:160
int OPENSSL_hexchar2int(unsigned char c)
int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int idx, void *val)
CRYPTO_RWLOCK * CRYPTO_THREAD_lock_new(void)
int OPENSSL_issetugid(void)
#define OPENSSL_INIT_ENGINE_DYNAMIC
Definition crypto.h:366
void CRYPTO_secure_free(void *ptr, const char *file, int line)
void * CRYPTO_zalloc(size_t num, const char *file, int line)
int CRYPTO_secure_malloc_initialized(void)
ossl_noreturn void OPENSSL_die(const char *assertion, const char *file, int line)
int OPENSSL_gmtime_diff(int *pday, int *psec, const struct tm *from, const struct tm *to)
const char * OpenSSL_version(int type)
#define OPENSSL_INIT_ENGINE_CRYPTODEV
Definition crypto.h:368
struct tm * OPENSSL_gmtime(const time_t *timer, struct tm *result)
void CRYPTO_secure_clear_free(void *ptr, size_t num, const char *file, int line)
int FIPS_mode_set(int r)
#define OPENSSL_EXPORT_VAR_AS_FUNCTION
#define OPENSSL_API_COMPAT
#define OPENSSL_MIN_API
#define OPENSSL_THREADS
Definition opensslconf.h:37
#define DECLARE_DEPRECATED(f)
#define OPENSSL_FILE
#define OPENSSL_NO_CRYPTO_MDEBUG
Definition opensslconf.h:49
#define OPENSSL_LINE
#define OPENSSL_VERSION_NUMBER
Definition opensslv.h:42
struct bignum_ctx BN_CTX
Definition ossl_typ.h:81
struct x509_lookup_method_st X509_LOOKUP_METHOD
Definition ossl_typ.h:133
struct asn1_string_st ASN1_PRINTABLESTRING
Definition ossl_typ.h:44
struct asn1_string_st ASN1_IA5STRING
Definition ossl_typ.h:46
long ossl_intmax_t
Definition ossl_typ.h:190
struct evp_md_ctx_st EVP_MD_CTX
Definition ossl_typ.h:92
struct ocsp_response_st OCSP_RESPONSE
Definition ossl_typ.h:167
struct asn1_string_st ASN1_UNIVERSALSTRING
Definition ossl_typ.h:48
struct ssl_ctx_st SSL_CTX
Definition ossl_typ.h:149
struct asn1_string_st ASN1_T61STRING
Definition ossl_typ.h:45
struct conf_st CONF
Definition ossl_typ.h:141
struct sct_st SCT
Definition ossl_typ.h:170
struct AUTHORITY_KEYID_st AUTHORITY_KEYID
Definition ossl_typ.h:159
struct ctlog_store_st CTLOG_STORE
Definition ossl_typ.h:173
struct evp_pkey_st EVP_PKEY
Definition ossl_typ.h:93
struct bn_blinding_st BN_BLINDING
Definition ossl_typ.h:82
struct v3_ext_ctx X509V3_CTX
Definition ossl_typ.h:140
struct x509_store_st X509_STORE
Definition ossl_typ.h:128
struct X509_POLICY_TREE_st X509_POLICY_TREE
Definition ossl_typ.h:156
struct DIST_POINT_st DIST_POINT
Definition ossl_typ.h:160
struct asn1_string_st ASN1_ENUMERATED
Definition ossl_typ.h:41
struct x509_st X509
Definition ossl_typ.h:121
struct X509_POLICY_NODE_st X509_POLICY_NODE
Definition ossl_typ.h:154
struct evp_cipher_st EVP_CIPHER
Definition ossl_typ.h:89
struct rsa_meth_st RSA_METHOD
Definition ossl_typ.h:111
struct dh_st DH
Definition ossl_typ.h:104
struct X509_name_st X509_NAME
Definition ossl_typ.h:126
struct dh_method DH_METHOD
Definition ossl_typ.h:105
struct sct_ctx_st SCT_CTX
Definition ossl_typ.h:171
struct bn_recp_ctx_st BN_RECP_CTX
Definition ossl_typ.h:84
struct dsa_method DSA_METHOD
Definition ossl_typ.h:108
struct asn1_sctx_st ASN1_SCTX
Definition ossl_typ.h:64
struct NAME_CONSTRAINTS_st NAME_CONSTRAINTS
Definition ossl_typ.h:162
struct ui_st UI
Definition ossl_typ.h:144
struct bignum_st BIGNUM
Definition ossl_typ.h:80
struct ssl_st SSL
Definition ossl_typ.h:148
struct evp_Encode_Ctx_st EVP_ENCODE_CTX
Definition ossl_typ.h:100
struct asn1_string_st ASN1_GENERALSTRING
Definition ossl_typ.h:47
struct ec_key_st EC_KEY
Definition ossl_typ.h:114
struct ossl_store_info_st OSSL_STORE_INFO
Definition ossl_typ.h:176
struct rsa_pss_params_st RSA_PSS_PARAMS
Definition ossl_typ.h:112
struct evp_pkey_method_st EVP_PKEY_METHOD
Definition ossl_typ.h:97
struct x509_revoked_st X509_REVOKED
Definition ossl_typ.h:125
struct crypto_ex_data_st CRYPTO_EX_DATA
Definition ossl_typ.h:164
struct asn1_pctx_st ASN1_PCTX
Definition ossl_typ.h:63
struct ocsp_responder_id_st OCSP_RESPID
Definition ossl_typ.h:168
struct ct_policy_eval_ctx_st CT_POLICY_EVAL_CTX
Definition ossl_typ.h:174
struct ctlog_st CTLOG
Definition ossl_typ.h:172
struct X509_pubkey_st X509_PUBKEY
Definition ossl_typ.h:127
struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL
Definition ossl_typ.h:155
struct ISSUING_DIST_POINT_st ISSUING_DIST_POINT
Definition ossl_typ.h:161
struct comp_ctx_st COMP_CTX
Definition ossl_typ.h:151
struct rsa_st RSA
Definition ossl_typ.h:110
struct ossl_init_settings_st OPENSSL_INIT_SETTINGS
Definition ossl_typ.h:142
struct comp_method_st COMP_METHOD
Definition ossl_typ.h:152
struct hmac_ctx_st HMAC_CTX
Definition ossl_typ.h:102
struct dsa_st DSA
Definition ossl_typ.h:107
struct X509_algor_st X509_ALGOR
Definition ossl_typ.h:122
struct evp_pkey_ctx_st EVP_PKEY_CTX
Definition ossl_typ.h:98
struct evp_cipher_ctx_st EVP_CIPHER_CTX
Definition ossl_typ.h:90
struct buf_mem_st BUF_MEM
Definition ossl_typ.h:87
struct pkcs8_priv_key_info_st PKCS8_PRIV_KEY_INFO
Definition ossl_typ.h:138
int ASN1_BOOLEAN
Definition ossl_typ.h:56
struct engine_st ENGINE
Definition ossl_typ.h:147
struct x509_crl_method_st X509_CRL_METHOD
Definition ossl_typ.h:124
struct asn1_string_st ASN1_BMPSTRING
Definition ossl_typ.h:49
struct asn1_string_st ASN1_GENERALIZEDTIME
Definition ossl_typ.h:52
struct ossl_store_search_st OSSL_STORE_SEARCH
Definition ossl_typ.h:177
struct X509_crl_st X509_CRL
Definition ossl_typ.h:123
struct X509_POLICY_CACHE_st X509_POLICY_CACHE
Definition ossl_typ.h:157
struct ssl_dane_st SSL_DANE
Definition ossl_typ.h:120
struct asn1_string_st ASN1_STRING
Definition ossl_typ.h:55
struct evp_pkey_asn1_method_st EVP_PKEY_ASN1_METHOD
Definition ossl_typ.h:95
struct asn1_string_st ASN1_UTF8STRING
Definition ossl_typ.h:54
struct X509_VERIFY_PARAM_st X509_VERIFY_PARAM
Definition ossl_typ.h:134
struct x509_object_st X509_OBJECT
Definition ossl_typ.h:131
struct asn1_string_st ASN1_TIME
Definition ossl_typ.h:51
struct rand_drbg_st RAND_DRBG
Definition ossl_typ.h:118
struct evp_md_st EVP_MD
Definition ossl_typ.h:91
struct bn_gencb_st BN_GENCB
Definition ossl_typ.h:85
struct ui_method_st UI_METHOD
Definition ossl_typ.h:145
struct asn1_object_st ASN1_OBJECT
Definition ossl_typ.h:60
struct x509_store_ctx_st X509_STORE_CTX
Definition ossl_typ.h:129
unsigned long ossl_uintmax_t
Definition ossl_typ.h:191
struct ASN1_ITEM_st ASN1_ITEM
Definition ossl_typ.h:62
struct rand_meth_st RAND_METHOD
Definition ossl_typ.h:117
struct bn_mont_ctx_st BN_MONT_CTX
Definition ossl_typ.h:83
struct x509_sig_info_st X509_SIG_INFO
Definition ossl_typ.h:136
int ASN1_NULL
Definition ossl_typ.h:57
struct bio_st BIO
Definition ossl_typ.h:79
struct asn1_string_st ASN1_INTEGER
Definition ossl_typ.h:40
struct asn1_string_st ASN1_BIT_STRING
Definition ossl_typ.h:42
struct ocsp_req_ctx_st OCSP_REQ_CTX
Definition ossl_typ.h:166
struct asn1_string_st ASN1_UTCTIME
Definition ossl_typ.h:50
struct asn1_string_st ASN1_OCTET_STRING
Definition ossl_typ.h:43
struct ec_key_method_st EC_KEY_METHOD
Definition ossl_typ.h:115
struct asn1_string_st ASN1_VISIBLESTRING
Definition ossl_typ.h:53
struct x509_lookup_st X509_LOOKUP
Definition ossl_typ.h:132
char * OPENSSL_STRING
Definition safestack.h:149
#define DEFINE_SPECIAL_STACK_OF(t1, t2)
Definition safestack.h:129
#define SKM_DEFINE_STACK_OF(t1, t2, t3)
Definition safestack.h:22
const char * OPENSSL_CSTRING
Definition safestack.h:150
#define DEFINE_STACK_OF(t)
Definition safestack.h:130
#define DEFINE_SPECIAL_STACK_OF_CONST(t1, t2)
Definition safestack.h:131
void * OPENSSL_BLOCK
Definition safestack.h:166
#define STACK_OF(type)
Definition safestack.h:20
#define SSL_VERIFY_NONE
Definition ssl.h:1099
#define SSL_VERIFY_FAIL_IF_NO_PEER_CERT
Definition ssl.h:1101
#define SSL_VERIFY_PEER
Definition ssl.h:1100
#define SSL_VERIFY_CLIENT_ONCE
Definition ssl.h:1102
void(* OPENSSL_sk_freefunc)(void *)
Definition stack.h:20
void * OPENSSL_sk_delete_ptr(OPENSSL_STACK *st, const void *p)
void * OPENSSL_sk_delete(OPENSSL_STACK *st, int loc)
int OPENSSL_sk_reserve(OPENSSL_STACK *st, int n)
void OPENSSL_sk_zero(OPENSSL_STACK *st)
OPENSSL_STACK * OPENSSL_sk_deep_copy(const OPENSSL_STACK *, OPENSSL_sk_copyfunc c, OPENSSL_sk_freefunc f)
int OPENSSL_sk_is_sorted(const OPENSSL_STACK *st)
OPENSSL_STACK * OPENSSL_sk_new(OPENSSL_sk_compfunc cmp)
OPENSSL_STACK * OPENSSL_sk_new_null(void)
struct stack_st OPENSSL_STACK
Definition stack.h:17
int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data)
int(* OPENSSL_sk_compfunc)(const void *, const void *)
Definition stack.h:19
OPENSSL_sk_compfunc OPENSSL_sk_set_cmp_func(OPENSSL_STACK *sk, OPENSSL_sk_compfunc cmp)
OPENSSL_STACK * OPENSSL_sk_dup(const OPENSSL_STACK *st)
int OPENSSL_sk_insert(OPENSSL_STACK *sk, const void *data, int where)
void * OPENSSL_sk_set(OPENSSL_STACK *st, int i, const void *data)
int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data)
int OPENSSL_sk_unshift(OPENSSL_STACK *st, const void *data)
void * OPENSSL_sk_pop(OPENSSL_STACK *st)
int OPENSSL_sk_find_ex(OPENSSL_STACK *st, const void *data)
int OPENSSL_sk_num(const OPENSSL_STACK *)
void *(* OPENSSL_sk_copyfunc)(const void *)
Definition stack.h:21
void OPENSSL_sk_pop_free(OPENSSL_STACK *st, void(*func)(void *))
void * OPENSSL_sk_shift(OPENSSL_STACK *st)
void OPENSSL_sk_sort(OPENSSL_STACK *st)
OPENSSL_STACK * OPENSSL_sk_new_reserve(OPENSSL_sk_compfunc c, int n)
void * OPENSSL_sk_value(const OPENSSL_STACK *, int)
void OPENSSL_sk_free(OPENSSL_STACK *)
std::function< void(bool, std::string)> callback
Definition Requests.cpp:41
Family
Possible address families for socket addresses.
Definition SocketDefs.h:373
std::string privateKeyFile
Initializes the struct with default values.
Definition Context.h:134
std::string certificateFile
Definition Context.h:138
VerificationMode verificationMode
Definition Context.h:149
static std::string escape(const std::string &s, bool strictJSON=false)
#define FMT_THROW(x)
Definition format.h:222
#define FMT_NULL
Definition format.h:273