D++ (DPP)  10.0.30
C++ Discord API Bot Library
discordevents.cpp File Reference
#include <string>
#include <iostream>
#include <fstream>
#include <time.h>
#include <stdlib.h>
#include <dpp/discordevents.h>
#include <dpp/discordclient.h>
#include <dpp/event.h>
#include <dpp/cache.h>
#include <dpp/stringops.h>
#include <dpp/json.h>
#include <iomanip>
#include <sstream>
Include dependency graph for discordevents.cpp:

Namespaces

 dpp
 The main namespace for D++ functions.
 

Macros

#define _XOPEN_SOURCE
 

Functions

std::string DPP_EXPORT dpp::base64_encode (unsigned char const *buf, unsigned int buffer_length)
 Base64 encode data into a string. More...
 
bool DPP_EXPORT dpp::bool_not_null (const nlohmann::json *j, const char *keyname)
 Returns a boolean value from a json field value, if defined, else returns false. More...
 
char * crossplatform_strptime (const char *s, const char *f, struct tm *tm)
 
double DPP_EXPORT dpp::double_not_null (const nlohmann::json *j, const char *keyname)
 Returns a double from a json field value, if defined, else returns 0. More...
 
void DPP_EXPORT dpp::for_each_json (nlohmann::json *parent, std::string_view key, const std::function< void(nlohmann::json *)> &fn)
 Applies a function to each element of a json array. More...
 
uint16_t DPP_EXPORT dpp::int16_not_null (const nlohmann::json *j, const char *keyname)
 Returns a 16 bit unsigned integer from a json field value, if defined, else returns 0. More...
 
uint32_t DPP_EXPORT dpp::int32_not_null (const nlohmann::json *j, const char *keyname)
 Returns a 32 bit unsigned integer from a json field value, if defined, else returns 0. More...
 
uint64_t DPP_EXPORT dpp::int64_not_null (const nlohmann::json *j, const char *keyname)
 Returns a 64 bit unsigned integer from a json field value, if defined, else returns 0. More...
 
uint8_t DPP_EXPORT dpp::int8_not_null (const nlohmann::json *j, const char *keyname)
 Returns an 8 bit unsigned integer from a json field value, if defined, else returns 0. More...
 
template<typename EventType >
static dpp::events::eventdpp::make_static_event () noexcept
 
void DPP_EXPORT dpp::set_bool_not_null (const nlohmann::json *j, const char *keyname, bool &v)
 Sets a boolean from a json field value, if defined, else does nothing. More...
 
void DPP_EXPORT dpp::set_double_not_null (const nlohmann::json *j, const char *keyname, double &v)
 Sets a double from a json field value, if defined, else does nothing. More...
 
void DPP_EXPORT dpp::set_iconhash_not_null (const nlohmann::json *j, const char *keyname, utility::iconhash &v)
 This is a repeat of set_string_not_null, but takes in a iconhash. More...
 
void DPP_EXPORT dpp::set_int16_not_null (const nlohmann::json *j, const char *keyname, uint16_t &v)
 Sets an unsigned 16 bit integer from a json field value, if defined, else does nothing. More...
 
void DPP_EXPORT dpp::set_int32_not_null (const nlohmann::json *j, const char *keyname, uint32_t &v)
 Sets an unsigned 32 bit integer from a json field value, if defined, else does nothing. More...
 
void DPP_EXPORT dpp::set_int64_not_null (const nlohmann::json *j, const char *keyname, uint64_t &v)
 Sets an unsigned 64 bit integer from a json field value, if defined, else does nothing. More...
 
void DPP_EXPORT dpp::set_int8_not_null (const nlohmann::json *j, const char *keyname, uint8_t &v)
 Sets an unsigned 8 bit integer from a json field value, if defined, else does nothing. More...
 
void DPP_EXPORT dpp::set_snowflake_array_not_null (const nlohmann::json *j, const char *keyname, std::vector< class snowflake > &v)
 Sets an array of snowflakes from a json field value, if defined, else does nothing. More...
 
void DPP_EXPORT dpp::set_snowflake_not_null (const nlohmann::json *j, const char *keyname, uint64_t &v)
 Sets a snowflake id from a json field value, if defined, else does nothing. More...
 
void DPP_EXPORT dpp::set_string_not_null (const nlohmann::json *j, const char *keyname, std::string &v)
 Sets a string from a json field value, if defined, else does nothing. More...
 
void DPP_EXPORT dpp::set_ts_not_null (const nlohmann::json *j, const char *keyname, time_t &v)
 Sets an timestamp from a json field value containing an ISO8601 string, if defined, else does nothing. More...
 
uint64_t DPP_EXPORT dpp::snowflake_not_null (const nlohmann::json *j, const char *keyname)
 Returns a snowflake id from a json field value, if defined, else returns 0. More...
 
std::string DPP_EXPORT dpp::string_not_null (const nlohmann::json *j, const char *keyname)
 Returns a string from a json field value, if defined, else returns an empty string. More...
 
time_t DPP_EXPORT dpp::ts_not_null (const nlohmann::json *j, const char *keyname)
 Returns a time_t from an ISO8601 timestamp field in a json value, if defined, else returns epoch value of 0. More...
 
std::string DPP_EXPORT dpp::ts_to_string (time_t ts)
 Convert time_t unix epoch to std::string ISO date/time. More...
 

Variables

static const std::map< std::string, dpp::events::event * > dpp::event_map
 

Macro Definition Documentation

◆ _XOPEN_SOURCE

#define _XOPEN_SOURCE

Function Documentation

◆ crossplatform_strptime()

char* crossplatform_strptime ( const char *  s,
const char *  f,
struct tm *  tm 
)

References get_time(), and dpp::unicode_emoji::tm.

Referenced by dpp::set_ts_not_null(), and dpp::ts_not_null().

Here is the call graph for this function:
Here is the caller graph for this function: