D++ (DPP)  10.0.30
C++ Discord API Bot Library
dpp::utility::icon Struct Reference

Wrapper class around a variant for either iconhash or image, for API objects that have one or the other (generally iconhash when receiving, image when uploading an image) More...

#include "utility.h"

Collaboration diagram for dpp::utility::icon:

Public Member Functions

iconhashas_iconhash () &
 Get as icon hash. More...
 
iconhash && as_iconhash () &&
 Get as icon hash. More...
 
const iconhashas_iconhash () const &
 Get as icon hash. More...
 
image_dataas_image_data () &
 Get as image data. More...
 
image_data && as_image_data () &&
 Get as image. More...
 
const image_dataas_image_data () const &
 Get as image. More...
 
bool is_iconhash () const
 Check whether this icon is stored as an iconhash. More...
 
bool is_image_data () const
 Check whether this icon is stored as an image. More...
 
iconoperator= (const iconhash &hash)
 Assign to iconhash. More...
 
iconoperator= (const image_data &img)
 Assign to image. More...
 
iconoperator= (iconhash &&hash) noexcept
 Assign to iconhash. More...
 
iconoperator= (image_data &&img) noexcept
 Assign to image. More...
 

Public Attributes

std::variant< std::monostate, iconhash, image_datahash_or_data
 Iconhash received or image data for upload. More...
 

Detailed Description

Wrapper class around a variant for either iconhash or image, for API objects that have one or the other (generally iconhash when receiving, image when uploading an image)

Member Function Documentation

◆ as_iconhash() [1/3]

iconhash && dpp::utility::icon::as_iconhash ( ) &

Get as icon hash.

Warning
The behavior is undefined if is_iconhash() == false
Returns
iconhash& This iconhash

Referenced by dpp::guild::connect_member_voice(), and dpp::role::get_members().

Here is the caller graph for this function:

◆ as_iconhash() [2/3]

iconhash&& dpp::utility::icon::as_iconhash ( ) &&

Get as icon hash.

Warning
The behavior is undefined if is_iconhash() == false
Returns
iconhash& This iconhash

◆ as_iconhash() [3/3]

const iconhash& dpp::utility::icon::as_iconhash ( ) const &

Get as icon hash.

Warning
The behavior is undefined if is_iconhash() == false
Returns
iconhash& This iconhash

◆ as_image_data() [1/3]

image_data && dpp::utility::icon::as_image_data ( ) &

Get as image data.

Warning
The behavior is undefined if is_image_data() == false
Returns
image_data& This image

◆ as_image_data() [2/3]

image_data&& dpp::utility::icon::as_image_data ( ) &&

Get as image.

Warning
The behavior is undefined if is_image_data() == false
Returns
image_data& This image

◆ as_image_data() [3/3]

const image_data& dpp::utility::icon::as_image_data ( ) const &

Get as image.

Warning
The behavior is undefined if is_image_data() == false
Returns
image_data& This image

◆ is_iconhash()

bool dpp::utility::icon::is_iconhash ( ) const

Check whether this icon is stored as an iconhash.

See also
iconhash
Returns
bool Whether this icon is stored as an iconhash

References hash_or_data.

Referenced by dpp::role::get_members().

Here is the caller graph for this function:

◆ is_image_data()

bool dpp::utility::icon::is_image_data ( ) const

Check whether this icon is stored as an image.

See also
image_data
Returns
bool Whether this icon is stored as an image

References hash_or_data.

◆ operator=() [1/4]

icon & dpp::utility::icon::operator= ( const iconhash hash)

Assign to iconhash.

Parameters
hashIconhash

References dpp::hash(), and hash_or_data.

Here is the call graph for this function:

◆ operator=() [2/4]

icon & dpp::utility::icon::operator= ( const image_data img)

Assign to image.

Parameters
imgImage

References hash_or_data.

◆ operator=() [3/4]

icon & dpp::utility::icon::operator= ( iconhash &&  hash)
noexcept

Assign to iconhash.

Parameters
hashIconhash

References dpp::hash().

Here is the call graph for this function:

◆ operator=() [4/4]

icon & dpp::utility::icon::operator= ( image_data &&  img)
noexcept

Assign to image.

Parameters
imgImage

Member Data Documentation

◆ hash_or_data

std::variant<std::monostate, iconhash, image_data> dpp::utility::icon::hash_or_data

Iconhash received or image data for upload.

Referenced by is_iconhash(), is_image_data(), and operator=().


The documentation for this struct was generated from the following files: