2021-09-20 22:30:23 +03:00
|
|
|
//
|
2023-01-01 00:28:08 +03:00
|
|
|
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
|
2021-09-20 22:30:23 +03:00
|
|
|
//
|
|
|
|
// 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/Slice.h"
|
|
|
|
|
|
|
|
namespace td {
|
|
|
|
|
|
|
|
// checks whether the string is an emoji; variation selectors are ignored
|
|
|
|
bool is_emoji(Slice str);
|
|
|
|
|
2021-10-05 16:12:04 +03:00
|
|
|
// checks whether emoji ends on a Fitzpatrick modifier and returns it's number or 0
|
|
|
|
int get_fitzpatrick_modifier(Slice emoji);
|
|
|
|
|
2021-10-05 23:20:49 +03:00
|
|
|
// removes all Fitzpatrick modifier from the end of the string
|
|
|
|
Slice remove_fitzpatrick_modifier(Slice emoji);
|
|
|
|
|
2022-05-12 18:02:27 +03:00
|
|
|
// removes all emoji modifiers from the string
|
|
|
|
string remove_emoji_modifiers(Slice emoji);
|
2021-09-21 06:32:34 +03:00
|
|
|
|
2022-05-12 18:02:27 +03:00
|
|
|
// removes all emoji modifiers from the string in-place
|
2021-09-21 06:32:34 +03:00
|
|
|
void remove_emoji_modifiers_in_place(string &emoji);
|
|
|
|
|
2021-12-22 13:40:20 +03:00
|
|
|
// removes all emoji selectors from the string if it is an emoji
|
|
|
|
string remove_emoji_selectors(Slice emoji);
|
|
|
|
|
2021-09-20 22:30:23 +03:00
|
|
|
} // namespace td
|