Move Bitmask output operator to cpp.
GitOrigin-RevId: 2b308d08ffa9e1babca61f3d3c99f34f73253d9f
This commit is contained in:
parent
2face56d10
commit
239fd79523
@ -15,7 +15,8 @@ namespace td {
|
||||
|
||||
enum class NotificationGroupType : int8 { Messages, Mentions, SecretChat, Calls };
|
||||
|
||||
inline td_api::object_ptr<td_api::NotificationGroupType> get_notification_group_type_object(NotificationGroupType type) {
|
||||
inline td_api::object_ptr<td_api::NotificationGroupType> get_notification_group_type_object(
|
||||
NotificationGroupType type) {
|
||||
switch (type) {
|
||||
case NotificationGroupType::Messages:
|
||||
return td_api::make_object<td_api::notificationGroupTypeMessages>();
|
||||
@ -31,7 +32,8 @@ inline td_api::object_ptr<td_api::NotificationGroupType> get_notification_group_
|
||||
}
|
||||
}
|
||||
|
||||
inline NotificationGroupType get_notification_group_type(const td_api::object_ptr<td_api::NotificationGroupType> &type) {
|
||||
inline NotificationGroupType get_notification_group_type(
|
||||
const td_api::object_ptr<td_api::NotificationGroupType> &type) {
|
||||
CHECK(type != nullptr);
|
||||
switch (type->get_id()) {
|
||||
case td_api::notificationGroupTypeMessages::ID:
|
||||
|
@ -130,4 +130,11 @@ int64 Bitmask::size() const {
|
||||
return static_cast<int64>(data_.size() * 8);
|
||||
}
|
||||
|
||||
StringBuilder &operator<<(StringBuilder &sb, const Bitmask &mask) {
|
||||
for (int64 i = 0; i < mask.size(); i++) {
|
||||
sb << (mask.get(i) ? '1' : '0');
|
||||
}
|
||||
return sb;
|
||||
}
|
||||
|
||||
} // namespace td
|
||||
|
@ -34,11 +34,6 @@ class Bitmask {
|
||||
std::string data_;
|
||||
};
|
||||
|
||||
inline StringBuilder &operator<<(StringBuilder &sb, const Bitmask &mask) {
|
||||
for (int64 i = 0; i < mask.size(); i++) {
|
||||
sb << (mask.get(i) ? '1' : '0');
|
||||
}
|
||||
return sb;
|
||||
}
|
||||
StringBuilder &operator<<(StringBuilder &sb, const Bitmask &mask);
|
||||
|
||||
} // namespace td
|
||||
|
Loading…
Reference in New Issue
Block a user