33 #pragma warning(disable : 4710)
34 #pragma warning(disable : 4711)
35 #pragma warning(disable : 4251)
36 #pragma warning(disable : 4371)
37 #pragma warning(disable : 4514)
38 #pragma warning(disable : 4623)
39 #pragma warning(disable : 4625)
40 #pragma warning(disable : 4626)
41 #pragma warning(disable : 4820)
42 #pragma warning(disable : 5267)
43 #pragma warning(disable : 5026)
44 #pragma warning(disable : 5027)
45 #pragma warning(disable : 5045)
46 #pragma warning(disable : 5246)
49#if defined(__clang__) && defined(NDEBUG) && !defined(DCA_INLINE)
50 #define DCA_INLINE inline __attribute__((always_inline))
51#elif !defined(DCA_INLINE)
52 #define DCA_INLINE inline
55#if !defined(DCA_CPU_INSTRUCTIONS)
56 #define DCA_CPU_INSTRUCTIONS 0
59#if !defined(DCA_CHECK_FOR_INSTRUCTION)
60 #define DCA_CHECK_FOR_INSTRUCTION(x) (DCA_CPU_INSTRUCTIONS & x)
63#if !defined(DCA_CHECK_FOR_AVX)
64 #define DCA_CHECK_FOR_AVX(x) (DCA_CPU_INSTRUCTIONS >= x)
68 #define DCA_NEON (1 << 4)
71 #define DCA_AVX (1 << 5)
74 #define DCA_AVX2 (1 << 6)
76#if !defined(DCA_AVX512)
77 #define DCA_AVX512 (1 << 7)
81 #if !defined DiscordCoreAPI_EXPORTS_NOPE
82 #if defined DiscordCoreAPI_EXPORTS
83 #if !defined DiscordCoreAPI_Dll
84 #define DiscordCoreAPI_Dll __declspec(dllexport)
87 #if !defined DiscordCoreAPI_Dll
88 #define DiscordCoreAPI_Dll __declspec(dllimport)
92 #define DiscordCoreAPI_Dll
94 #if !defined WIN32_LEAN_AND_MEAN
95 #define WIN32_LEAN_AND_MEAN
97 #if !defined WINRT_LEAN_AND_MEAN
98 #define WINRT_LEAN_AND_MEAN
100 #if !defined(NOMINMAX)
104DCA_INLINE tm getTime(time_t time) {
106 gmtime_s(&timeNew, &time);
109 #include <WinSock2.h>
111 #if !defined DiscordCoreAPI_Dll
112 #define DiscordCoreAPI_Dll
114 #include <arpa/inet.h>
115 #include <sys/time.h>
121DCA_INLINE tm getTime(time_t time) {
122 return *gmtime(&time);
126#include <jsonifier/Index.hpp>
128#include <source_location>
129#include <shared_mutex>
130#include <immintrin.h>
146using namespace std::literals;
191 DCA_INLINE
thread_local jsonifier::jsonifier_core<false> parser{};
193 template<
typename value_type>
using stop_watch = jsonifier_internal::stop_watch<value_type>;
194 using sys_clock = std::chrono::system_clock;
195 using hrclock = std::chrono::high_resolution_clock;
196 using milliseconds = std::chrono::duration<int64_t, std::milli>;
197 using microseconds = std::chrono::duration<int64_t, std::micro>;
198 using nanoseconds = std::chrono::duration<int64_t, std::nano>;
199 using seconds = std::chrono::duration<int64_t, std::ratio<1, 1>>;
201 enum class print_message_type {
207 constexpr jsonifier::string_view shiftToBrightGreen() {
208 return "\033[1;40;92m";
211 constexpr jsonifier::string_view shiftToBrightBlue() {
212 return "\033[1;40;96m";
215 constexpr jsonifier::string_view shiftToBrightRed() {
216 return "\033[1;40;91m";
219 constexpr jsonifier::string_view reset() {
231 DCA_INLINE message_printer() =
default;
236 template<
typename value_type> DCA_INLINE
static void initialize(
const value_type& other) {
251 template<pr
int_message_type messageType,
typename string_type>
252 DCA_INLINE
static void printError(
const string_type& what, std::source_location where = std::source_location::current()) {
253 switch (messageType) {
254 case print_message_type::general: {
257 *
errorStream << shiftToBrightRed() <<
"General error, caught at: " << where.file_name() <<
", " << where.line() <<
":" << where.column()
258 <<
", in: " << where.function_name() <<
", it is: " << what << std::endl
259 << reset() << std::endl;
263 case print_message_type::websocket: {
266 *
errorStream << shiftToBrightRed() <<
"WebSocket error, caught at: " << where.file_name() <<
", " << where.line() <<
":" << where.column()
267 <<
", in: " << where.function_name() <<
", it is: " << what << std::endl
268 << reset() << std::endl;
272 case print_message_type::https: {
275 *
errorStream << shiftToBrightRed() <<
"Https error, caught at: " << where.file_name() <<
", " << where.line() <<
":" << where.column()
276 <<
", in: " << where.function_name() <<
", it is: " << what << std::endl
277 << reset() << std::endl;
288 template<pr
int_message_type messageType,
typename string_type>
289 DCA_INLINE
static void printSuccess(
const string_type& what, std::source_location where = std::source_location::current()) {
290 switch (messageType) {
291 case print_message_type::general: {
294 *
outputStream << shiftToBrightBlue() <<
"General success, caught at: " << where.file_name() <<
", " << where.line() <<
":" << where.column()
295 <<
", in: " << where.function_name() <<
", it is: " << what << std::endl
296 << reset() << std::endl;
300 case print_message_type::websocket: {
303 *
outputStream << shiftToBrightGreen() <<
"WebSocket success, caught at: " << where.file_name() <<
", " << where.line() <<
":" << where.column()
304 <<
", in: " << where.function_name() <<
", it is: " << what << std::endl
305 << reset() << std::endl;
309 case print_message_type::https: {
312 *
outputStream << shiftToBrightGreen() <<
"Https success, caught at: " << where.file_name() <<
", " << where.line() <<
":" << where.column()
313 <<
", in: " << where.function_name() <<
", it is: " << what << std::endl
314 << reset() << std::endl;
349 static constexpr uint64_t msPerSecond{ 1000ULL };
350 static constexpr uint64_t secondsPerMinute{ 60ULL };
351 static constexpr uint64_t minutesPerHour{ 60ULL };
352 static constexpr uint64_t msPerMinute{ msPerSecond * secondsPerMinute };
353 static constexpr uint64_t msPerHour{ msPerMinute * minutesPerHour };
354 static constexpr uint64_t secondsPerHour{ minutesPerHour * secondsPerMinute };
355 static constexpr uint64_t hoursPerDay{ 24ULL };
356 static constexpr uint64_t secondsPerDay{ secondsPerHour * hoursPerDay };
357 static constexpr uint64_t daysPerMonth{ 30ULL };
358 static constexpr uint64_t secondsPerMonth{ secondsPerDay * daysPerMonth };
359 static constexpr uint64_t daysPerYear{ 365ULL };
360 static constexpr uint64_t secondsPerYear{ secondsPerDay * daysPerYear };
364 DCA_INLINE
bool operator==(jsonifier::string_view other)
const {
365 return static_cast<jsonifier::string
>(*
static_cast<const value_type*
>(
this)) == other;
376 DCA_INLINE
static jsonifier::string
convertToFutureISO8601TimeStamp(uint64_t minutesToAdd, uint64_t hoursToAdd, uint64_t daysToAdd, uint64_t monthsToAdd, uint64_t yearsToAdd,
378 std::time_t result = std::time(
nullptr);
379 uint64_t secondsToAdd = (yearsToAdd * secondsPerYear) + (monthsToAdd * secondsPerMonth) + (daysToAdd * secondsPerDay) + ((hoursToAdd + 8) * secondsPerHour) +
380 (minutesToAdd * secondsPerMinute);
381 result += secondsToAdd;
382 std::tm resultTwo{ getTime(result) };
383 jsonifier::string returnString{};
384 if (resultTwo.tm_isdst) {
385 if (resultTwo.tm_hour + 4ULL >= 24) {
386 resultTwo.tm_hour = resultTwo.tm_hour - 24;
390 getMsSinceEpoch(
static_cast<uint64_t
>(resultTwo.tm_year) + 1900ULL,
static_cast<uint64_t
>(resultTwo.tm_mon) + 1ULL,
static_cast<uint64_t
>(resultTwo.tm_mday),
391 static_cast<uint64_t
>(resultTwo.tm_hour) + 4ULL,
static_cast<uint64_t
>(resultTwo.tm_min),
static_cast<uint64_t
>(resultTwo.tm_sec));
394 if (resultTwo.tm_hour + 5ULL >= 24) {
395 resultTwo.tm_hour = resultTwo.tm_hour - 24;
399 getMsSinceEpoch(
static_cast<uint64_t
>(resultTwo.tm_year) + 1900ULL,
static_cast<uint64_t
>(resultTwo.tm_mon) + 1ULL,
static_cast<uint64_t
>(resultTwo.tm_mday),
400 static_cast<uint64_t
>(resultTwo.tm_hour) + 5ULL,
static_cast<uint64_t
>(resultTwo.tm_min),
static_cast<uint64_t
>(resultTwo.tm_sec));
410 std::time_t result = std::time(
nullptr);
411 std::tm resultTwo{ getTime(result) };
412 jsonifier::string returnString{};
413 if (resultTwo.tm_isdst) {
414 if (resultTwo.tm_hour + 4ULL >= 24) {
415 resultTwo.tm_hour = resultTwo.tm_hour - 24;
419 getMsSinceEpoch(
static_cast<uint64_t
>(resultTwo.tm_year) + 1900ULL,
static_cast<uint64_t
>(resultTwo.tm_mon) + 1ULL,
static_cast<uint64_t
>(resultTwo.tm_mday),
420 static_cast<uint64_t
>(resultTwo.tm_hour) + 4ULL,
static_cast<uint64_t
>(resultTwo.tm_min),
static_cast<uint64_t
>(resultTwo.tm_sec));
423 if (resultTwo.tm_hour + 5ULL >= 24) {
424 resultTwo.tm_hour = resultTwo.tm_hour - 24;
428 getMsSinceEpoch(
static_cast<uint64_t
>(resultTwo.tm_year) + 1900ULL,
static_cast<uint64_t
>(resultTwo.tm_mon) + 1ULL,
static_cast<uint64_t
>(resultTwo.tm_mday),
429 static_cast<uint64_t
>(resultTwo.tm_hour) + 5ULL,
static_cast<uint64_t
>(resultTwo.tm_min),
static_cast<uint64_t
>(resultTwo.tm_sec));
440 DCA_INLINE
bool hasTimeElapsed(int64_t days, int64_t hours, int64_t minutes)
const {
441 int64_t startTimeRaw{
static_cast<int64_t
>(
convertTimeStampToTimeUnits(
static_cast<jsonifier::string
>(*
static_cast<const value_type*
>(
this)))) };
442 startTimeRaw = std::chrono::local_time<std::chrono::milliseconds>(std::chrono::milliseconds{ startTimeRaw }).time_since_epoch().count();
443 auto currentTime = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
444 auto targetElapsedTime =
445 ((
static_cast<int64_t
>(days) * secondsPerDay) + ((
static_cast<int64_t
>(hours)) * secondsPerHour) + (
static_cast<int64_t
>(minutes) * secondsPerMinute)) * 1000LL;
446 auto actualElapsedTime = currentTime - startTimeRaw;
447 if (actualElapsedTime <= 0) {
450 if (actualElapsedTime >= targetElapsedTime) {
461 jsonifier::string newString{};
462 uint64_t hoursLeft =
static_cast<uint64_t
>(trunc(durationInMs / msPerHour));
463 uint64_t minutesLeft =
static_cast<uint64_t
>(trunc((durationInMs % msPerHour) / msPerMinute));
464 uint64_t secondsLeft =
static_cast<uint64_t
>(trunc(((durationInMs % msPerHour) % msPerMinute) / msPerSecond));
465 if (hoursLeft >= 1) {
466 newString += jsonifier::toString(hoursLeft) +
" hours, ";
467 newString += jsonifier::toString(minutesLeft) +
" minutes, ";
468 newString += jsonifier::toString(secondsLeft) +
" seconds.";
469 }
else if (minutesLeft >= 1) {
470 newString += jsonifier::toString(minutesLeft) +
" minutes, ";
471 newString += jsonifier::toString(secondsLeft) +
" seconds.";
473 newString += jsonifier::toString(secondsLeft) +
" seconds.";
483 uint64_t timeValue =
static_cast<uint64_t
>(inputTime) / 1000ULL;
484 time_t rawTime(
static_cast<time_t
>(timeValue));
485 std::tm resultTwo{ getTime(rawTime) };
486 jsonifier::string timeStamp{};
487 timeStamp.resize(48);
488 switch (timeFormat) {
490 uint64_t sizeResponse = strftime(timeStamp.data(), 48,
"%d %B %G", &resultTwo);
491 timeStamp.resize(sizeResponse);
495 uint64_t sizeResponse = strftime(timeStamp.data(), 48,
"%FT%T", &resultTwo);
496 timeStamp.resize(sizeResponse);
500 uint64_t sizeResponse = strftime(timeStamp.data(), 48,
"%T", &resultTwo);
501 timeStamp.resize(sizeResponse);
505 uint64_t sizeResponse = strftime(timeStamp.data(), 48,
"%d/%m/%g", &resultTwo);
506 timeStamp.resize(sizeResponse);
510 uint64_t sizeResponse = strftime(timeStamp.data(), 48,
"%d %B %G %R", &resultTwo);
511 timeStamp.resize(sizeResponse);
515 uint64_t sizeResponse = strftime(timeStamp.data(), 48,
"%R", &resultTwo);
516 timeStamp.resize(sizeResponse);
534 DCA_INLINE
static uint64_t
getMsSinceEpoch(uint64_t year, uint64_t month, uint64_t day, uint64_t hour, uint64_t minute, uint64_t second) {
535 static constexpr uint64_t secondsInJan{ 31ULL * secondsPerDay };
536 static constexpr uint64_t secondsInFeb{ 28ULL * secondsPerDay };
537 static constexpr uint64_t secondsInMar{ 31ULL * secondsPerDay };
538 static constexpr uint64_t secondsInApr{ 30ULL * secondsPerDay };
539 static constexpr uint64_t secondsInMay{ 31ULL * secondsPerDay };
540 static constexpr uint64_t secondsInJun{ 30ULL * secondsPerDay };
541 static constexpr uint64_t secondsInJul{ 31ULL * secondsPerDay };
542 static constexpr uint64_t secondsInAug{ 31ULL * secondsPerDay };
543 static constexpr uint64_t secondsInSep{ 30ULL * secondsPerDay };
544 static constexpr uint64_t secondsInOct{ 31ULL * secondsPerDay };
545 static constexpr uint64_t secondsInNov{ 30ULL * secondsPerDay };
546 static constexpr uint64_t secondsInDec{ 31ULL * secondsPerDay };
548 for (uint64_t x = 1970ULL; x < year; ++x) {
549 value += seconds{ secondsInJan };
550 value += seconds{ secondsInFeb };
551 value += seconds{ secondsInMar };
552 value += seconds{ secondsInApr };
553 value += seconds{ secondsInMay };
554 value += seconds{ secondsInJun };
555 value += seconds{ secondsInJul };
556 value += seconds{ secondsInAug };
557 value += seconds{ secondsInSep };
558 value += seconds{ secondsInOct };
559 value += seconds{ secondsInNov };
560 value += seconds{ secondsInDec };
561 if (x % 4ULL == 0ULL) {
562 value += seconds{ secondsPerDay };
566 value += seconds{
static_cast<uint64_t
>((day - 1ULL) * secondsPerDay) };
567 value += seconds{
static_cast<uint64_t
>(hour * secondsPerHour) };
568 value += seconds{
static_cast<uint64_t
>(minute * secondsPerMinute) };
569 value += seconds{ second };
572 value += seconds{ secondsInJan };
575 value += seconds{ secondsInFeb };
578 value += seconds{ secondsInMar };
581 value += seconds{ secondsInApr };
584 value += seconds{ secondsInMay };
587 value += seconds{ secondsInJun };
590 value += seconds{ secondsInJul };
593 value += seconds{ secondsInAug };
596 value += seconds{ secondsInSep };
599 value += seconds{ secondsInOct };
602 value += seconds{ secondsInNov };
604 return static_cast<uint64_t
>(std::chrono::duration_cast<milliseconds>(value).count());
612 if (originalTimeStamp !=
"" && originalTimeStamp.size() >= 19) {
614 getMsSinceEpoch(jsonifier::strToUint64(originalTimeStamp.substr(0ULL, 4ULL).data()), jsonifier::strToUint64(originalTimeStamp.substr(5ULL, 6ULL).data()),
615 jsonifier::strToUint64(originalTimeStamp.substr(8ULL, 9ULL).data()), jsonifier::strToUint64(originalTimeStamp.substr(11ULL, 12ULL).data()),
616 jsonifier::strToUint64(originalTimeStamp.substr(14ULL, 15ULL).data()), jsonifier::strToUint64(originalTimeStamp.substr(17ULL, 18ULL).data()));
619 return static_cast<uint64_t
>(std::chrono::duration_cast<milliseconds>(sys_clock::now().time_since_epoch()).count());
641 template<
typename value_type>
friend class time_stamp_base;
676 DCA_INLINE
operator uint64_t()
const {
682 DCA_INLINE
operator jsonifier::string()
const {
695 DCA_INLINE
static value_type toEntity(snowflake initialId, snowflake additionalId);
697 DCA_INLINE
static value_type toEntity(snowflake initialId);
709 template<
typename value_type> DCA_INLINE value_type
toEntity() {
710 return to_entity<value_type>{}.toEntity(*
this);
718 return to_entity<value_type>{}.toEntity(*
this, additionalId);
725 if (other.size() > 0) {
726 for (
auto& value: other) {
727 if (!std::isdigit(
static_cast<uint8_t
>(value))) {
731 id = jsonifier::strToUint64(other);
758 DCA_INLINE
explicit operator jsonifier::string()
const {
759 return jsonifier::toString(
id);
764 DCA_INLINE
explicit operator const uint64_t&()
const {
768 DCA_INLINE
bool operator==(
const snowflake& other)
const {
769 return id == other.
id;
772 DCA_INLINE
bool operator==(jsonifier::string_view other)
const {
773 return operator jsonifier::string() == other;
776 DCA_INLINE
bool operator==(uint64_t other)
const {
784 template<jsonifier::concepts::
string_t value_type> DCA_INLINE jsonifier::string
operator+(jsonifier::string_view rhs)
const {
785 jsonifier::string newString{
operator jsonifier::string() };
795 jsonifier::string lhsNew{
static_cast<jsonifier::string
>(lhs) };
806 template<jsonifier::concepts::
string_t value_type01,
typename value_type02>
friend DCA_INLINE jsonifier::string
operator+(
const value_type01& lhs,
const value_type02& rhs) {
807 jsonifier::string newString{ lhs };
808 newString += rhs.operator jsonifier::string();
818 template<u
int64_t size>
friend DCA_INLINE jsonifier::string
operator+(
const char (&lhs)[size],
const snowflake& rhs) {
819 jsonifier::string newString{ lhs };
820 newString += rhs.operator jsonifier::string();
827 uint64_t timeStamp{
static_cast<uint64_t
>((
id >> 22) + 1420070400000) };
835 DCA_INLINE std::ostream& operator<<(std::ostream& os,
snowflake sf) {
836 os << sf.operator jsonifier::string();
845 DCA_INLINE
dca_exception(jsonifier::string_view error, std::source_location location = std::source_location::current()) : std::runtime_error{
"No error." } {
846 auto newError = jsonifier::string{
"Thrown from: " };
847 auto newString = location.file_name();
849 newError += newString;
851 newError += jsonifier::string{
" (" } + jsonifier::toString(location.line()) + jsonifier::string{
":" };
852 newError += jsonifier::toString(location.column()) + jsonifier::string{
")\n" };
854 if (!newError.empty()) {
855 *
static_cast<std::runtime_error*
>(
this) = std::runtime_error{ std::string{ newError } };
Class for printing different types of messages to output and error streams.
static DCA_INLINE std::atomic_bool doWePrintGeneralErrors
Flag to control printing of general error messages.
static DCA_INLINE std::mutex accessMutex
Mutex for thread-safe access to shared resources.
static DCA_INLINE std::atomic_bool doWePrintHttpsSuccesses
Flag to control printing of https success messages.
static DCA_INLINE std::atomic_bool doWePrintWebSocketErrors
Flag to control printing of websocket error messages.
static DCA_INLINE void printSuccess(const string_type &what, std::source_location where=std::source_location::current())
Print a success message of the specified type.
static DCA_INLINE std::atomic_bool doWePrintGeneralSuccesses
Flag to control printing of general success messages.
static DCA_INLINE std::ostream * errorStream
Pointer to the error stream for message printing.
static DCA_INLINE void printError(const string_type &what, std::source_location where=std::source_location::current())
Print an error message of the specified type.
static DCA_INLINE std::atomic_bool doWePrintHttpsErrors
Flag to control printing of https error messages.
static DCA_INLINE std::atomic_bool doWePrintWebSocketSuccesses
Flag to control printing of websocket success messages.
static DCA_INLINE std::ostream * outputStream
Pointer to the output stream for message printing.
static DCA_INLINE void initialize(const value_type &other)
Initialize the message_printer with configuration settings and output/error streams.
A class representing a snowflake identifier with various operations.
DCA_INLINE snowflake(uint64_t other)
Constructor to create a snowflake instance from a uint64_t value.
DCA_INLINE friend jsonifier::string operator+(const snowflake &lhs, jsonifier::string_view other)
Friend function to concatenate snowflake and a string value.
DCA_INLINE jsonifier::string operator+(jsonifier::string_view rhs) const
Concatenation operator to concatenate snowflake and a string value.
DCA_INLINE snowflake(const jsonifier::string &other)
Constructor to create a snowflake instance from a string value.
friend DCA_INLINE jsonifier::string operator+(const value_type01 &lhs, const value_type02 &rhs)
Friend function to concatenate two values.
DCA_INLINE snowflake & operator=(const jsonifier::string &other)
Assignment operator to assign a string value to snowflake.
friend DCA_INLINE jsonifier::string operator+(const char(&lhs)[size], const snowflake &rhs)
Friend function to concatenate two values.
DCA_INLINE snowflake & operator=(uint64_t other)
Assignment operator to assign a uint64_t value to snowflake.
DCA_INLINE snowflake()=default
Default constructor for snowflake.
uint64_t id
The snowflake id.
DCA_INLINE jsonifier::string getCreatedAtTimeStamp()
Converts the snowflake id into a time and date stamp.
DCA_INLINE value_type toEntity()
A class for converting snowflake id's into the data structures they represent.
DCA_INLINE value_type toEntity(snowflake additionalId)
A class for converting snowflake id's into the data structures they represent.
A base class for handling time stamps and conversions.
static DCA_INLINE jsonifier::string convertMsToDurationString(uint64_t durationInMs)
Converts milliseconds into a human-readable duration string.
static DCA_INLINE jsonifier::string convertToCurrentISO8601TimeStamp(time_format timeFormat)
Converts the current time into an iso8601 time stamp.
DCA_INLINE bool operator==(jsonifier::string_view other) const
Checks if the time stamp is equal to a string representation.
static DCA_INLINE uint64_t getMsSinceEpoch(uint64_t year, uint64_t month, uint64_t day, uint64_t hour, uint64_t minute, uint64_t second)
Gets the time since the unix epoch for the specified date and time.
static DCA_INLINE jsonifier::string convertToFutureISO8601TimeStamp(uint64_t minutesToAdd, uint64_t hoursToAdd, uint64_t daysToAdd, uint64_t monthsToAdd, uint64_t yearsToAdd, time_format timeFormat)
Converts given time values into a future iso8601 time stamp.
DCA_INLINE bool hasTimeElapsed(int64_t days, int64_t hours, int64_t minutes) const
Checks if a certain time duration has elapsed.
DCA_INLINE jsonifier::string convertUintToStringTimeStamp(uint64_t uintTimeStamp) const
Converts a uint64_t time value into a string time stamp.
static DCA_INLINE jsonifier::string getISO8601TimeStamp(time_format timeFormat, uint64_t inputTime)
Gets an iso8601 time stamp string based on the provided time format.
static DCA_INLINE uint64_t convertTimeStampToTimeUnits(jsonifier::string_view originalTimeStamp)
Converts a string time stamp into a uint64_t time value.
DCA_INLINE uint64_t convertStringToUintTimeStamp(jsonifier::string_view stringTimeStamp) const
Converts a string time stamp into a uint64_t time value.
A class that extends time_stamp_base to provide additional functionality.
DCA_INLINE time_stamp(uint64_t valueNew)
Constructor to create a time_stamp instance from a uint64_t value.
DCA_INLINE time_stamp & operator=(jsonifier::string_view valueNew)
Move assignment operator to move a string value into time_stamp.
uint64_t value
The value stored in the time_stamp instance.
DCA_INLINE time_stamp()=default
Default constructor for time_stamp.
DCA_INLINE time_stamp(jsonifier::string_view valueNew)
Move constructor to create a time_stamp instance by moving a string value.
DCA_INLINE time_stamp & operator=(uint64_t valueNew)
Assignment operator to assign a uint64_t value to time_stamp.
A class for converting snowflake id's into the data structures they represent.
time_format
Time formatting methods.
@ short_date_time
"20 April 2021 16:20" - Short Date/Time
@ short_time
"16:20" - Short Time
@ short_date
"20/04/2021" - Short Date
@ long_time
"16:20:30" - Long Time
@ long_date
"20 April 2021" - Long Date
@ long_date_time
"Tuesday, 20 April 2021 16:20" - Long Date/Time
stream_type
For selecting the type of streamer that the given bot is, one must be one server and one of client pe...
The main namespace for the forward-facing interfaces.
An exception class derived from std::runtime_error for dca-related exceptions.
DCA_INLINE dca_exception(jsonifier::string_view error, std::source_location location=std::source_location::current())
Constructor to create a dca_exception with an error message and optional source location.