Represents a permission bitmask (refer to enum dpp::permissions) which are hold in an uint64_t.
More...
#include <permissions.h>
|
| permission (const uint64_t &value) |
| Construct a permission object. More...
|
|
| permission () |
| Construct a permission object. More...
|
|
| operator uint64_t () const |
| For acting like an integer. More...
|
|
| operator uint64_t & () |
| For acting like an integer. More...
|
|
template<typename... T> |
bool | has (T... values) const |
| Check for permission flags set. It uses the Bitwise AND operator. More...
|
|
template<typename... T> |
std::enable_if<(std::is_convertible< T, uint64_t >::value &&...), permission & >::type | add (T... values) |
| Add a permission with the Bitwise OR operation. More...
|
|
template<typename... T> |
std::enable_if<(std::is_convertible< T, uint64_t >::value &&...), permission & >::type | set (T... values) |
| Assign a permission. This will reset the bitmask to the new value. More...
|
|
template<typename... T> |
std::enable_if<(std::is_convertible< T, uint64_t >::value &&...), permission & >::type | remove (T... values) |
| Remove a permission with the Bitwise NOT operation. More...
|
|
Represents a permission bitmask (refer to enum dpp::permissions) which are hold in an uint64_t.
◆ permission() [1/2]
dpp::permission::permission |
( |
const uint64_t & |
value | ) |
|
Construct a permission object.
- Parameters
-
value | A permission bitmask |
◆ permission() [2/2]
dpp::permission::permission |
( |
| ) |
|
Construct a permission object.
◆ add()
template<typename... T>
std::enable_if<(std::is_convertible< T, uint64_t >::value &&...), permission & >::type dpp::permission::add |
( |
T... |
values | ) |
|
|
inline |
Add a permission with the Bitwise OR operation.
- Template Parameters
-
T | one or more uint64_t permission bits |
- Parameters
-
Example:
permission()
Construct a permission object.
@ p_view_channel
allows guild members to view a channel, which includes reading messages in text channels and joining ...
Definition: permissions.h:40
@ p_send_messages
allows for sending messages in a channel
Definition: permissions.h:41
- Returns
- permission& reference to self for chaining
◆ has()
template<typename... T>
bool dpp::permission::has |
( |
T... |
values | ) |
const |
|
inline |
Check for permission flags set. It uses the Bitwise AND operator.
- Template Parameters
-
T | one or more uint64_t permission bits |
- Parameters
-
Example:
@ p_ban_members
allows banning members
Definition: permissions.h:32
@ p_kick_members
allows kicking members
Definition: permissions.h:31
- Returns
- bool True if it has all the given permissions
◆ operator uint64_t()
dpp::permission::operator uint64_t |
( |
| ) |
const |
For acting like an integer.
- Returns
- The permission bitmask value
◆ operator uint64_t &()
dpp::permission::operator uint64_t & |
( |
| ) |
|
For acting like an integer.
- Returns
- A reference to the permission bitmask value
◆ remove()
template<typename... T>
std::enable_if<(std::is_convertible< T, uint64_t >::value &&...), permission & >::type dpp::permission::remove |
( |
T... |
values | ) |
|
|
inline |
Remove a permission with the Bitwise NOT operation.
- Template Parameters
-
T | one or more uint64_t permission bits |
- Parameters
-
Example:
- Returns
- permission& reference to self for chaining
◆ set()
template<typename... T>
std::enable_if<(std::is_convertible< T, uint64_t >::value &&...), permission & >::type dpp::permission::set |
( |
T... |
values | ) |
|
|
inline |
Assign a permission. This will reset the bitmask to the new value.
- Template Parameters
-
T | one or more uint64_t permission bits |
- Parameters
-
Example:
- Returns
- permission& reference to self for chaining
◆ value
uint64_t dpp::permission::value |
|
protected |
The permission bitmask value.