Store a 128 bit icon hash (profile picture, server icon etc) as a 128 bit binary value made of two uint64_t. More...
#include "utility.h"
Public Member Functions | |
iconhash (const std::string &hash) | |
Construct a new iconhash object. More... | |
iconhash (uint64_t _first=0, uint64_t _second=0) noexcept | |
Construct a new iconhash object. More... | |
iconhash & | operator= (const std::string &assignment) |
Assign from std::string. More... | |
bool | operator== (const iconhash &other) const noexcept |
Check if one iconhash is equal to another. More... | |
void | set (const std::string &hash) |
Change value of iconhash object. More... | |
std::string | to_string () const |
Convert iconhash back to 32 character string value. More... | |
Public Attributes | |
uint64_t | first |
High 64 bits. More... | |
uint64_t | second |
Low 64 bits. More... | |
Store a 128 bit icon hash (profile picture, server icon etc) as a 128 bit binary value made of two uint64_t.
Has a constructor to build one from a string, and a method to fetch the value back in string form.
|
noexcept |
Construct a new iconhash object.
_first | Leftmost portion of the hash value |
_second | Rightmost portion of the hash value |
dpp::utility::iconhash::iconhash | ( | const std::string & | hash | ) |
Construct a new iconhash object.
hash | String hash to construct from. Must contain a 32 character hex string. |
std::length_error | if the provided string is not exactly 32 characters long. |
References dpp::hash(), and set().
iconhash & dpp::utility::iconhash::operator= | ( | const std::string & | assignment | ) |
Assign from std::string.
assignment | string to assign from. |
std::length_error | if the provided string is not exactly 32 characters long. |
References set().
|
noexcept |
Check if one iconhash is equal to another.
other | other iconhash to compare |
void dpp::utility::iconhash::set | ( | const std::string & | hash | ) |
Change value of iconhash object.
hash | String hash to change to. Must contain a 32 character hex string. |
std::length_error | if the provided string is not exactly 32 characters long. |
References first, dpp::hash(), dpp::utility::hex, and second.
Referenced by iconhash(), and operator=().
std::string dpp::utility::iconhash::to_string | ( | ) | const |
Convert iconhash back to 32 character string value.
References first, second, and dpp::to_hex().
Referenced by dpp::guild::connect_member_voice(), dpp::cluster::edit_webhook_message(), dpp::cluster::edit_webhook_with_token(), dpp::role::get_members(), and dpp::user::has_animated_icon().
uint64_t dpp::utility::iconhash::first |
High 64 bits.
Referenced by set(), and to_string().
uint64_t dpp::utility::iconhash::second |
Low 64 bits.
Referenced by set(), and to_string().