blob: 764aad01d6bd3ed035ed109c9e7f5e741c0e855d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2026
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/utils/common.h"
#include "td/utils/StringBuilder.h"
namespace td {
struct PhotoSizeType {
int32 type = 0;
PhotoSizeType() = default;
explicit PhotoSizeType(int32 type) : type(type) {
}
};
inline bool operator==(const PhotoSizeType &lhs, char c) {
return lhs.type == c;
}
inline bool operator==(const PhotoSizeType &lhs, int32 type) {
return lhs.type == type;
}
inline bool operator==(const PhotoSizeType &lhs, const PhotoSizeType &rhs) {
return lhs.type == rhs.type;
}
inline bool operator!=(const PhotoSizeType &lhs, char c) {
return !(lhs == c);
}
inline bool operator!=(const PhotoSizeType &lhs, int32 type) {
return !(lhs == type);
}
inline bool operator!=(const PhotoSizeType &lhs, const PhotoSizeType &rhs) {
return !(lhs == rhs);
}
inline StringBuilder &operator<<(StringBuilder &string_builder, const PhotoSizeType &photo_size_type) {
auto type = photo_size_type.type;
if ('a' <= type && type <= 'z') {
return string_builder << static_cast<char>(type);
}
return string_builder << type;
}
} // namespace td
|