DiscordCoreAPI
A Discord bot library written in C++, with custom asynchronous coroutines.
Loading...
Searching...
No Matches
discord_core_api::snowflake Class Reference

A class representing a snowflake identifier with various operations. More...

#include <Base.hpp>

Public Member Functions

jsonifier::string getCreatedAtTimeStamp ()
 Converts the snowflake id into a time and date stamp. More...
 
 operator const uint64_t & () const
 Explicit conversion operator to convert snowflake to uint64_t. More...
 
 operator jsonifier::string () const
 Conversion operator to convert snowflake to jsonifier::string. More...
 
template<jsonifier::concepts::string_t value_type>
jsonifier::string operator+ (jsonifier::string_view rhs) const
 Concatenation operator to concatenate snowflake and a string value. More...
 
snowflakeoperator= (const jsonifier::string &other)
 Assignment operator to assign a string value to snowflake. More...
 
snowflakeoperator= (uint64_t other)
 Assignment operator to assign a uint64_t value to snowflake. More...
 
 snowflake ()=default
 Default constructor for snowflake.
 
 snowflake (const jsonifier::string &other)
 Constructor to create a snowflake instance from a string value. More...
 
 snowflake (uint64_t other)
 Constructor to create a snowflake instance from a uint64_t value. More...
 
template<typename value_type >
value_type toEntity ()
 A class for converting snowflake id's into the data structures they represent. More...
 
template<typename value_type >
value_type toEntity (snowflake additionalId)
 A class for converting snowflake id's into the data structures they represent. More...
 

Constructor & Destructor Documentation

◆ snowflake() [1/2]

discord_core_api::snowflake::snowflake ( const jsonifier::string &  other)
inline
Parameters
otherthe string value to create the instance from.

Definition at line 717 of file Base.hpp.

◆ snowflake() [2/2]

discord_core_api::snowflake::snowflake ( uint64_t  other)
inline
Parameters
otherthe uint64_t value to create the instance from.

Definition at line 731 of file Base.hpp.

Member Function Documentation

◆ getCreatedAtTimeStamp()

jsonifier::string discord_core_api::snowflake::getCreatedAtTimeStamp ( )
inline
Returns
a jsonifier::string containing the timestamp.

Definition at line 805 of file Base.hpp.

Here is the call graph for this function:

◆ operator const uint64_t &()

discord_core_api::snowflake::operator const uint64_t & ( ) const
inlineexplicit
Returns
the uint64_t value represented by the snowflake instance.

Definition at line 743 of file Base.hpp.

◆ operator jsonifier::string()

discord_core_api::snowflake::operator jsonifier::string ( ) const
inlineexplicit
Returns
the jsonifier::string value represented by the snowflake instance.

Definition at line 737 of file Base.hpp.

◆ operator+()

template<jsonifier::concepts::string_t value_type>
jsonifier::string discord_core_api::snowflake::operator+ ( jsonifier::string_view  rhs) const
inline
Template Parameters
value_typethe type of the string value.
Parameters
rhsthe string value to concatenate.
Returns
the concatenated string.

Definition at line 763 of file Base.hpp.

◆ operator=() [1/2]

snowflake & discord_core_api::snowflake::operator= ( const jsonifier::string &  other)
inline
Parameters
otherthe string value to assign.
Returns
reference to the modified snowflake instance.

Definition at line 703 of file Base.hpp.

◆ operator=() [2/2]

snowflake & discord_core_api::snowflake::operator= ( uint64_t  other)
inline
Parameters
otherthe uint64_t value to assign.
Returns
reference to the modified snowflake instance.

Definition at line 724 of file Base.hpp.

◆ toEntity() [1/2]

template<typename value_type >
value_type discord_core_api::snowflake::toEntity ( )
inline
Template Parameters
value_typeThe type of value being acquired.
Returns
value_type If successful, the intended data structure.

Definition at line 688 of file Base.hpp.

◆ toEntity() [2/2]

template<typename value_type >
value_type discord_core_api::snowflake::toEntity ( snowflake  additionalId)
inline
Parameters
additionalIdFor certain classes, a second Id for collecting the data structure.
Template Parameters
value_typeThe type of value being acquired.
Returns
value_type If successful, the intended data structure.

Definition at line 696 of file Base.hpp.


The documentation for this class was generated from the following file: