1#include "cpr/redirect.h"
2
3namespace cpr {
4PostRedirectFlags operator|(PostRedirectFlags lhs, PostRedirectFlags rhs) {
5 return static_cast<PostRedirectFlags>(static_cast<uint8_t>(lhs) | static_cast<uint8_t>(rhs));
6}
7
8PostRedirectFlags operator&(PostRedirectFlags lhs, PostRedirectFlags rhs) {
9 return static_cast<PostRedirectFlags>(static_cast<uint8_t>(lhs) & static_cast<uint8_t>(rhs));
10}
11
12PostRedirectFlags operator^(PostRedirectFlags lhs, PostRedirectFlags rhs) {
13 return static_cast<PostRedirectFlags>(static_cast<uint8_t>(lhs) ^ static_cast<uint8_t>(rhs));
14}
15
16PostRedirectFlags operator~(PostRedirectFlags flag) {
17 return static_cast<PostRedirectFlags>(~static_cast<uint8_t>(flag));
18}
19
20PostRedirectFlags& operator|=(PostRedirectFlags& lhs, PostRedirectFlags rhs) {
21 lhs = static_cast<PostRedirectFlags>(static_cast<uint8_t>(lhs) | static_cast<uint8_t>(rhs));
22 const uint8_t tmp = static_cast<uint8_t>(lhs);
23 lhs = static_cast<PostRedirectFlags>(tmp);
24 return lhs;
25}
26
27PostRedirectFlags& operator&=(PostRedirectFlags& lhs, PostRedirectFlags rhs) {
28 lhs = static_cast<PostRedirectFlags>(static_cast<uint8_t>(lhs) & static_cast<uint8_t>(rhs));
29 return lhs;
30}
31
32PostRedirectFlags& operator^=(PostRedirectFlags& lhs, PostRedirectFlags rhs) {
33 lhs = static_cast<PostRedirectFlags>(static_cast<uint8_t>(lhs) ^ static_cast<uint8_t>(rhs));
34 return lhs;
35}
36
37bool any(PostRedirectFlags flag) {
38 return flag != PostRedirectFlags::NONE;
39}
40} // namespace cpr
41