D++ (DPP)
C++ Discord API Bot Library
|
Represents a permission bitmask (refer to enum dpp::permissions) which are held in an uint64_t. More...
Public Member Functions | |
constexpr | permission ()=default |
Default constructor, initializes permission to 0. More... | |
constexpr | permission (uint64_t value) noexcept |
Bitmask constructor, initializes permission to the argument. More... | |
constexpr | operator uint64_t () const noexcept |
For acting like an integer. More... | |
constexpr | operator uint64_t & () noexcept |
For acting like an integer. More... | |
template<typename... T> | |
constexpr bool | can (T... values) const noexcept |
Check for certain permissions, taking into account administrator privileges. It uses the Bitwise AND operator. More... | |
template<typename... T> | |
constexpr bool | can_any (T... values) const noexcept |
Check for certain permissions, taking into account administrator privileges. It uses the Bitwise AND operator. More... | |
template<typename... T> | |
constexpr bool | has (T... values) const noexcept |
Check for permission flags set. It uses the Bitwise AND operator. More... | |
template<typename... T> | |
constexpr bool | has_any (T... values) const noexcept |
Check for permission flags set. It uses the Bitwise AND operator. More... | |
template<typename... T> | |
constexpr std::enable_if_t<(std::is_convertible_v< T, uint64_t > &&...), permission & > | add (T... values) noexcept |
Add a permission with the Bitwise OR operation. More... | |
template<typename... T> | |
constexpr std::enable_if_t<(std::is_convertible_v< T, uint64_t > &&...), permission & > | set (T... values) noexcept |
Assign permissions. This will reset the bitmask to the new value. More... | |
template<typename... T> | |
constexpr std::enable_if_t<(std::is_convertible_v< T, uint64_t > &&...), permission & > | remove (T... values) noexcept |
Remove a permission with the Bitwise NOT operation. More... | |
Protected Attributes | |
uint64_t | value {0} |
The permission bitmask value. More... | |
Represents a permission bitmask (refer to enum dpp::permissions) which are held in an uint64_t.
|
constexprdefault |
Default constructor, initializes permission to 0.
|
inlineconstexprnoexcept |
Bitmask constructor, initializes permission to the argument.
value | The bitmask to initialize the permission to |
|
inlineconstexprnoexcept |
Add a permission with the Bitwise OR operation.
T | one or more uint64_t permission bits |
values | The permissions (from dpp::permissions) to add |
Example:
|
inlineconstexprnoexcept |
Check for certain permissions, taking into account administrator privileges. It uses the Bitwise AND operator.
T | one or more uint64_t permission bits |
values | The permissions (from dpp::permissions) to check for |
Example:
|
inlineconstexprnoexcept |
Check for certain permissions, taking into account administrator privileges. It uses the Bitwise AND operator.
T | one or more uint64_t permission bits |
values | The permissions (from dpp::permissions) to check for |
Example:
|
inlineconstexprnoexcept |
Check for permission flags set. It uses the Bitwise AND operator.
T | one or more uint64_t permission bits |
values | The permissions (from dpp::permissions) to check for |
Example:
|
inlineconstexprnoexcept |
Check for permission flags set. It uses the Bitwise AND operator.
T | one or more uint64_t permission bits |
values | The permissions (from dpp::permissions) to check for |
Example:
|
inlineconstexprnoexcept |
For acting like an integer.
|
inlineconstexprnoexcept |
For acting like an integer.
|
inlineconstexprnoexcept |
Remove a permission with the Bitwise NOT operation.
T | one or more uint64_t permission bits |
values | The permissions (from dpp::permissions) to remove |
Example:
|
inlineconstexprnoexcept |
Assign permissions. This will reset the bitmask to the new value.
T | one or more uint64_t permission bits |
values | The permissions (from dpp::permissions) to set |
Example:
|
protected |
The permission bitmask value.