D++ (DPP)  10.0.30
C++ Discord API Bot Library
discordevents.h File Reference
#include <dpp/export.h>
#include <dpp/json_fwd.h>
#include <dpp/json_interface.h>
#include <dpp/utility.h>
#include <string_view>
#include <functional>
Include dependency graph for discordevents.h:

Namespaces

 dpp
 The main namespace for D++ functions.
 

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...
 
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...
 
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...
 
template<class T >
void dpp::set_object_array_not_null (nlohmann::json *j, std::string_view key, std::vector< T > &v)
 Sets an array of objects 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...